Jump to content
KC Grimes

Grimes Simple Revive Script

Recommended Posts

Sorry guys, the MHQ deploy when I move it then there is no longer the AddAction, I would serve for TvT missions

Thx

Dario

google traslate

Sorry my error in description ;)

Edited by Dariox
resolved

Share this post


Link to post
Share on other sites

a question, you can have a teleport from the base to the MHQ?

Share this post


Link to post
Share on other sites

I do not know if anyone still follows this topic but I have a question

how do I call the variable deploy to use for other AddAction?

thx

Share this post


Link to post
Share on other sites

how do I add CfgRespawnInventory loadouts to this script?

I've got the classes in my description.ext and this in my initServer.sqf

[west, "west1"] call BIS_fnc_addRespawnInventory;
[west, "west2"] call BIS_fnc_addRespawnInventory;
[west, "west3"] call BIS_fnc_addRespawnInventory;
[west, "west4"] call BIS_fnc_addRespawnInventory;
[west, "west5"] call BIS_fnc_addRespawnInventory;
[west, "west6"] call BIS_fnc_addRespawnInventory;

but I can't get the respawn inventory menu to work with this scipt's Respawn Menu. I've been looking G_Respawn.sqf to find where I can put it but it's a bit too advanced for my knowledge.

HALP haha

Share this post


Link to post
Share on other sites

I am so sorry for neglecting this project like I have, but I am so proud to see so many people using it for great (and creative!) uses. That said, I have gotten and not responded to many e-mails and PMs, in addition to posts in this thread. I again apologize for neglecting to answer those questions, some simple and some intricate, but understand that I am at a rather difficult part in my schooling that doesn't afford me the time to stay in-tune with scripting here with y'all in ArmA 3. However, June/July I should see some major slow down in my life that will persist fairly for at least a few months, and I hope to use some free time there to pick this back up as a hobby, as it truly is enjoyable to work with peers within the community.

All of that said, until then and in the future, I ENCOURAGE those of you who see what is going on and how things are working to continue to help those who have questions, be it related to installation or doing something not implemented fully in the script, so as to keep this thread full of useful information, which I can then refine and implement (to your credit) in future official releases. This includes fixes for components that may be altered or broken secondary to game patches. I have been reading the patch notes and still play ArmA with friends once or twice a month so as to not be completely out of touch, and it doesn't seem like too much will have been altered, but my main concern is the animation phases.

Again, I appreciate the support that this script has seen, and I urge you to continue to help your peers so we can build this thing up as a team.

  • Like 1

Share this post


Link to post
Share on other sites

Just wanted to drop in and say "Love your revive script".

Best features we are enjoying:

- The eject from vehicles setting

- Loading wounded into vehicles

- A nice, non clunky interface when unconscious

GJ!

(I know you can't do much about the carry animation, it works well enough to get people moved from A to B)

Share this post


Link to post
Share on other sites

This is the only one true revive script i know so far, all others dont have the option for more than 1 death or have just unlimited lives - which doenst count as revive at all. I used norrins revive in ArmA2 alot so i see where this is coming from - this looks very promising, good job and thanks for creating this :).

That said, this script has some gamebreakers in coop on dedicated server however:

-When i was dead it told me to press C to show camera, did nothing for me and i couldnt control the camera at all - maybe because that key is already binded by me for other stuff?

-I was a medic, dropped my medickit(grey), after that i couldnt revive anymore at all, although i had yellow firstaidkits.

-I was revived and i had a clicking/working-loop sound after that stuck on me until the end of mission - other players could hear it too.

-Dragging/carrying untis near doors/staircases other similar structures makes dragged/carried and dropped units disappear into ground - the missions is over for those players (this happens with ACE medic system as well btw so it seems it general ArmA problem) - this bug is a nogo - and as long as it can not be fixed i suggest disabling carrying/draging at all.

-The "drop" entry in action menu disappears in houses, but when u look outside the house and have the crosshair above ground outside the drop entry appears and works (this doesnt happen wit ACE medic system so it seems its related to your script).

-Executing "carry" in action menu triggers the "grabbing" animation on the dragged unit but no animation on the unit executing it. The player that executed the action can still move around freely while the animation is played on the downed unit. When the animation on the downed unit is complete, its body will teleported on the back of the carrier. When the carrier crouches the body of the carried unit will float in the air above the carrier. This is another nogo for me - id rather have no carry option at all (this works flawles with ACE medic system).

-Executing the "carry" action with pistol in hand will make the carrier freeze. Changing to primary weapon in that state resolves the problem.

Some additional suggestions:

In our group immersion and atmosphere is the number one goal in missionbuilding (example: http://forums.bistudio.com/showthread.php?158813-Coop-Farmer-on-Proving-Grounds-by-LuzifR), thus we try to have as less hud/font as possible on the screen, as long as it also makes sense in conjunction with gameplay. So it would be nice to have some options to disable some hudstuff of ur script like:

-the font when being unconscious (preferably it should just be a black screen with a small area where u can still see something)

and/or

-make spactating an option when being unconscious

-end mission when all players are unconscious

-remove font that says who revived me - it just disgusting clutter on the screen :)

-let players scream when being unconscious and make them hearable also 100m away (norrins was way to short)(plz dont use norrins sounds - they r stupid^^ - i always replaced them with sounds from I44 mod - i didnt released those missions, so it was just for our personal use - i wasnt sure if it was allowed to use them, i found them in a community made I44 Domination mission - you might ask I44 team for your purpose)

-task force radio is a standard mod for us - it would be nice if unconscious and dead players would be muted for other players (works with ACE medic system)

I mentioned alot of ACE in there - and ACE seems to work best so far in that regard - but ACE (also in conjunction with RHS and DragonFyer) is still WIP and has its own pile problems and for now i would rather build missions without any addons, even if i lack some essential content than - but as i already wrote, your script is the only "true" revive out there with the option to have more than 1 life (ACE has that module too - but it doesnt seem to work).

Anyways, thanks again, and i am/we are looking forward to a version with the most important showstopers fixed/removed :)

Edited by RunForrest
forgot something

Share this post


Link to post
Share on other sites

Hi

Im the hq of Arma Israel community.

I very like ur "unit tags" script

I want him stand alone can u send it to my mail??? Please........ ;)

Royavitalh@gmail.com

Share this post


Link to post
Share on other sites

Hi Grimes,

 

Thank you for the great script. It is really useful and your efforts to make it noob prove made it quite easy for a beginner like me to get this up and running. 

 

I have a few questions that I hope you can help me on:

 

  1. Is there a way to make it so that when I (as the player) dies in game, I am still able to issue commands to get my AI team mates to run over and revive me (all other conditions of being dead/unconscious should remain in force)? This question is specific to game modes where I am playing entirely with AI aggressors and AI team mates. In the current format of the script, I as the human player is able to issue commands to get my AI team mates reviving each other. But when I go down the AI units do not do the same for me.
  2. Is there a way to increase the range of the script to mirror that of the medkit? Currently, the existing script makes it so that I have to be even closer then compared to using the medkit on the casualty.

 

Thank you brother.

 

 

 

 

Share this post


Link to post
Share on other sites

Hi Grimes,

 

Thank you for the great script. It is really useful and your efforts to make it noob prove made it quite easy for a beginner like me to get this up and running. 

 

I have a few questions that I hope you can help me on:

 

  1. Is there a way to make it so that when I (as the player) dies in game, I am still able to issue commands to get my AI team mates to run over and revive me (all other conditions of being dead/unconscious should remain in force)? This question is specific to game modes where I am playing entirely with AI aggressors and AI team mates. In the current format of the script, I as the human player is able to issue commands to get my AI team mates reviving each other. But when I go down the AI units do not do the same for me.
  2. Is there a way to increase the range of the script to mirror that of the medkit? Currently, the existing script makes it so that I have to be even closer then compared to using the medkit on the casualty.

 

Thank you brother.

No it doesnt. However you can try BTC Quick Revive. It appears to be the only respawn system which supports AI.  But also has some annoying bugs and I dont think it ever got any update. You can try, maybe I was using a mod which was conflicting. Who knows :)

 

As far as normal healing goes, there is a beautiful mod "Auto Medic" try it for AI to automatically heal squad mates when damaged. Here it is.

Share this post


Link to post
Share on other sites

Hey there!

 

I have a quick question:

 

On my mission when playing with friends only I can carry and drag people. When they try it on me, they get bugged.

 

If they try to drag someone the dragger gets on the ground as if he is dragged and he cannot move.

If they try to carry someone the animation plays but the wounded soldier hovers still in the air, and doesn't move. The carrier is then stuck in the carry position and cannot get out of it.

 

I'd fix it myself but I know nothing about scripting.

 

Thanks in advance,

 

Yurivw

Share this post


Link to post
Share on other sites

Anyone still using this script?

Are there any current issues I should know before downloading?

Downloaded so many revive scripts and can't find one that works as intended or has the options I need to use in my missions.

There are like 4 types of btc revive and a few versions of far. Help :)

Share this post


Link to post
Share on other sites

I've been using this since summer of 2015 and it had worked great.  Unfortunately, for the past couple weeks (since the Arma III update that changed the fatigue system) I get the same problems that Yurivw mentioned.

Share this post


Link to post
Share on other sites

Well I contacted Grimes but he's busy with real life at the moment.  So I took a look through the script to see if I could debug it.  As best I can tell, BIS_fnc_MP got borked during a recent update.  Specifically, the behavior of the isPersistant argument has changed.  I deleted arguments 2,3, and 4 (target, isPersistent, isCall) from each BIS_fnc_MP line in G_Carry_Action.sqf, G_Drag_Action.sqf, and G_Drop_Action.sqf.  It now works as well as it did before.  I didn't do a full quality check on it but it works well enough in local single-player and also works on a dedicated server in multiplayer.

 

For anyone else using this script, I hope this helps!

//Carry

// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;

_unit setVariable ["G_Carried",true,true];
_rescuer setVariable ["G_Carrying",true,true];

[[_unit, true], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
_rescuer forceWalk true;

[[_unit, (getDir _rescuer) + 180], "G_fnc_setDir"] spawn BIS_fnc_MP; 
_unitPos = getPos _unit;

[[_unit, "AidlPpneMstpSnonWnonDnon_AI"], "G_fnc_switchMove"] call BIS_fnc_MP;
[[_unit, "AinjPfalMstpSnonWnonDf_carried_dead"], "G_fnc_playMoveNow"] call BIS_fnc_MP;

sleep 2;

[[_rescuer, "AcinPknlMstpSrasWrflDnon_AcinPercMrunSrasWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP;

waitUntil {animationState _unit == "AinjPfalMstpSnonWnonDf_carried_dead"};

_unit attachTo [_rescuer, [-0.2, 0.25, 0]];

_dropActionID = _unit addAction [format["<t color='%1'>Drop</t>",G_Revive_Action_Color],"G_Revive\G_Drop_Action.sqf",[],1.5,true,true,""];
waitUntil {sleep 0.5; (!(_unit getVariable "G_Carried") || !(alive _unit) || (_rescuer getVariable "G_Unconscious"));};  
if ((!alive _unit) || (_rescuer getVariable "G_Unconscious")) then {
	[_unit, _rescuer, _dropActionID] execVM "G_Revive\G_Drop_Action.sqf";
};
//Drag

// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;

_unit setVariable ["G_Dragged",true,true];
_rescuer setVariable ["G_Dragging",true,true];

[[_unit, true], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
waitUntil {simulationEnabled _unit};
sleep 0.3;
[[_rescuer, "AcinPknlMstpSrasWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP; 
[[_unit, "AinjPpneMrunSnonWnonDb_still"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
[[_unit, "AinjPpneMrunSnonWnonDb_still"], "G_fnc_switchMove"] call BIS_fnc_MP;

_unit attachTo [_rescuer, [0.1,1.01,0.1]];
[[_unit, 180], "G_fnc_setDir", true, false] spawn BIS_fnc_MP; 

_dropActionID = _unit addAction [format["<t color='%1'>Drop</t>",G_Revive_Action_Color],"G_Revive\G_Drop_Action.sqf",[],1.5,true,true,""];
waitUntil {sleep 0.5; (!(_unit getVariable "G_Dragged") || !(alive _unit) || (_rescuer getVariable "G_Unconscious"));};  
if ((!alive _unit) || (_rescuer getVariable "G_Unconscious")) then {
	[_unit, _rescuer, _dropActionID] execVM "G_Revive\G_Drop_Action.sqf";
};
//Drop (from Carry or Drag)
// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;
_dropActionID = _this select 2;

_unit removeAction _dropActionID;

if (_unit getVariable "G_Dragged") then {
	if (_rescuer getVariable "G_Unconscious") then {
		[[_rescuer, "DeadState"], "G_fnc_switchMove"] spawn BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
	}
	else
	{
		[[_rescuer, "AcinPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon"], "G_fnc_switchMove"] call BIS_fnc_MP;
		[[_unit, "AinjPpneMrunSnonWnonDb_release"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPpneMrunSnonWnonDb_release"], "G_fnc_switchMove"] call BIS_fnc_MP;
	};
	detach _unit;
	sleep 3;
	[[_unit, false], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
	_unit setVariable ["G_Dragged",false,true];
	_rescuer setVariable ["G_Dragging",false,true];
}
else
{
	if (_rescuer getVariable "G_Unconscious") then {
		[[_rescuer, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
		sleep 4;
	}
	else
	{
		[[_rescuer, "AcinPercMrunSrasWrflDf_AmovPercMstpSlowWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPfalMstpSnonWnonDnon_carried_Down"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPfalMstpSnonWnonDnon_carried_Down"], "G_fnc_switchMove"] call BIS_fnc_MP;
		sleep 5;
	};
	_rescuer forceWalk false;
	detach _unit;
	[[_unit, false], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
	_unit setVariable ["G_Carried",false,true];
	_rescuer setVariable ["G_Carrying",false,true];
};

Share this post


Link to post
Share on other sites

Hi Grimes,

 

Thank you for the great script. It is really useful and your efforts to make it noob prove made it quite easy for a beginner like me to get this up and running. 

 

I have a few questions that I hope you can help me on:

 

  1. Is there a way to make it so that when I (as the player) dies in game, I am still able to issue commands to get my AI team mates to run over and revive me (all other conditions of being dead/unconscious should remain in force)? This question is specific to game modes where I am playing entirely with AI aggressors and AI team mates. In the current format of the script, I as the human player is able to issue commands to get my AI team mates reviving each other. But when I go down the AI units do not do the same for me.
  2. Is there a way to increase the range of the script to mirror that of the medkit? Currently, the existing script makes it so that I have to be even closer then compared to using the medkit on the casualty.

 

Thank you brother.

 

Hello everyone! I just downloaded this script, and i came across the same problem... But since i found a possible workaround for singleplayer missions, and since a lot of people are still using the script, i thought that it would be nice to share the solution.

Basically, it gives the player the opportunity to choose another playable unit on death, so that he can revive his previous character with the new one, and eventually retake control of the old one.

Of course the whole thing won't help much if in your mission there is only one playable character. Usually i tend to make each single member of the player's squad playable, so he can maximize the squad potential. This is usefull if you play the mission as the squad leader, but it turns to be quite buggy if you play as a subordinate that can't give orders to the rest of the squad, so beware.

 

 

Anyway, that's how it's done: 

 

Open with notepad the G_Unconscious.sqf file located in the G_Revive folder;

Scroll down to this part:

if (isPlayer _unit) then {
	disableUserInput true;
	titleText ["","BLACK", 1]; 
	if (G_Revive_Black_Screen == 0) then {
		[_byVeh] spawn {
			_byVeh = _this select 0;
			sleep 3;
			if (_byVeh) then {
				titleText ["You are Unconscious. Wait for teammate to revive you.","BLACK IN", 9]; 
			}
			else
			{
				titleText ["You are Unconscious. Wait for teammate to revive you.","BLACK IN", 4]; 
			}; 
		};
	};
};

delete everything under the first line and add the "teamSwitch" command, now it should look like this:

if (isPlayer _unit) then {
        teamSwitch;
};

Than scroll down to:

if (isPlayer _unit) then {
	[] spawn {
		sleep 3.25;
		_reviveDialog = createDialog "G_Revive_Dialog";
		waitUntil {!isNull (findDisplay -1)};
		G_Revive_Unc_Global_KeyDown_EH = (findDisplay -1) displayAddEventHandler ["KeyDown","if ((_this select 1) == 1) then {(findDisplay -1) displayRemoveEventHandler [""KeyDown"",G_Revive_Unc_Global_KeyDown_EH];closeDialog 0;player setVariable [""G_Unconscious"",false,true];}; false;"]; 
	};
};

and remove the "_reviveDialog" line, like this:

if (isPlayer _unit) then {
	[] spawn {
		sleep 3.25;
		waitUntil {!isNull (findDisplay -1)};
		G_Revive_Unc_Global_KeyDown_EH = (findDisplay -1) displayAddEventHandler ["KeyDown","if ((_this select 1) == 1) then {(findDisplay -1) displayRemoveEventHandler [""KeyDown"",G_Revive_Unc_Global_KeyDown_EH];closeDialog 0;player setVariable [""G_Unconscious"",false,true];}; false;"]; 
	};
};

Now when you die the team switch menu should appear...

 

Known issues:

-Once you're dead, if you click on "Back" in the team switch menu, or if you take control of another dead unit, you can still give orders to your squad members (if the selected character is the squad leader), you can also use first aid kits, even if it wont actually do nothing besides consuming the kit.

-Probably, the respawn system for the player won't work anymore. Not sure if it was supposed to work with singleplayer anyway. I think bots respawn should be fine (hopefully). All this needs more testing.

 

Finally, i'd like to thank Grimes for this noob friendly script that helped a lot of people. Cheers :)...

Share this post


Link to post
Share on other sites

Hey Grimes was wondering if there was a way you could disable the part that makes the Opfor go unconscious and be drag and carry-able. Was wanting it to work just for Bluefor because of the mission my team created with zombies, not really fitting when its a loot based survival mission and waiting for zombies or other Opfor to bleed out to loot them is time consuming. Thank you for such a nice script though we love all the aspects of it.

Share this post


Link to post
Share on other sites

guys... i know this is a bit late (noob/newb here), but i am having a problem with this script...

 

this is a part from the G_Revive_Action.sqf. i added hints so i'd know which parts are being called and which are not...

--------------------------------------------------------------------------------------------------------------------------------------------------

//Reviver
 
private ["_hasItem"];
 
_unit = _this select 0;
G_Revive_Global_Unit = _unit;
_rescuer = _this select 1;
G_Revive_Global_Rescuer = _rescuer;
_reviveActionID = _this select 2;
 
 
hint "Check 1";
_unit setVariable ["G_getRevived",true,true];
_rescuer setVariable ["G_Reviving",true,true];
 
 
_hasItem = 0;
hint "Check 2"; 
if (G_Revive_Requirement > 0) then {
hint "Check 3"; 
_rescitemsArray = items _rescuer;
if ("Medikit" in (_rescitemsArray)) then {
_hasItem = _hasItem + G_Revive_Requirement;
hint "Check 4"; 
};
if (_hasItem < G_Revive_Requirement) then {
{
if (_x isEqualTo "FirstAidKit") then {
if (_hasItem < G_Revive_Requirement) then {
_hasItem = _hasItem + 1;
};
};
} forEach _rescitemsArray;
if (_hasItem >= G_Revive_Requirement) then {
for "_i" from 1 to G_Revive_Requirement do {
_rescuer removeItem "FirstAidKit";
};
};
};
};
--------------------------------------------------------------------------------------------------------------------------------------------------
 
as far as i observed, check 1 is not displayed. when i try to revive, it only goes as far as check 2 and check 3 is not displayed, so, i believe there is a problem with that particular if statement because i don't think it's able to check for the value of G_Revive_Requirement...
 
Halp ples...

Share this post


Link to post
Share on other sites

I need a little help on this.

 

This script has mostly ever thing I need

 

1. Revive

2. bleed out timer with an option to turn off

3. drag wounded units

4. carry wounded units

5 load/unload wounded units

 

The one main issue it has the AI will not use the revive script. It was more focus on human players.

I attempted to rip out the drag carry and load functions with no luck/

I attempted to get the AI to use the revive but can't understanding how to make this happen.

 

there is a lack of good  revive scripts that allow for loading and unloading of wounded units and the ability of the AI to heal.

Can any one please look at this script to see if they can find a fix  for the AI or rip out the drag carry and load functions into a separate  script to be use with other revive scripts.

Share this post


Link to post
Share on other sites

I know this is really old now but is there anyway to get nearby friendly AI to revive you in this state? Main reason why I stumbled across this script.

Share this post


Link to post
Share on other sites

As Avid bird said, there is a lack of load/unload wounded scripts. If that one snippet of code could be intergrated into the vanilla revive. I would be stoked.

Share this post


Link to post
Share on other sites

 

Well I contacted Grimes but he's busy with real life at the moment.  So I took a look through the script to see if I could debug it.  As best I can tell, BIS_fnc_MP got borked during a recent update.  Specifically, the behavior of the isPersistant argument has changed.  I deleted arguments 2,3, and 4 (target, isPersistent, isCall) from each BIS_fnc_MP line in G_Carry_Action.sqf, G_Drag_Action.sqf, and G_Drop_Action.sqf.  It now works as well as it did before.  I didn't do a full quality check on it but it works well enough in local single-player and also works on a dedicated server in multiplayer.

 

For anyone else using this script, I hope this helps!

//Carry

// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;

_unit setVariable ["G_Carried",true,true];
_rescuer setVariable ["G_Carrying",true,true];

[[_unit, true], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
_rescuer forceWalk true;

[[_unit, (getDir _rescuer) + 180], "G_fnc_setDir"] spawn BIS_fnc_MP; 
_unitPos = getPos _unit;

[[_unit, "AidlPpneMstpSnonWnonDnon_AI"], "G_fnc_switchMove"] call BIS_fnc_MP;
[[_unit, "AinjPfalMstpSnonWnonDf_carried_dead"], "G_fnc_playMoveNow"] call BIS_fnc_MP;

sleep 2;

[[_rescuer, "AcinPknlMstpSrasWrflDnon_AcinPercMrunSrasWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP;

waitUntil {animationState _unit == "AinjPfalMstpSnonWnonDf_carried_dead"};

_unit attachTo [_rescuer, [-0.2, 0.25, 0]];

_dropActionID = _unit addAction [format["<t color='%1'>Drop</t>",G_Revive_Action_Color],"G_Revive\G_Drop_Action.sqf",[],1.5,true,true,""];
waitUntil {sleep 0.5; (!(_unit getVariable "G_Carried") || !(alive _unit) || (_rescuer getVariable "G_Unconscious"));};  
if ((!alive _unit) || (_rescuer getVariable "G_Unconscious")) then {
	[_unit, _rescuer, _dropActionID] execVM "G_Revive\G_Drop_Action.sqf";
};
//Drag

// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;

_unit setVariable ["G_Dragged",true,true];
_rescuer setVariable ["G_Dragging",true,true];

[[_unit, true], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
waitUntil {simulationEnabled _unit};
sleep 0.3;
[[_rescuer, "AcinPknlMstpSrasWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP; 
[[_unit, "AinjPpneMrunSnonWnonDb_still"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
[[_unit, "AinjPpneMrunSnonWnonDb_still"], "G_fnc_switchMove"] call BIS_fnc_MP;

_unit attachTo [_rescuer, [0.1,1.01,0.1]];
[[_unit, 180], "G_fnc_setDir", true, false] spawn BIS_fnc_MP; 

_dropActionID = _unit addAction [format["<t color='%1'>Drop</t>",G_Revive_Action_Color],"G_Revive\G_Drop_Action.sqf",[],1.5,true,true,""];
waitUntil {sleep 0.5; (!(_unit getVariable "G_Dragged") || !(alive _unit) || (_rescuer getVariable "G_Unconscious"));};  
if ((!alive _unit) || (_rescuer getVariable "G_Unconscious")) then {
	[_unit, _rescuer, _dropActionID] execVM "G_Revive\G_Drop_Action.sqf";
};
//Drop (from Carry or Drag)
// AGAR 011216: Retain arguments 0,1 remove arguments 2,3,4 -- this works fine in SP editor and MP on dedi server

_unit = _this select 0;
_rescuer = _this select 1;
_dropActionID = _this select 2;

_unit removeAction _dropActionID;

if (_unit getVariable "G_Dragged") then {
	if (_rescuer getVariable "G_Unconscious") then {
		[[_rescuer, "DeadState"], "G_fnc_switchMove"] spawn BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
	}
	else
	{
		[[_rescuer, "AcinPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon"], "G_fnc_switchMove"] call BIS_fnc_MP;
		[[_unit, "AinjPpneMrunSnonWnonDb_release"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPpneMrunSnonWnonDb_release"], "G_fnc_switchMove"] call BIS_fnc_MP;
	};
	detach _unit;
	sleep 3;
	[[_unit, false], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
	_unit setVariable ["G_Dragged",false,true];
	_rescuer setVariable ["G_Dragging",false,true];
}
else
{
	if (_rescuer getVariable "G_Unconscious") then {
		[[_rescuer, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "DeadState"], "G_fnc_switchMove"] call BIS_fnc_MP;
		sleep 4;
	}
	else
	{
		[[_rescuer, "AcinPercMrunSrasWrflDf_AmovPercMstpSlowWrflDnon"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPfalMstpSnonWnonDnon_carried_Down"], "G_fnc_playMoveNow"] call BIS_fnc_MP;
		[[_unit, "AinjPfalMstpSnonWnonDnon_carried_Down"], "G_fnc_switchMove"] call BIS_fnc_MP;
		sleep 5;
	};
	_rescuer forceWalk false;
	detach _unit;
	[[_unit, false], "G_fnc_enableSimulation"] spawn BIS_fnc_MP;
	_unit setVariable ["G_Carried",false,true];
	_rescuer setVariable ["G_Carrying",false,true];
};

 

 

Hello everyone! I just downloaded this script, and i came across the same problem... But since i found a possible workaround for singleplayer missions, and since a lot of people are still using the script, i thought that it would be nice to share the solution.

Basically, it gives the player the opportunity to choose another playable unit on death, so that he can revive his previous character with the new one, and eventually retake control of the old one.

Of course the whole thing won't help much if in your mission there is only one playable character. Usually i tend to make each single member of the player's squad playable, so he can maximize the squad potential. This is usefull if you play the mission as the squad leader, but it turns to be quite buggy if you play as a subordinate that can't give orders to the rest of the squad, so beware.

 

 

Anyway, that's how it's done: 

 

Open with notepad the G_Unconscious.sqf file located in the G_Revive folder;

Scroll down to this part:

if (isPlayer _unit) then {
	disableUserInput true;
	titleText ["","BLACK", 1]; 
	if (G_Revive_Black_Screen == 0) then {
		[_byVeh] spawn {
			_byVeh = _this select 0;
			sleep 3;
			if (_byVeh) then {
				titleText ["You are Unconscious. Wait for teammate to revive you.","BLACK IN", 9]; 
			}
			else
			{
				titleText ["You are Unconscious. Wait for teammate to revive you.","BLACK IN", 4]; 
			}; 
		};
	};
};

delete everything under the first line and add the "teamSwitch" command, now it should look like this:

if (isPlayer _unit) then {
        teamSwitch;
};

Than scroll down to:

if (isPlayer _unit) then {
	[] spawn {
		sleep 3.25;
		_reviveDialog = createDialog "G_Revive_Dialog";
		waitUntil {!isNull (findDisplay -1)};
		G_Revive_Unc_Global_KeyDown_EH = (findDisplay -1) displayAddEventHandler ["KeyDown","if ((_this select 1) == 1) then {(findDisplay -1) displayRemoveEventHandler [""KeyDown"",G_Revive_Unc_Global_KeyDown_EH];closeDialog 0;player setVariable [""G_Unconscious"",false,true];}; false;"]; 
	};
};

and remove the "_reviveDialog" line, like this:

if (isPlayer _unit) then {
	[] spawn {
		sleep 3.25;
		waitUntil {!isNull (findDisplay -1)};
		G_Revive_Unc_Global_KeyDown_EH = (findDisplay -1) displayAddEventHandler ["KeyDown","if ((_this select 1) == 1) then {(findDisplay -1) displayRemoveEventHandler [""KeyDown"",G_Revive_Unc_Global_KeyDown_EH];closeDialog 0;player setVariable [""G_Unconscious"",false,true];}; false;"]; 
	};
};

Now when you die the team switch menu should appear...

 

Known issues:

-Once you're dead, if you click on "Back" in the team switch menu, or if you take control of another dead unit, you can still give orders to your squad members (if the selected character is the squad leader), you can also use first aid kits, even if it wont actually do nothing besides consuming the kit.

-Probably, the respawn system for the player won't work anymore. Not sure if it was supposed to work with singleplayer anyway. I think bots respawn should be fine (hopefully). All this needs more testing.

 

Finally, i'd like to thank Grimes for this noob friendly script that helped a lot of people. Cheers :)...

HUGE thank you to you two. I've been trying to get over the hurdle of not being able to teamswitch when you die for a long time. This worked like a charm. This is an amazing script and I'm glad I get to finally use it 

Share this post


Link to post
Share on other sites

Has anyone got this script to work using the AI. Yes I know you as a player can revive an AI unit but can an AI revive another AI unit or the player. The auto medic script does not work. Help

Share this post


Link to post
Share on other sites

The OP has been updated to appear a bit cleaner and also show that Grimes Simple Revive V0.7 (latest) is now hosted on github, along with the 2 previous versions. I have put in all of the changelog data that I have (with much thanks to Armaholic and @foxhound), as I have not been successful in retrieving any data from the old project site hosted by DevHeaven/withSix. Fortunately most of that data was documented locally or by Armaholic. The only real loss I can think of is the future roadmap, but surely that can be dreamed up again. 

 

Between this topic, PMs, and e-mails, I have received numerous bug reports and feature requests that I absolutely plan on addressing. More importantly, many folks have posted fixes that I will absolutely incorporate into an official release, putting credit where credit is due. 

 

I would expect some organizational changes in the structure of this script, but otherwise it will just be various bug fixes, catching up with the game's updates, and a new feature here or there. I will start posting about particular bugs and test requests at some point. I also plan on utilizing github for issue tracking from now forward. 

  • Thanks 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

×