• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
FAForever Forums
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login

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

Scheduled Pinned Locked Moved Mapping
13 Posts 6 Posters 1.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    VirusX
    last edited by VirusX 8 Oct 2022, 08:07 10 Aug 2022, 08:06

    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...

    A 1 Reply Last reply 21 Sept 2022, 17:06 Reply Quote 0
    • S Offline
      Saver
      last edited by 21 Sept 2022, 15:43

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

      auch mal fünf gerade sein lassen

      1 Reply Last reply Reply Quote 0
      • U Offline
        Uveso
        last edited by 21 Sept 2022, 16:48

        @VirusX

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

        M 1 Reply Last reply 7 Jan 2023, 08:34 Reply Quote 0
        • A Offline
          Anachronism_ @VirusX
          last edited by Anachronism_ 21 Sept 2022, 17:06

          @virusx

          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.

          pfp credit to gieb

          M 1 Reply Last reply 6 Jan 2023, 06:59 Reply Quote 1
          • D Offline
            DDDX
            last edited by DDDX 18 Nov 2022, 18:52

            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...)

            M 2 Replies Last reply 6 Jan 2023, 06:51 Reply Quote 0
            • M Offline
              MrShady @DDDX
              last edited by 6 Jan 2023, 06:51

              @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?

              1 Reply Last reply Reply Quote 0
              • M Offline
                MrShady @Anachronism_
                last edited by 6 Jan 2023, 06:59

                @penguin_ thx)

                1 Reply Last reply Reply Quote 0
                • M Offline
                  MrShady @DDDX
                  last edited by MrShady 1 Jun 2023, 07:41 6 Jan 2023, 07:15

                  @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 correctly

                  blank 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 though

                  Do I maybe need to implement [if] [end] stuff?

                  1 Reply Last reply Reply Quote 0
                  • U Offline
                    Uveso
                    last edited by 6 Jan 2023, 17:01

                    @MrShady and @VirusX

                    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.

                    M 2 Replies Last reply 7 Jan 2023, 00:57 Reply Quote 0
                    • M Offline
                      MrShady @Uveso
                      last edited by 7 Jan 2023, 00:57

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        MrShady @Uveso
                        last edited by MrShady 1 Jul 2023, 05:17 7 Jan 2023, 02:49

                        @uveso
                        @Penguin_
                        @DDDX

                        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.programming genius.JPG

                        Deleted function OnStart because it bugged me and now game starts and my units appear but they never move to the center...

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          MrShady @Uveso
                          last edited by 7 Jan 2023, 08:34

                          @uveso could you tell me where perftest_script.lua located?

                          1 Reply Last reply Reply Quote 0
                          • U Offline
                            Uveso
                            last edited by 7 Jan 2023, 14:55

                            @MrShady

                            i only know the location on the repository (Git-Hub):

                            https://github.com/FAForever/fa/tree/deploy/fafdevelop/testmaps/PerfTestOriginal

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post