Jump to content

Mix0n

Can't setCaptive on unit

Recommended Posts

So I have a patient spawner that spawns civillians with a damaged limbs for medical training. However, these guys start to run away sometimes as we are working on them and I'm trying to figure out how to set them captive without having to chase them down and try to flexcuff them or spawn a new one.

Here's the code on the spawner can anyone help with this? Thanks!

 

[MedicalData1,3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
_group1=createGroup civilian;
'C_Man_1_enoch_F' createUnit [getmarkerPos 'patient1', _group1,'pat1=this; dostop pat1'];
[pat1, selectRandom[0.3,.4,.5,.6], "leg_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "leg_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "body", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3], "head", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "hand_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "hand_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[MedicalData1,0] call BIS_fnc_dataTerminalAnimate;
hint 'Minor Patient Spawned';

pat1 addEventHandler ["Dammaged",
{
  _unit = _this select 0;
  _part = _this select 1;
  _dam = _this select 2;
  if ((_part == "") and (_dam > 0.95)) then {_dam = 0.1};
   _dam
}];

//the first selctrandom chooses a randomish damage from a small one to a large one, the second selectrandom chooses the type of damage.

Share this post


Link to post
Share on other sites

What setCaptive essentially does is make the targeted unit a civilian, it doesn't "capture" them.

 

Try:

pat1 disableAI "MOVE"; 

 

  • Like 2

Share this post


Link to post
Share on other sites

Or set their behavior to "CARELESS" to avoid them being spooked by whatever is going on around them. 

  • Like 3

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

×