Choose which Squad leader to spawn on (Singleplayer only)
For modders to add to their maps.
Squad system by MileHighGuy from gametoast.com
This is different from version one in that it allows you to choose which squad leader to spawn on instead of spawning on a random one. It also allows AI to spawn on the squad.
This allows you to toggle a button to determine if you want to spawn on a "squad leader" unit instead of a command post.
Currently, it doesnt work in multiplayer.
This is the second release and I might add on to it int he future. If you can read LUA, I tried to comment it so you can understand what happens.
1. Put the SquadSystem.lua in your project's data_XYZ/Common/scripts folder (where XYZ is your map's name)
2. Add SquadSystem.lua to the mission.req in data_XYZ/Common under "scripts", so it is included in the .lvl file
3. Add ScriptCB_DoFile("SquadSetup") to you map's mission lua (XYZc_con for example) at the top, so it is loaded in the specific mission
3. Initialize the "Squad System" mode. This MUST BE done after the call to ReadDataFile("ingame.lvl") in the ScriptInit() section of the map lua, as an example:
ReadDataFile("ingame.lvl")
squadSetup = SquadSetup:New()
squadSetup:addTeam(ATT, 20 , 3, 20)
squadSetup:addTeam(DEF, 20, 3, 20)
squadSetup:overrideInGameLevel()
ATT/DEF is the team, 20 is the number of units on the side, 3 in the number of squad leaders you want.
The last "20" value is the percent of AI you want to spawn on a Squad leader instead of a command post.
That should be all you have to do. Enjoy
This is awesome, thank you!
nice job bro! I'll definitely use this for my mod!
I'll try to use this on my map tommorow :D