Jump to content
Sign in to follow this  
dar

How to create a scripted "Advance" order for AI?

Recommended Posts

Hey community,

 

as the title implies, I am wondering how to create a scripted "advance" order for AI. 

 

Why? When playing with an AI squad, I find that one of the most useful commands to give my team of bots is the "Advance" order by selecting the unit(s) and pressing 1, then 2 "Advance". This way the squad moves towards the next waypoint or objective in a fairly tactical manner (if in combat mode), engages on contact, covering each other. If given to a single unit, they act like a semi-competent point man. Overall, it's one of the most useful commands to put your bots on Autopilot. 

 

Now, I would like to trigger this behaviour with a script. Unfortunately, there is no simple "doAdvance" command available in the scripting command library for Arma 3. I assume the behaviour is some sort of FSM, but I have no idea where to find it.

 

Does anybody know what is going on behind the scenes when we give the 1 - 2 "Advance" order? Is there a way to replicate it / trigger it within an .sqf?

 

Any help appreciated. Many thanks in advance. 

Share this post


Link to post
Share on other sites

I'm thinking that commandFSM is the likely way to go, but I've never dug into FSMs, so not sure how/where to find FSM file names. Based on the Wiki example, my first guess would be to try:

_unit commandFSM ["advance.fsm", _position, _target];

And again, not even sure how the params might relate to each particular FSM file.

Share this post


Link to post
Share on other sites

Thanks for your reply, I'm not sure how to make that work though. Does "advance.fsm" exist? Where would I find fsm files in the game files?

 

The more practical problem is that commandFSM requires a position and target, neither of which I am able to give if I want to send a unit advancing at any time in any scenario by running a script. If I give the advance order by pressing 1 - 2, then I also don't even need to define a target or position, so I think there must be a way without those vars.

Share this post


Link to post
Share on other sites

Like I said, I'm not sure - I spent a little while poking around to no avail, and the FSM editor doesn't point to them automatically either.

 

As far as the params, they may be defined differently by each FSM, or each FSM may have completely different params. I don't know, since I cant find them to open them.

 

It might be worth asking on the A3 Discord.

Share this post


Link to post
Share on other sites

And just now taking another look through the FSM editor manual, I see this:

 

https://community.bistudio.com/wiki/FSM_Editor_Manual#FSM_Scripted

 

Quote

to make this application useful, some functions for controlling units on low level needs to be added.

 

So commandFSM may not even be viable at this time - it's all rather unclear.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×