Jump to content
ValorTR

Help with the vanilla eden revive scripts

Recommended Posts

I'm trying to get a script that will stop damage after getting incapacitated and force them out of a vehicle if it explodes. I want bleedout to be exclusively based on time not players getting double tapped. We run without ACE medical and we use default arma revive in the eden editor. If anyone is willing to share a script that does this, i would love the help. I'm not fluent in arma scripting and i run missions with a group of 20+ friends. I want this script for us but I'm struggling to get this the way i want. Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

You could try this script. Everything can be scripted /modified for your project. The vehicle ejection works fine. Not sure to understand the "getting double tapped".

  • Like 3

Share this post


Link to post
Share on other sites

Make take some reading on your behalf but I'm sure you can find plenty of info from these threads...

https://forums.bohemia.net/search/?&q=revive&author=Larrow

Just take into account that there was a major rewrite of the revive system in 1.66 from memory, and some of these threads are maybe from before this, but should give you enough information to get you looking in the right place.

  • Like 2

Share this post


Link to post
Share on other sites
7 hours ago, pierremgi said:

You could try this script. Everything can be scripted /modified for your project. The vehicle ejection works fine. Not sure to understand the "getting double tapped".

Double tap meaning once someone is incapped, with the normal eden revive if they take additional damage while incapped they die.

I tested the script with init and it still kills you when this happens. I also noticed friendly ai will get fatally shot and stand back up as civ faction.

Share this post


Link to post
Share on other sites

I added a different script to prevent dmg after being incapped in the initplayerlocal but friendly AI seem to get shot, get incapped, then stand back,convert to civ faction, and cant die afterwards. This happens with and without the initplayerlocal script i added.

Share this post


Link to post
Share on other sites
4 hours ago, ValorTR said:

Double tap meaning once someone is incapped, with the normal eden revive if they take additional damage while incapped they die.

I tested the script with init and it still kills you when this happens. I also noticed friendly ai will get fatally shot and stand back up as civ faction.

Yes, it was just to get an idea of what you can obtain. I'd rather make them captive than invulnerable for more realism.

But if you want some invulnerable wounded during the incap phase, it's fine. You just have to fall back in vulnerable feature if heallty or.. dead (by revive timer), or... respawned (by player menu).

It seems always easy first, then all particular cases can add many extra lines in the script. example?  Player ejection from an aircraft....

 

Try this code in initPlayerLocal.sqf:


 

MGI_fn_woundedInv = {
  params ["_plyr"];
  _plyr addEventHandler ["handleDamage", {
    params ["_plyr","","_dam"];
      private _veh = objectParent _plyr;
      if (!isnull _veh  && isNil {_veh getVariable "shootVeh"} && (damage _veh > 0.7 or (!canfire _veh && !canMove _veh) or _dam > 0.7)) then {
      _veh setVariable ["shootVeh",true];
      moveOut _plyr;
    };
    if (isNull objectParent _plyr) then {
      if !(_plyr getVariable ["plUncsious",false]) then {
        _plyr setVariable ["plUncsious",true];
        _plyr spawn {
          _plyr = _this;
          waituntil {sleep 0.5; lifeState _plyr == "incapacitated"};
          [_plyr,false] remoteExec ["allowDamage",_plyr];
          waituntil  {sleep 0.5; lifeState _plyr != "incapacitated"};
          [_plyr,true] remoteExec ["allowDamage",_plyr];
          uisleep 0.5;
          _plyr setVariable ["plUnscious",false]
        };
      };
    };
  }];
};
player call MGI_fn_woundedInv;
player addEventHandler ["respawn", {(_this select 0) setVariable ["plUncsious",false]}];

 

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Yes, it was just to get an idea of what you can obtain. I'd rather make them captive than invulnerable for more realism.

But if you want some invulnerable wounded during the incap phase, it's fine. You just have to fall back in vulnerable feature if heallty or.. dead (by revive timer), or... respawned (by player menu).

It seems always easy first, then all particular cases can add many extra lines in the script. example?  Player ejection from an aircraft....

 

Try this code in initPlayerLocal.sqf:


 


MGI_fn_woundedInv = {
  params ["_plyr"];
  _plyr addEventHandler ["handleDamage", {
    params ["_plyr","","_dam"];
      private _veh = objectParent _plyr;
      if (!isnull _veh  && isNil {_veh getVariable "shootVeh"} && (damage _veh > 0.7 or (!canfire _veh && !canMove _veh) or _dam > 0.7)) then {
      _veh setVariable ["shootVeh",true];
      moveOut _plyr;
    };
    if (isNull objectParent _plyr) then {
      if !(_plyr getVariable ["plUncsious",false]) then {
        _plyr setVariable ["plUncsious",true];
        _plyr spawn {
          _plyr = _this;
          waituntil {sleep 0.5; lifeState _plyr == "incapacitated"};
          [_plyr,false] remoteExec ["allowDamage",_plyr];
          waituntil  {sleep 0.5; lifeState _plyr != "incapacitated"};
          [_plyr,true] remoteExec ["allowDamage",_plyr];
          uisleep 0.5;
          _plyr setVariable ["plUnscious",false]
        };
      };
    };
  }];
};
player call MGI_fn_woundedInv;
player addEventHandler ["respawn", {(_this select 0) setVariable ["plUncsious",false]}];

 

 

I don't like how the friendly AI still gets up and starts shooting enemies even after they are incapped and switched to civ faction with the big revive script you linked me to. I am mostly content with the vanilla eden revive but its just the ejecting after vehicle vehicle explosion and being invul during unconscious that i want for my revive settings on my missions. I really appreciate your help btw. Seems like you have helped me with the being invul while incapped but the overall revive script you gave me seems to have a few quirks that im not a fan of.

Share this post


Link to post
Share on other sites

That's the reason I wrote you a simpler, smaller script as the answer of your post. It seems to me you didn't test it alone!

  • Thanks 1

Share this post


Link to post
Share on other sites
13 minutes ago, pierremgi said:

That's the reason I wrote you a simpler, smaller script as the answer of your post. It seems to me you didn't test it alone!

OOOkay. Yeah my error. I didn't remove the big script. that small script you gave me works perfectly. I've been ever so slowly learning how to do this on my own but i have no coding background. Thank you for your time man. Arma community is the best! More specifically you man. Thanks again.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 7/10/2018 at 12:57 AM, pierremgi said:

 


MGI_fn_woundedInv = {
  params ["_plyr"];
  _plyr addEventHandler ["handleDamage", {
    params ["_plyr","","_dam"];
      private _veh = objectParent _plyr;
      if (!isnull _veh  && isNil {_veh getVariable "shootVeh"} && (damage _veh > 0.7 or (!canfire _veh && !canMove _veh) or _dam > 0.7)) then {
      _veh setVariable ["shootVeh",true];
      moveOut _plyr;
    };
    if (isNull objectParent _plyr) then {
      if !(_plyr getVariable ["plUncsious",false]) then {
        _plyr setVariable ["plUncsious",true];
        _plyr spawn {
          _plyr = _this;
          waituntil {sleep 0.5; lifeState _plyr == "incapacitated"};
          [_plyr,false] remoteExec ["allowDamage",_plyr];
          waituntil  {sleep 0.5; lifeState _plyr != "incapacitated"};
          [_plyr,true] remoteExec ["allowDamage",_plyr];
          uisleep 0.5;
          _plyr setVariable ["plUnscious",false]
        };
      };
    };
  }];
};
player call MGI_fn_woundedInv;
player addEventHandler ["respawn", {(_this select 0) setVariable ["plUncsious",false]}];

 

Hate to bring this up again but when i tested this by myself it worked fine but after further play with this script it seems unreliable. sometimes they instant die and sometimes it works as intended. Running people over seems to perma kill them no matter what. I don't know what to do about this. :(

Share this post


Link to post
Share on other sites

This code works for players only. You can add it for any units with incapacitated mode (which means some scripts for that).

I can't test right now the "run over" test (2 players for that). If somebody has any clue about this case...

Share this post


Link to post
Share on other sites
36 minutes ago, pierremgi said:

This code works for players only. You can add it for any units with incapacitated mode (which means some scripts for that).

I can't test right now the "run over" test (2 players for that). If somebody has any clue about this case...

I tested this with 3 other people and this is what we found with this script

Share this post


Link to post
Share on other sites
Just now, ValorTR said:

I tested this with 3 other people and this is what we found with this script

Sorry, no clue about how things are linked in Arma engine,  between the collision damage (run over) and the damage / unconscious state of the crushed guy.

Perhaps the sleep inside waitUntil is too long. Try without.


 

Spoiler

 

MGI_fn_woundedInv = {

  params ["_plyr"];

  _plyr addEventHandler ["handleDamage", {

    params ["_plyr","","_dam"];

    private _veh = objectParent _plyr;

    if (!isnull _veh && isNil {_veh getVariable "shootVeh"} && (damage _veh > 0.7 or (!canfire _veh && !canMove _veh) or _dam > 0.7)) then {

      _veh setVariable ["shootVeh",true]; moveOut _plyr;

     };

     if (isNull objectParent _plyr) then {

       if !(_plyr getVariable ["plUncsious",false]) then { _plyr setVariable ["plUncsious",true]; _plyr spawn {

         _plyr = _this;

         waituntil { lifeState _plyr == "incapacitated"};

         [_plyr,false] remoteExec ["allowDamage",_plyr];

         waituntil { lifeState _plyr != "incapacitated"};

         [_plyr,true] remoteExec ["allowDamage",_plyr];

         uisleep 0.5;

         _plyr setVariable ["plUnscious",false]

       };

     };

   };

  }];

};

player call MGI_fn_woundedInv;

player addEventHandler ["respawn", {(_this select 0) setVariable ["plUncsious",false]}];

 

 

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

×