The first part of this little tutorial couldn't have been done without the help of
ElGotele, whose script for his Pegasus Bridge map included in OBM 1.0 was the key to learn how a night effect using LUA scripts can be done in Blitzkrieg without need of changing tiles or skins (even thought maybe the result isn't as good as it was in Desert's
Operation Vampire).
The code is as simple as what follows:
function DebugView()
Password( "www.dtf.ru" );
ChangeWarFog(2); -- Night.
Suicide();
end;
function Init()
RunScript("DebugView", 0000);
end;
The second part of this tutorial explains how an allied IA can be created in Blitzkrieg. It's basically a copy of what
tedi88 posted on
Blitz Srbija, so all the credits of this part go to him (well, we should also mention
Stanenberg who helped to understand how it works and provided examples). Here are his wise words:
--------------------------------------------------------------------------------------------------------------------------
Tutorial for having several sides in single player map in BK, consists of 2 phases.
Phase 1 is done in MapEditor and includes adding new players to the map. Phase 2 requires a small script.
I - So Phase 1 consists of 4 steps:
1. Access the
diplomacy tab in MapEditor (picture).
2. After you click on it will show a window which has following list of players:
Player 0 - Players forces
Player 1 - Enemy forces
Player 2 - Neutral forces
To increase the number of players you'll need to click on "
Add" button. Be careful as the field which says "
Game Type"
must be set to Single Player. You can add a maximum of 16 players.
You must have at least one player that is "Side 0" (player), "Side 1" (enemy) and one player that is "Side 2" Neutral. For the remaining players it's up to you who will be enemy and who'll be the ally. One thing is certain there are a lot of possible combinations.
Game will by default assign players to Side 0 or 1 using the following system (this example uses 5 players):
Player 0 - Players forces
Player 1 - Enemy forces
Player 2 - Player 0 allies
Player 3 - Player 1 allies
Player 4 - Neutral forces
You of course don't have to follow that, you can change it as you wish by selecting Player and then selecting Side 0 or Side 1. (see the pictures below):
Once you decided how many players and which side they'll support it's click OK and you're done here.
3. This is an optional step, but it might be wise to do it.
See it's not enough to simply add sides. MapEditor won't assign different factions automatically. You'll have to do it manually. In MapEditor underneath diplomacy tab there is "
Units Creation Info" tab. Open it.
It will show all players
except "Neutral Player" (in this case player 4). Click on a plus and then click on a "
Party Name". Select the faction from the menu that shows up. This servers the purpose of changing Gunners on arty. Unless this is selected Gunners will still be like default ones (in this case USSR).
After that we have nearly finished Phase 1.
4. Final step is:
No matter how many different players you place, under no circumstances you may place new Player (Player 3, 4, 5, etc) unit on a map. When you double click on a unit you can see the choice between the players. Leave it at 0 or 1. (see the picture)
Reason for this is simple:
if you change the player on the unit in MapEditor and then start a map, the unit will not show up. You can't even call it via reinforcement script.
This step also has one more thing to do: assign ScriptID to a unit. Place any script ID on a unit (don't forget it). For example I placed ScriptID 4999 for Player 0 allies and 4998 for Player 1 Allies (enemy). (see the picture)
Finally we have completed the Phase 1.
II - Phase 2 is a lot more simpler it consists of two steps:
Step 1: anywhere in the script place the following lines (I placed them in function Init() )
function Init()
ChangePlayer(4998, 3); ------4998 ScriptID, 3 - Player
ChangePlayer(4999, 2); ------4999 ScriptID, 2 - Player
Suicide();
end;
This means that as soon as the map is started units that are assigned ScriptID of 4998 and 4999 will change Players. You can add multiple units under the same ScriptID.
After the change take place you'll be able to see what your allies can see. Units will also engage the enemy. You still must give them commands for the AI (Move commands, Ressuply commands etc).
Step 2: It's not really a step but a test to see if everything runs (as you'll see in the picture).
As you'll notice you can see what your allies see - there's no need to change Fog of War or anything else.
--------------------------------------------------------------------------------------------------------------------------