Jump to content
XxHardcoreGamerxX

How to make AI pilot fly slower in Arma 3 Eden Editor?

Recommended Posts

I have a scenario where the AI pilot of a blackfish gunship follows a loiter waypoint and circles enemy vehicles while I shoot at them, but he flies so fast it's hard for me and the other gunner to aim. I tried opening the waypoint attributes and changing the speedmode to limited but that didn't do anything.

 

Any help on how to make the AI fly slower is greatly appreciated

Share this post


Link to post
Share on other sites
5 hours ago, RCA3 said:

@XxHardcoreGamerxX,

Never tried this on air vehicles but try this:

https://community.bistudio.com/wiki/limitSpeed

will not work if you engage an enemy,

 

this works when put in init field of vehicle:

if ( not isServer ) exitWith {}; 
myWantedSpeedLimit = 100; 
 
this spawn { 
 private ["_speed_vector", "_speed_dir"]; 
 private _vec = _this; 
 
 while {alive _vec} do 
 { 
  _speed_vector = velocity _vec; 
  if ( ( vectorMagnitude _speed_vector ) > ( myWantedSpeedLimit / 3.6 ) ) then 
  { 
   _speed_dir = vectorNormalized _speed_vector; 
   if (local _vec) then 
   { 
    _vec setVelocity (_speed_dir vectorMultiply ( myWantedSpeedLimit / 3.6 ) ); 
   } else 
   { 
    [ _vec, (_speed_dir vectorMultiply ( myWantedSpeedLimit / 3.6) ) ] remoteExec ["setVelocity", _vec]; 
   }; 
  }; 
  sleep diag_deltaTime; 
 };  
};

 

during flight when playing as host you can adjust speed limit by opening debug console and type:

myWantedSpeedLimit = 50;

 

  • Like 3

Share this post


Link to post
Share on other sites
12 hours ago, XxHardcoreGamerxX said:

I have a scenario where the AI pilot of a blackfish gunship follows a loiter waypoint and circles enemy vehicles while I shoot at them, but he flies so fast it's hard for me and the other gunner to aim. I tried opening the waypoint attributes and changing the speedmode to limited but that didn't do anything.

 

Any help on how to make the AI fly slower is greatly appreciated

 

The simplest way is to set the group's speed to limited, set the pilot's behaviour to careless, and disable his autocombat. I've used this myself, and I know it works well. 

 

Put this into the pilot's init.

 

Quote

this DisableAI "AUTOCOMBAT";

 

  • Like 4

Share this post


Link to post
Share on other sites

The limitSpeed works fine in safe or aware condition. the flyinHeight is a little bit clunky but work also, (better in aware behavior).

 

In init code of the pilot :

group this setBehaviour "aware"; // just in case, as reminder
{this disableAI _x} forEach ["fsm","autocombat","target","autotarget"];
vehicle this limitSpeed 40;
vehicle this flyInHeight 30;

What else?

I added "fsm","target","autotarget" based on my experience for landing helos in combat mode. Just test combination.

and..

there is no way to limit speed in a loiter waypoint (the radius, direction and altitude work, but no way for the speed,... except if you play with setVelocity as above, with a weird helo attitude for low speed).

  • Like 2

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

×