Army 17 -AI units -How to get them to patrol?
-
Folks, I know you can add Army 17 Civilian units to attack when players get within range....but I was wondering with the editor is there a way to simply put them on patrol or assign them waypoints to circle around an area and fire upon contact with players in range or patrol it? Is this something I can do with the Faf Editor?
-
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.
-
thanks however, where in the map editor do I assign these IssuePatrol commands? Possible screenshot of the steps if you can? or just breif walkthru of how to assign these commands to a specific unit?
thnx
-
You would assign these commands by writing code in the script file for your map that is located in your map's folder. You could open it with a program such as Notepad++. You can read about how to code in lua online, you can ask questions in the mapping and modding channels of the FAF Discord, and you can look at other maps' script files to see what they did (I mentioned the Tower Defense Survival map before as that has some relevant example usage that you could look at).
-
thnx