How to make Extra Armies do more stuff? (Patrol, Attack, etc.)
-
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,
seeperftest_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.
-
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...)
-
@dddx hey man this is virus from another acc. thx for advice,
great survival maps btw!It was 10/10 soon as I saw text above the map written with terrain brush
gonna have to study your scripts
do you have discord?
-
@penguin_ thx)
-
@dddx not sure what's wrong, maybe something to do with map type, cuz it's skirmish.
when starting the game units dont spawn, however music plays.
all unit names are named correctlyblank marker in the center "SURVIVAL_CENTER_1"
"ARMY_17" and "GROUP_101"local Air1 = ScenarioUtils.CreateArmyGroupAsPlatoon('ARMY_17','GROUP_101','AttackFormation')
Air1:AggressiveMoveToLocation(ScenarioUtils.MarkerToPosition("SURVIVAL_CENTER_1"))edit yeah I dont think it's something to do with map type
probably units spawn info missing
+music and in-game time works, I can move cursor, no units are spawning thoughDo I maybe need to implement [if] [end] stuff?
-
2 accounts? - interesting.
Mostly if you script something and you got a gamestart that is "empty" then you should check the game.log for errors.
If you see a lot of errors, only worry about the first one. If you fix the first one, all subsequent errors may go away.
You can also post the "full" game.log here (use pastebin.com) and we can take a look at it.
-
This post is deleted! -
Okay so com is spawning now, but I noticed that as soon as I rename selected group of units in the Map Editor anything other than 'INITIAL' (even without touching scripts) - they simply never spawn.
When I rename that group back to 'INITIAL' they can spawn.
I decided to address them as 'INITIAL' to patrol, but then they don't spawn again
I believe this group or even army 'ARMY_17' should be pre-defined earlier.
No idea how to do this though.Sorry guys I'm not experienced with code at all.
Deleted function OnStart because it bugged me and now game starts and my units appear but they never move to the center...
-
@uveso could you tell me where perftest_script.lua located?
-
i only know the location on the repository (Git-Hub):
https://github.com/FAForever/fa/tree/deploy/fafdevelop/testmaps/PerfTestOriginal