Jump to content
gc8

AI face direction

Recommended Posts

Hello 

what is the best way to make AI in group to face certain direction? simply setdir does not work as the AI turns back to where it was facing.

 

thx!

Share this post


Link to post
Share on other sites

Yeah, I noticed some interesting behaviour with groups. I haven't found a reliable to keep them in place and not turn immediately on mission preview, other then disableAI "MOVE". However that, naturally, also prevents them from engaging anything outside los. BIS_fnc_ambientAnimCombatSTAND_IA is pretty much default standing anim iirc. So one can, for example, combine this disableAI "PATH"; and [this, "STAND_IA", "ASIS"] call BIS_fnc_ambientAnimCombat; to keep them in place, make them face desired direction and react to combat.

 

EDIT: actually, disableAI may not even be necessary if you use BIS_fnc_ambientAnimCombat. So, maybe something like:

{if (local _x) then {[_x, "STAND_IA", "ASIS"] call BIS_fnc_ambientAnimCombat};} forEach (units (group this));
  • Thanks 1

Share this post


Link to post
Share on other sites

setFormDir perhaps. It should change facing direction for whole group. If only one AI should change direction, I would try temporary removing him from the group. 

Share this post


Link to post
Share on other sites

@Janez Although that's unusual code it seems to work perfectly, thanks!

 

@Rydygier Tried that one already

Share this post


Link to post
Share on other sites

To add onto this post, an easier alternative is to have the unit do the following:

_unit doWatch _obj; // (or _pos)

//Sometimes this encourages the unit to doWatch

_unit doFire _obj;

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

×