Skip to content

Instantly share code, notes, and snippets.

@jameslkingsley
Created February 4, 2016 18:51
Show Gist options
  • Save jameslkingsley/83b95adc51d2e0ed4495 to your computer and use it in GitHub Desktop.
Save jameslkingsley/83b95adc51d2e0ed4495 to your computer and use it in GitHub Desktop.
{
//_x disableAI "MOVE"; // Disables move to enable animations
[_x, _grp, _cover] spawn {
PARAMS_3(_x,_grp,_cover);
while {(_x distance _cover) > 1} do {
_coverdir = [(getpos leader _grp), getpos _cover] call BIS_fnc_dirTo;
_grp setFormDir _coverdir;
_x setDir _coverdir;
_sup = getSuppression _x;
if (_sup > 0.2) then {
_x playMove "AmovPercMevaSlowWrflDf"; // Sprint
diag_log format ["FUNC: MOVE TO COVER - %1 is now sprinting!", _x];
sleep 0.621;
} else {
_x playMove "AmovPercMrunSlowWrflDf"; // Jog
diag_log format ["FUNC: MOVE TO COVER - %1 is now jogging!", _x];
sleep 1.396;
};
};
//_x enableAI "MOVE";
};
} forEach (units _grp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment