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

    Army 17 -AI units -How to get them to patrol?

    Scheduled Pinned Locked Moved Mapping
    5 Posts 2 Posters 281 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.
    • O
      OnceHandsome
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • Anachronism_A
        Anachronism_
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • O
          OnceHandsome
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • Anachronism_A
            Anachronism_
            last edited by

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

            pfp credit to gieb

            1 Reply Last reply Reply Quote 0
            • O
              OnceHandsome
              last edited by

              thnx

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