Jump to content
scottdog62

how to make a unit once shot not die but be incapacitated

Recommended Posts

Is there a script or way to make a unit incapacitated?

I want a battle where once one of the units shot will not die but be kind of incapacitated, so that later you can personally execute him.

Share this post


Link to post
Share on other sites

You can put this in the mission init

 

//Modified Wound System**********
{
   _x addEventHandler ["HandleDamage",{
_dam = _this select 2;
    if (_dam > 0.9) then {
        _dam = 0.8};
         _dam }
      ];

} foreach playableunits+switchableunits;

 

and use any revive script you want to allow for the incapacitated state.

You may need to look for the bleedout timer section of the script and put the time to -1. Sometime the script my overwrite the code above and the unit will die.

 

you can put put the this code in the unit/units init

 

this addEventHandler [""HandleDamage"", {_dam = _this select 2; if (_dam >0.9) then {_dam = 0.8}; _dam }; 

however the code will not work if you are using game save then use the above.

 

this addEventHandler ["HandleDamage", {_dam = _this select 2; if (_dam > 0.9) then {_dam = 0.8}; _dam }];    this is working code 

 

The only issue if you use the frist code is that any unit placed on the map via editor will never die however if you copy the units to clipborad and spawn the units in the code will not work and the units will die. You can maybe set the code for what ever side you want  west, east ect but I always spawn the units in with triggers. Only playable units on place down via editor for my mission.

Share this post


Link to post
Share on other sites

thanks,

might be a spelling mistake in the second code comes up with missing " ] " bracket

Share this post


Link to post
Share on other sites

Well yeah, it lacks the ]; at the end, as far as I can see and without testing it ingame.

Share this post


Link to post
Share on other sites

hey scottdog62 I was  away for a bit.  This is the code to put into the unit init from the editor

 

this addEventHandler ["HandleDamage", {_dam = _this select 2; if (_dam > 0.9) then {_dam = 0.8}; _dam }];    this is working code  :)

 

this addEventHandler [""HandleDamage"", {_dam = _this select 2; if (_dam >0.9) then {_dam = 0.8}; _dam }];  this is not working code :(

 

I had a extra " ​and was missing an ]

 

 

​You need to add a revive script to allow for the units to be incapacitated if not they will not take anymore damage  and never be incapacitated.

Share this post


Link to post
Share on other sites

Thanks trying to find the right revive script now, one that works in single player for AI.

Anyone know the best one for singleplayer?

Share this post


Link to post
Share on other sites

finally got it working using pcychos wound script.
one more thing i need is to free a captured soldier from the a squad of enemies, but i want the unit to be moving with the squad(as you need to ambush the squad), and once there all dead he becomes free. any help?

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

×