Jump to content
johnnyboy

Prevent AI from running in place?

Recommended Posts

I have a situation where player takes some unarmed AI prisoner.  There is a 30% chance per AI unit that they will run.  I use the following to make them run:

_victim forceSpeed -1;
_victim setSpeedMode "FULL";
_victim allowFleeing 1;
_victim moveTo ([_victim, 150, (random 360)] call BIS_fnc_relPos);

My problem is that very frequently, AI runs a few meters, and then is stuck in place but playing the running animation (not moving forward).  They are not blocked by any objects.  This is a terrible immersion breaker.

 

Is there someway to prevent this from happening?

 

Edit:  Haha, turns out I posted a similar topic awhile back, and @AzCoder suggested adding forceWalk false before setSpeedMode "FULL";  It seems to happen less frequently after adding that, but still happens sometimes.   Does anybody have an airtight solution?

 

Share this post


Link to post
Share on other sites

try

_victim allowSprint false;

I use the following script to in SAD hunt player function:

	{_x allowSprint false; _x doMove _p;} forEach units _g;	
	_g setSpeedMode "FULL";

 

  • Like 1
  • Thanks 1

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

×