Jump to content
jts_2009

Escape APEX revive state

Recommended Posts

Anyone know how to escape APEX revive state with script command or function? Im not sure how it works, maybe I just need to set some variable. 

 

If you got hit and you have apex revive enabled, you are going down unconscious with lifestate "INCAPACITATED".

 

player setdammage 0;player setUnconscious false; - doesn't really works. I can move and so on, but some function or script are still working and you die after some time. You also have this ppEffect enabled too. I need to escape this state somehow. Anyone know how to do it..? :icon5:

Share this post


Link to post
Share on other sites

Check out BIS_fnc_reviveOnState. Particularly, the STATE_REVIVED case which may help fill in the gaps. 

 

	case STATE_REVIVED:
	{
		if (_statePrev != STATE_INCAPACITATED) exitWith {};

		bis_revive_incapacitatedUnits = bis_revive_incapacitatedUnits - [_unitVar];

		//flag unit as being NOT incapacitated
		_unit setVariable ["BIS_revive_incapacitated", false];

		//display 'revived' message in kill-feed; only if revived unit is friendly
		if (bis_revive_killfeedShow && {side group player getFriend side group _unit >= 0.6}) then
		{
			if (isNull _source) then
			{
				systemChat format [MSG_REVIVED,name _unit];
			}
			else
			{
				systemChat format [MSG_REVIVED_BY,name _unit,name _source];
			};
		};

		if (local _unit) then
		{
			//reset death reason
			bis_revive_deathReason = DEATH_REASON_UNKNOWN;

			//not bleeding
			bis_revive_bleeding = false;

			//remove unconscious state
			_unit setUnconscious false;

			//hotfix: revived while performing an action & playing animation
			_unit playAction "Stop";

			//hotfix: revived while having no weapon or binocular
			if ({currentWeapon player == _x} count ["",binocular player] > 0) then
			{
				[] spawn
				{
					sleep 0.1;
					if (({currentWeapon player == _x} count ["",binocular player] > 0) && {IS_ACTIVE(player)}) then {player playAction "Civil";};
				};
			};

			//reset blood level and stored bleed damage
			_unit setVariable [VAR_DAMAGE_BLEED, 0];
			_unit setVariable [VAR_DAMAGE, 0];

			//reset 'being revived' and 'forcing respawn' flags
			if (IS_BEING_REVIVED(_unit)) then {SET_BEING_REVIVED(_unit, false);};
			if (IS_FORCING_RESPAWN(_unit)) then {SET_FORCING_RESPAWN(_unit, false);};

			//enable player's action menu
			{inGameUISetEventHandler [_x, ""]} forEach ["PrevAction", "NextAction"];

			//restore player's camera
			if (cameraView != (player getVariable [VAR_CAMERA_VIEW, "internal"])) then
			{
				[] spawn
				{
					titleCut ["","BLACK OUT",0.5];
					sleep 0.5;
					player switchCamera (player getVariable [VAR_CAMERA_VIEW, "internal"]);
					titleCut ["","BLACK IN",0.5];
				};
			};

			//remove user action
			private _actionID = _unit getVariable [VAR_ACTION_ID_RESPAWN,-1];
			if (_actionID != -1) then {[_unit,_actionID] call bis_fnc_holdActionRemove;};

			//ALWAYS heal to full
			[] call bis_fnc_reviveDamageReset;
		}
		else
		{
			//reset 'being revived' and 'forcing respawn' flags locally
			SET_BEING_REVIVED_LOCAL(_unit, false);
			SET_FORCING_RESPAWN_LOCAL(_unit, false);

			//remove revive and secure user actions
			{if (_x != -1) then {[_unit,_x] call bis_fnc_holdActionRemove}} forEach [_unit getVariable [VAR_ACTION_ID_REVIVE,-1],_unit getVariable [VAR_ACTION_ID_SECURE,-1]];

			//remove incap/dead icon
			[ICON_STATE_REMOVE,_unitVar] call bis_fnc_reviveIconControl;
		};
	};

 

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, KC Grimes said:

Check out BIS_fnc_reviveOnState. Particularly, the STATE_REVIVED case which may help fill in the gaps. 

 


	case STATE_REVIVED:
	{
		if (_statePrev != STATE_INCAPACITATED) exitWith {};

		bis_revive_incapacitatedUnits = bis_revive_incapacitatedUnits - [_unitVar];

		//flag unit as being NOT incapacitated
		_unit setVariable ["BIS_revive_incapacitated", false];

		//display 'revived' message in kill-feed; only if revived unit is friendly
		if (bis_revive_killfeedShow && {side group player getFriend side group _unit >= 0.6}) then
		{
			if (isNull _source) then
			{
				systemChat format [MSG_REVIVED,name _unit];
			}
			else
			{
				systemChat format [MSG_REVIVED_BY,name _unit,name _source];
			};
		};

		if (local _unit) then
		{
			//reset death reason
			bis_revive_deathReason = DEATH_REASON_UNKNOWN;

			//not bleeding
			bis_revive_bleeding = false;

			//remove unconscious state
			_unit setUnconscious false;

			//hotfix: revived while performing an action & playing animation
			_unit playAction "Stop";

			//hotfix: revived while having no weapon or binocular
			if ({currentWeapon player == _x} count ["",binocular player] > 0) then
			{
				[] spawn
				{
					sleep 0.1;
					if (({currentWeapon player == _x} count ["",binocular player] > 0) && {IS_ACTIVE(player)}) then {player playAction "Civil";};
				};
			};

			//reset blood level and stored bleed damage
			_unit setVariable [VAR_DAMAGE_BLEED, 0];
			_unit setVariable [VAR_DAMAGE, 0];

			//reset 'being revived' and 'forcing respawn' flags
			if (IS_BEING_REVIVED(_unit)) then {SET_BEING_REVIVED(_unit, false);};
			if (IS_FORCING_RESPAWN(_unit)) then {SET_FORCING_RESPAWN(_unit, false);};

			//enable player's action menu
			{inGameUISetEventHandler [_x, ""]} forEach ["PrevAction", "NextAction"];

			//restore player's camera
			if (cameraView != (player getVariable [VAR_CAMERA_VIEW, "internal"])) then
			{
				[] spawn
				{
					titleCut ["","BLACK OUT",0.5];
					sleep 0.5;
					player switchCamera (player getVariable [VAR_CAMERA_VIEW, "internal"]);
					titleCut ["","BLACK IN",0.5];
				};
			};

			//remove user action
			private _actionID = _unit getVariable [VAR_ACTION_ID_RESPAWN,-1];
			if (_actionID != -1) then {[_unit,_actionID] call bis_fnc_holdActionRemove;};

			//ALWAYS heal to full
			[] call bis_fnc_reviveDamageReset;
		}
		else
		{
			//reset 'being revived' and 'forcing respawn' flags locally
			SET_BEING_REVIVED_LOCAL(_unit, false);
			SET_FORCING_RESPAWN_LOCAL(_unit, false);

			//remove revive and secure user actions
			{if (_x != -1) then {[_unit,_x] call bis_fnc_holdActionRemove}} forEach [_unit getVariable [VAR_ACTION_ID_REVIVE,-1],_unit getVariable [VAR_ACTION_ID_SECURE,-1]];

			//remove incap/dead icon
			[ICON_STATE_REMOVE,_unitVar] call bis_fnc_reviveIconControl;
		};
	};

 

 

Hm, Thanks. Will check it out

Share this post


Link to post
Share on other sites

Found solution in other topic.

 

["",1,player] call BIS_fnc_reviveOnState; 
player setVariable ["#rev", 1];

 

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

×