|
Post by keepitsimple on Sept 10, 2020 12:18:40 GMT 1
If you add with diplomacy player 2 to player (side=0) then unit's with player 2 are not shown on the map (in single player map). Only side 0, side 1 and side 3 (neutral) are shown. However you can get player 2 units on the map using ChangePlayer({ScriptedID,2).
The unit must be placed on the map for side 0. After ChangePlayer command the unit is no longer controllable by the player, but it remains an active ally. The unit will defend itself against the AI. The AI will also see it as an enemy unit and hence attack it.
This is brings a bit of Blitzkrieg II gameplay to Blitzkrieg I.
One possible use is in a convoy mission. The trucks in the convoy are not neutral and hence will be destroyed by AI if player doesn't keep them safe.
|
|
|
Post by keepitsimple on Sept 10, 2020 15:08:25 GMT 1
The units of player 2 can be repaired and resupplied by trucks of the player. You can also re-man a squad. However, then the squad is again for the player (side = 0). Hence, to have this working for infantry you need to keep repeating the command ChangePlayer if you don't want the player to control the squad (or of course don't have any trucks that can re-man an squad is also an option).
An example of script to change every 4 sec the squad(s) 100 back to player 2. This gives the player just 4 sec of control of an undermanned squad.
RunScript("InfantryPlayer2",4000);
function InfantryPlayer2() ChangePlayer(100,2); end;
A gun remains for player 2 as long as at least one gunner is still alive. The re-maned gunners remain for player 2. So for guns you could go for the option to destroy the gun if no gunners are left.
RunScript("Gun10",4000); RunScript("Gun11",4000);
function Gun10 DestroyGun(10); end;
function Gun11 DestroyGun(11); end
function DestroyGun(iScriptID) local gun=GetNUnitsInScriptGroup(iScriptId); if gun==0 then DamageObject(iScriptID, GetObjectHPs(iScriptID)); Suicide(); end; end;
|
|
|
Post by keepitsimple on Sept 28, 2020 10:32:21 GMT 1
Unit of player 2 can be loaded with infantry by the player (you can't load infantry into a neutral unit). The player can't unload this infantry. This can only be done by script.
An possible use might be boats. You infantry can load itself on to a boat. The boat can detect that is being loaded. After this is might move and unload on the other side. Ones unload the unit is again avialabe to player. The boat could then return and be loaded again.
A second possible use is to make SPG like the Maider have man loaded. Ones load the SPG would be avialable for the player. If no man is loaded the SPG should return to player 2. This would make Maider less like tanks as infantry is more easily killed from an unit. The problem is to detect if there is still infantry loaded on the unit (not all killed).
|
|
|
Post by keepitsimple on Sept 28, 2020 21:10:21 GMT 1
Landing in action In opening of the game the boats are change from player (0) to player 2 (side =0). The player can only wait till the infantry is disembark. Then he can direct the infantry. The boats return back to sea. function Start() ChangePlayer(1001,2); ChangePlayer(1002,2); ChangePlayer(1003,2); ChangePlayer(1004,2); ChangePlayer(1005,2); Suicide(); end; function RevealObjective0() ObjectiveChanged(0, 0); Boat(1001, GetScriptAreaParams("L1")); Boat(1002, GetScriptAreaParams("L2")); Boat(1003, GetScriptAreaParams("L3")); Boat(1004, GetScriptAreaParams("L4")); Boat(1005, GetScriptAreaParams("L5")); SwitchWeather(0); SwitchWeatherAutomatic(0); Suicide(); end; function Init() RunScript( "Start", 10); RunScript( "RevealObjective0", 2000); end; --------------------------------------------------------- --------------- New command: Boat------------------ --------------------------------------------------------- -- Boat move to point, unload there and return to it original location -- function Boat(iScriptId, xC,yC) local xB,yB =GetObjCoord (iScriptId); Cmd(0,iScriptId,xC,yC); QCmd(5,iScriptId,xC,yC); QCmd(0,iScriptId,xB,yB); end; Moving through the water to the beachLand infantry and return home
|
|
|
Post by [BMG]Neutro on Oct 17, 2020 17:33:16 GMT 1
Can the player see the units of player 2 through the fog of war like his own?
|
|
|
Post by keepitsimple on Oct 17, 2020 23:17:13 GMT 1
I did a simple test. I left out the soldiers in above example. And the answer is yes. Player 2 unit (size 0) lift the fog of war as they move
|
|
|
Post by keepitsimple on Oct 18, 2020 23:53:49 GMT 1
Convoy 1940 Game: BK Map: 8x8 MOD: None Author: KeepItSimple Season: Summer Year: 1940 Player: German army AI: BEF Scenario. You need to clear the road of the enemy before a convoy which takes the road moves along it. edit: 19-10-2020 A small bug in the script. You needed more then 4 units to make it. This is now fix and 4 is enough. ConvoyDemoFixThis is a demo to show how it works.
|
|
|
Post by keepitsimple on Oct 23, 2020 20:46:42 GMT 1
A third possible use is using together with fuel. If an unit runs out of fuel the unit changed to player(2). It remains still active unit. The player can repair and supply it. It will however not move. In present fuel script the unit is command to do nothing every x seconds. So you can move a little.
|
|
|
Post by [BMG]Neutro on Nov 5, 2020 11:03:11 GMT 1
Note: You can even place the Unit with Side 3 (Neutral) or Side 1 (Enemy) before you Changeplayer to Side 2 -- correction it will work with vehicles and Squads but not with units that have a gun crew.
|
|
|
Post by keepitsimple on Nov 5, 2020 14:51:02 GMT 1
If you use neutral instead of the player 0 then you get no gunners at a gun and no men in the truck which pulls a gun (picture upperleft corner). The latter might be desirable (having no men in the truck) if have a trailer instead of a gun. If you give the truck to the player (later) of give the order to deploy the trailer then you only get a trailer without men. The only problem is that the trailer doesn't fall to the ground when deployed but remains "in air". With a four wheel trailer this would not be a great problem. If you use player 1 instead of player 0 then you get that the gun remains occupied by the enemy (see picture lowerright corner). This I can't see as desirable. For other units like infantry, trucks or tanks you can use all three. The result is the same.
|
|
|
Post by keepitsimple on Nov 5, 2020 20:42:58 GMT 1
Pulling a trailer
|
|