Jump to content
MANTIA

A.I. HVT in Vehicle (Surrender/Captive)

Recommended Posts

Hey guys.  I've been banging my head over this one for a day and a half now.  

 

I've searched these forums, google, ect and have found a ton of possible solutions but every time I test it out on a dedi server =  no success.

 

Basically I want a HVT (no weapon) in a vehicle convoy.  When players shoot out the tires or render the vehicle disable the HVT and his body guards jump out. Players eliminate the enemy shooters and then capture the HVT.

 

Everything goes well until its time to capture the HVT.  First I just left it up to the players to run him down and use the ACE3 zip ties and "capture".  However it turns into a Benny Hill episode with 4 guys chasing the HVT forever trying to get and hold the ace option to capture.  Next solution was just to shoot a 40mm stun grenade at him and then grab him up.  Except it doesnt work too well and usually turns into the HVT chase again.  Best solution is for this HVT to not move or move extremely slow as if "surrendering or giving up". 

 

Things I have tried:

3den enhanced (captive)  = doesnt seem to work after he gets out of the vehicle on a dedi server (works great in mission preview)

ACE3 set captive and surrender =  same as above 

disable simulation in eden editor = same as above

this allowFlee 0  =  same as above

disable "MOVE"  = once he is zipped then we cant move him 

 

In short I need him to exit the vehicle and then not move while allowing a player to take him captive.

Any ideas?  

 

 

Share this post


Link to post
Share on other sites

Uh, wow. Very interesting post. However: With the interaction of ACE3 u can't select the veichle and load out the passenger from it?

Share this post


Link to post
Share on other sites

You can use any of the things you tried. Unfortunately, you need to run it where the AI is local, which is probably the server I'm guessing.  So check where you are calling the script from.  If you only can call it from where ever your calling it from, try looking at this - https://community.bistudio.com/wiki/BIS_fnc_MP 

Share this post


Link to post
Share on other sites

apply some code to the vehicle, assuming the unit in the vehicle is already setcaptive:

_vehicle addEventHandler [
     'GetOut',
     {
          _unit = _this select 2;
         if (captive _unit) then {
              if (alive _unit) then {
                   doStop _unit;   // alternatively:  _unit forceWalk TRUE;
              };
         };
     }
];

adjust the checks accordingly based on your requirements (he may  not already be setcaptive in the vehicle)

Share this post


Link to post
Share on other sites

I'd just let him disembark normally but use a script that makes him stop moving whenever someone nearby aims at him.

 

https://forums.bistudio.com/topic/175819-release-function-aimedat/

 

 

Something like this should work (may need some adjustments):

fnc_aimedAt = {
    private ["_actor","_target","_pos0","_pos1"];

    _actor = _this select 0;
    _target = _this select 1;

    if ( isNull _actor ) exitWith {false};
    if ( isNull _target ) exitWith {false};

    if ( weaponLowered _actor ) exitWith {false};
    if ( _target knowsAbout _actor < 3 ) exitWith {false};


    _pos0 = getPosASL _actor;
    _pos1 = getPosASL _target;

    ( ( ( _pos0 vectorAdd ( (_actor weaponDirection (currentWeapon _actor)) vectorMultiply (_pos0 distance _pos1) ) ) distanceSqr _pos1 ) < ((_this select 2)^2) )
};


while (alive HVT) {
    if ({ ((_x select 3) > 5) && ([_x select 4, HVT, 2] call fnc_aimedAt) } count (VIP nearTargets 20) > 0) then {
        doStop HVT;
        VIP disableAI "MOVE";
    } else {
        VIP enableAI "MOVE";
    };
    sleep 0.5;
};
  • Like 1

Share this post


Link to post
Share on other sites

Hey guys, thanks for all the replies. 

 

Decently new to mission editing.

 

Should I run these through a sqf that I can through the mission init file when the mission begins?

Share this post


Link to post
Share on other sites

Where do I place this? Init of HVT or Vehicle?

 

I'd just let him disembark normally but use a script that makes him stop moving whenever someone nearby aims at him.

 

https://forums.bistudio.com/topic/175819-release-function-aimedat/

 

 

Something like this should work (may need some adjustments):

fnc_aimedAt = {
    private ["_actor","_target","_pos0","_pos1"];

    _actor = _this select 0;
    _target = _this select 1;

    if ( isNull _actor ) exitWith {false};
    if ( isNull _target ) exitWith {false};

    if ( weaponLowered _actor ) exitWith {false};
    if ( _target knowsAbout _actor < 3 ) exitWith {false};


    _pos0 = getPosASL _actor;
    _pos1 = getPosASL _target;

    ( ( ( _pos0 vectorAdd ( (_actor weaponDirection (currentWeapon _actor)) vectorMultiply (_pos0 distance _pos1) ) ) distanceSqr _pos1 ) < ((_this select 2)^2) )
};


while (alive HVT) {
    if ({ ((_x select 3) > 5) && ([_x select 4, HVT, 2] call fnc_aimedAt) } count (VIP nearTargets 20) > 0) then {
        doStop HVT;
        VIP disableAI "MOVE";
    } else {
        VIP enableAI "MOVE";
    };
    sleep 0.5;
};

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

×