Jump to content
Sign in to follow this  
Fiddi

Get AI into helicopter for combat exfil!

Recommended Posts

Hello, I'm trying to get AI to enter a helicopter while they're being fired at and around. I have tried setCaptive, allowFleeing, careless, combatMode Blue, all of the disableAi except move and anim.

 

While they're not being fired at they enter the helicopter easily and without delay. In combat there's always 1 or more that stays behind and I want them all to atleast acknowledge the order to get in, though they may be killed on the way.

 

This is the part where they get the order to get in the helicopter, they're all in seperate groups because that seemed to work best for some reason. Suprisingly the helicopter does exactly what I want which is a first for me, but it's always something...  :D

waitUntil{Sleep 1; getPos _EXHeli select 2 < 3 OR !alive _target};
if (!alive _target) then {_extractionGo = false};
{
	_x setCaptive true;
	_x setskill 1;
	_x allowFleeing 0;
	_x setBehaviour "CARELESS";
	_x setCombatMode "BLUE";	
	_x disableAi "TARGET";
	_x disableAi "AUTOTARGET";
	_x disableAi "AUTOCOMBAT";
	_x disableAi "FSM";
	_x disableAi "AIMINGERROR";
	_x disableAi "COVER";
	_x disableAi "CHECKVISIBLE";
	_x disableAi "SUPPRESSION";
} count [_target, _guard1, _guard2];
Sleep 1;
_target assignAsCargo _EXHeli;
Sleep 0.5;
_guard1 assignAsCargo _EXHeli;
Sleep 0.5;
_guard2 assignAsCargo _EXHeli;	
[_target] OrderGetIn true;
Sleep 0.5;
[_guard1] OrderGetIn true;
Sleep 0.5;
[_guard2] OrderGetIn true;
Sleep 3;
waitUntil {Sleep 1; ({!(alive _x) OR _x in _EXHeli} count [_target, _guard1, _guard2] == count [_target, _guard1, _guard2]) OR !(alive _target)};
{_x setCaptive false;} count crew _EXHeli;

Share this post


Link to post
Share on other sites
{

    _x setCaptive true;

    _x setskill 1;

    _x allowFleeing 0;

    _x setBehaviour "CARELESS";

    _x setCombatMode "BLUE";    

    _x disableAi "TARGET";

    _x disableAi "AUTOTARGET";

    _x disableAi "AUTOCOMBAT";

    _x disableAi "FSM";

    _x disableAi "AIMINGERROR";

    _x disableAi "COVER";

    _x disableAi "CHECKVISIBLE";

    _x disableAi "SUPPRESSION";

} count [_target, _guard1, _guard2];

 

 

This is nonsense.

For what you are trying to count that?

For assign a vehicle to group use addVehicle and  leaveVehicle and

Share this post


Link to post
Share on other sites

count is counting something and returning count of something.

In your case you need to do something on every unit but definitely not count them out.

how that could be faster at all ?

Share this post


Link to post
Share on other sites

count is counting something and returning count of something.

In your case you need to do something to every unit

how that could be faster at all ?

 

It executes the code within for every unit in the counted array, the difference being forEach can return anything while count only returns numbers. I'm not quite sure, but I just followed that it said on the wiki.

  • Like 1

Share this post


Link to post
Share on other sites

In any case, anything I try has little to minimal effect on the problem. I tried something like this:

[_target] join grpnull;
_target setSkill 1;
_target disableAi "TARGET";
_target disableAi "AUTOTARGET";
_target disableAi "AUTOCOMBAT";
_target disableAi "FSM";
_target disableAi "COVER";
_target disableAi "CHECKVISIBLE";
_target disableAi "AIMINGERROR";
_target disableAi "SUPPRESSION";
_target setCaptive true;
_target setSuppression 0;
_target allowFleeing 0;
_target setBehaviour "CARELESS";
_target setCombatMode "BLUE";
[_target] join group driver _EXHeli;
group driver _EXHeli addVehicle _EXHeli;
_target assignAsCargo _EXHeli;
[_target] orderGetIn true;

Worked once, but I guess that was pure luck, other times he just stood there like always.

Share this post


Link to post
Share on other sites

Apparently it was as easy as this:

{
	_x assignAsCargo _EXHeli;
	[_x] join grpnull;
	_x disableAI "AUTOCOMBAT";
	_x disableAI "CHECKVISIBLE";
	_x setBehaviour "CARELESS";
	_x setCombatMode "BLUE";
} count [_target, _guard1, _guard2];
Sleep 1;
[_target, _guard1, _guard2] OrderGetIn true;

This works, they react a bit slow but they end up where I want them soon enough.

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
Sign in to follow this  

×