Jump to content
David ArmAstrong

Can you deleteMarker respawn marker to stop respawn then create respawn marker to start it again in a mission?

Recommended Posts

I have a series of tasks in a multiplayer mission. The next task is created when the last task is completed. I can move the respawn marker named respawn_west to the next location as the tasks are completed. What I would like to do is disable respawn for any players who die until the current task is completed. For example respawn_west marker is located at starting point of the mission. once task_01 is completed the respawn_west marker is moved to the location of task_01. I would like to keep any players who die while trying to get to the location of task_02 dead until the remaining players complete task_02, and so on through the objectives. I have no problem moving the respawn_west marker using this code with triggers

"respawn_west" setMarkerPos getMarkerPos "task_01"

I have tried deleteMarker "respawn_west" , thinking I could _respawn_west = createMarker when the next trigger activates to enable the dead to respawn when the next task completes and while the respawn_west marker disappears, players still respawn on it's last location. I am guessing that the mission remembers where it was and thus I can't keep players dead until the next task completed trigger fires by deleteing the respawn marker. 
Is there a method I can use to delay players from respawning until the next task completed trigger is activated.
Thanks in advance for your help. 

Share this post


Link to post
Share on other sites

Thanks for you assistance. It is much appreciated. I still can't get it to stop respawning. It's like the game-mission records the position of the respawn_west marker and even though you delete the marker or use removeRespawnPosition the dead player still respawns. I am thinking that if you have selected to enable respawn in your mission, on a custom location or otherwise, there is no way to turn respawn on and off with triggers while the mission is running. 

This is not a showstopper for the mission I am working on. It would have been nice to have dead players stay dead until the current task was completed but again not a a showstopper. 
Thanks again for your help...dn 

Share this post


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

stay dead until the current task was completed but again not a a showstopper. 

 

Hello there David ArmAstrong !

 

I wiil give you a suggestion ,

how about using the spectator cam until the task is done ?!

check here :

https://community.bistudio.com/wiki/Arma_3_End_Game_Spectator_Mode

ex:

Spoiler

		if (GF_Revive_Spectator_Enabled) then{
			
			//	more configurations here :
			//	https://community.bistudio.com/wiki/Arma_3_End_Game_Spectator_Mode
			
			["Initialize", [_this]] call BIS_fnc_EGSpectator; 	// Initializes spectator for given player
			while {alive _this && _this getVariable ["Var_GF_Revive_Unconscious",true]} do {
				uisleep 1;
			};
			["Terminate"] call BIS_fnc_EGSpectator; 			// Terminates spectator for given player
		};

in the meantime i don't know on right now to answer about the respawn , but you can set different markers and use a code onPlayerRespawn.sqf or with an Eventhandler respawn.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much for your assistance. I am using the spectator cam for the KIA players while they are waiting to respawn. I turn it on in onPlayerKilled.sqf and terminate it  in onPlayerRespawn.sqf. 
I'm going to try this code tomorrow. Thanks again for your help. 

  • Thanks 1

Share this post


Link to post
Share on other sites

@David ArmAstrong Here's how I theoretically would set up the objectives.


1. When a new objective comes online execute on server:

99999 remoteExec ["setPlayerRespawnTime"];

2. When objective is completed execute on server:

"respawn_XXXX" setMarkerPos _newPos;
1 remoteExec ["setPlayerRespawnTime"];

3. Make sure that at least a few seconds before the next objective goes live. 

 

Go back to 1.

 

The result should be:

Anyone who dies while an objective is live have an "infinite" respawn counter. 

 

Anyone who dies between objectives or is waiting to respawn will respawn instantly. 

 

 

 

Edit: I realised in step 2 you may possibly run into an out-of-order execution (respawn is enabled before the marker is moved). Now this is highly unlikely to cause issues but if you're pedantic (like me) you'd wrap up step 2 in a function like so:

//In init.sqf, CfgFunctions or w/e
fnc_updateAndEnableRespawn = {
	params ["_newPos", "_respawnTime"];
	"respawn_XXXX" setMarkerPosLocal _newPos; //Note use of local marker command
	setPlayerRespawnTime _respawnTime;
};

//On server when objective live
[someNewPos, 1] remoteExec ["fnc_updateAndEnableRespawn"];

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, mrcurry said:

["setPlayerRespawnTime"];

 

@mrcurry , this is a nice approach ! :thumb:

  • 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

×