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
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;