How to make Extra Armies do more stuff? (Patrol, Attack, etc.)


What function and/or line of code do I need to add in 'scripts' for already placed platoon group in FAF Map Editor (i.e.Extra Armies, Army_17) to patrol marker chains? Marker chains are placed in editor prior as well.

The thing here is I'm more than sure it doesn't need AI Brains like in campaign creation, but something appears to be missing still...


Hi, sorry I can't help, but I find your question very interesting.



you could look into the performance test map where many units are moved without aiBrain,
see perftest_script.lua



Here are some things you can use. You'll probably want to use IssuePatrol to multiple different locations btw. Note that you'll need to actually specify values or properly defined variables (ie: make a table of units rather than just writing TableOfUnits without setting that equal to something beforehand).

IssuePatrol(TableOfUnits, {X, Y, Z})

IssueMove(TableOfUnits, {X, Y, Z})

Platoon = ArmyBrain:MakePlatoon('','')

ArmyBrain:AssignUnitsToPlatoon(Platoon, TableOfUnits, 'Attack', 'None')

Platoon:AggressiveMoveToLocation({X, Y, Z})

You can look at my Tower Defense Survival map on the vault to see actual examples of some of these in use.

waiting for a mapgen-only TMM queue and Godot


there's one other option.
Place units on the map under a special group, then use:

local HeavyAir = ScenarioUtils.CreateArmyGroupAsPlatoon('ARMY_SURVIVAL_ENEMY', 'GROUP_01', 'AttackFormation') HeavyAir:AggressiveMoveToLocation(ScenarioUtils.MarkerToPosition("SURVIVAL_CENTER_1"))

This puts them in a platoon by default. You can time when they spawn via script, you decide where they spawn via placement on the map, and you can even add a wait+repeat so that they do this again and again (or only a certain number of times, or only while a certain building exists...)