Jump to content
Sign in to follow this  
Tiskahar

Moving units in formation fsm

Recommended Posts

Hey guys,

I'm trying to get units to move via the engine designated formation fsm. In the config file it's defined by fsmFormation.

The issue I'm trying to resolve is getting the units to move properly.

doMove and moveTo do not result in movement. setDestination causes the units to ignore collision with walls, buildings and all other objects.

Does anyone know how to get units to move in this low level environment? would a spawn command get me out of the fsm environment and into something that would allow this to work?

---------- Post added at 20:25 ---------- Previous post was at 20:19 ----------

[_this, _pos] spawn {(_this select 0) doMove (_this select 1)} does not result in movement.

Share this post


Link to post
Share on other sites

For posterity, I figured this one out.

In the original formationC.fsm, there is a loop (roughly 100 hz, if anyone is interested), which checks 'expectedDestination _this', adds in a random distance, and then '_this setDestination's it back in.

If you use a 'doMove' command, it seems to set the basic destination, and then hard coded path finding takes over and sends that information to the units 'expectedDestination.' To get the unit to follow the engine derived path finding information, you must use 'setDestination' with the information given by expectedDestination. In this example, I added a condition off my main movement state at low priority with true condition and '_this setDestination (expectedDestination _this)' as the action. There is a link to the condition from the state and right back to the state. The unit moves as desired. I haven't checked how frequently it runs yet, but I will in the future to see if the fsm tick time is a constant value, and if it is, pinpoint that value.

Also, contrary to VBS documentation, doMove command does not terminate an Arma FSM. I haven't yet tested it in VBS as my trial has expired.

Edited by Tiskahar

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  

×