Page 1 of 1

Adjust AI Vehicle Priorities?

Posted: Mon Feb 14, 2011 3:55 pm
by TerrancePickles
Is it possible to use the Mod Development Toolkit to adjust the AI vehicle priorities? What I wanted to do was to make the bots on singleplayer maps get into aircraft more--or even exclusively--rather than having them do their usual routine, which seems to be to attempt to take the spawn points on foot or in land or sea vehicles.

I am looking to tweak a couple of the larger maps--like El Alamein or Gazala--so that they are more like air combat maps such as Battle of Britain, No Fly Zone, or Aces Over Vietnam from the Eve of Destruction mod. On these maps, the bots will line up to get into aircraft almost exclusively.

Ultimately, I would love to create a map--or tweak an existing map--such that it becomes sort of an air combat team deathmatch with the only objective being to shoot down as many enemy aircraft as possible to win the map. (Each team would have an uncapturable airfield on opposite ends of the map, or something like that.) Obviously, this is easy with human players, but bots need to have their AI strategic behavior and priorities adjusted so that its fits the map.

So...is this possible?

(Please feel free to ask for more clarification if you need it...) :mrgreen:

Thanks!

Re: Adjust AI Vehicle Priorities?

Posted: Mon Feb 14, 2011 7:29 pm
by Swaffy
Example:
SoldierSpawnTemplates.con
rem -----------------------------------------
rem --- EnterOnSpawn4 ---
rem -----------------------------------------
ObjectTemplate.create SpawnPoint EnterOnSpawn4
ObjectTemplate.setSpawnId 51
ObjectTemplate.setGroup 6
ObjectTemplate.setAIEnterOnSpawn 1


[1] - Use BattleCraft '42 to edit your map, such as El Alamein. Simply place spawn points next to the airplane's cockpits, and make the airplane spawners spawn about 10 planes per spawner. You might also want to delete all non-airplane vehicles on the map, but that's optional since AI will automatically spawn in airplanes.

[2] - After saving the map, open up the map in an RFA editor [Col Cruachan's RFA Explorer (average), WinRFA (the best), MakeRFA (sucks)]. Copy the text of the "SoldierSpawnTemplates" and "SoldierSpawns" files in the Conquest folder, and paste then in the corresponding Single player folder [SST to SST, SS to SS]. If you deleted the ground vehicles, you can either copy over the text from Conquest mode, or delete the vehicles' spawn templates in ObjectSpawnTemplates and ObjectSpawns from the SinglePlayer files.

[3] - Add this line to every single soldier spawn template in the "SinglePlayer/SoldierSpawnTemplates.con" file:
ObjectTemplate.setAIEnterOnSpawn 1

Test the map out and see what happens.

Re: Adjust AI Vehicle Priorities?

Posted: Mon Feb 14, 2011 10:12 pm
by TerrancePickles
Thanks Swaffy!

It will take me a little while to get around to trying this, but I'll try to let you know what happens as soon as I can...

Re: Adjust AI Vehicle Priorities?

Posted: Tue Feb 15, 2011 5:17 am
by Swaffy
Take your time, brother. I'm in no rush.