Jump to content
  • 0

Automatic lobby return after death


ilganna

Question

Hi Guys,

 

I was wondering if there is any way we could automate the lobby return after death...

 

The dynamic should be: I die and I see the you are death screen; a countdown (ten seconds) starts and when it ends you're automatically transferred back to lobby instead of doing it manually. (Hit esc, wait 10 seconds, then click abort and Ok)

 

Do you think something like that will be feasible? I know probably which files to edit, but I'm not sure how to handle the "forced" disconnect.

 

Any tips?

 

Thanks, best regards

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Hi ilganna,

 

I've invested some time as I also want this. First of all I am very new to Arma2/Dayz/Epoch scripting/modding...just played around a bit.

I also use th elinux version of Epoch by Devd...but I don't think that this makes a difference here, don't know.

 

I've found this link: https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/compile/player_death.sqf

It seems that this was already in there some time ago (?) and if I remember correctly I saw that already on a server I was playing in January.

 

At the end of the file you find:

for "_x" from 5 to 1 step -1 do {
titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
sleep 1;
};

PVDZE_Server_Simulation = [_body, false];
publicVariableServer "PVDZE_Server_Simulation";

endMission "END1";

I downloaded the dayz_code.pbo from the client files on my server and extracted it.

I copied the file player_death.sqf to my mission (custom/player_death.sqf), added to above code at the end of it and in my custom compiles (also in folder custom) I pointed to the new file.

 

I repacked the mission pbo and uploaded it to the server.

 

Now everytime I die I am right back into the lobby without pressing ESC and Abort.

 

jahan.

Link to comment
Share on other sites

  • 0

I guess you are right. I'll test it later. But this then would do the trick. Cool ,) I guess that's in a custom compiles.sqf.

 

EDIT: yes, thanks, works. Did not know that all files (also client files) can be overwritten in the mission). I've edited my post above.

 

I am still not sure why this has been removed as I don't think thats just to annoy the player ??? Any idea?

Link to comment
Share on other sites

  • 0

Update:

 

I modified the code to actually display the message (and increased the time to 10 seconds):

 

 

for "_x" from 10 to 1 step -1 do {
titleText [format["Returning to lobby in %1 second(s)...", _x], "PLAIN DOWN", 1];
sleep 1;
};

PVDZE_Server_Simulation = [_body, false];
publicVariableServer "PVDZE_Server_Simulation";

endMission "END1";

 

Thanks!

Link to comment
Share on other sites

  • 0

Hey,

 

 

If I use this script, every player who died is getting kicked from Server "PublicVariable Restriction #3" since im using InfiStar.

 

Does anyone know how to fix it?

 

 

Greetings

Add this !="PVDZE_Server_Simulation" to your publicvariable.txt in your BE folder into the first line ;)

Link to comment
Share on other sites

  • 0

Add this !="PVDZE_Server_Simulation" to your publicvariable.txt in your BE folder into the first line ;)

5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !="PVDZE_Server_Simulation"

is not working for me...

 

But thanks for reply

Link to comment
Share on other sites

  • 0

Hey,

 

 

If I use this script, every player who died is getting kicked from Server "PublicVariable Restriction #3" since im using InfiStar.

 

Does anyone know how to fix it?

 

 

Greetings

 

what does your public variable restriction log tell you the kick is for?

Link to comment
Share on other sites

  • 0

Update:

 

I modified the code to actually display the message (and increased the time to 10 seconds):

 

 

Thanks!

 

I tried this on my server and it doesnt work....
The text appears but i don't get booted to the lobby.

No RPT errors.
 am running Infistar and have modified my BE files to suit my needs.. does that affect it?

Link to comment
Share on other sites

  • 0

save this as player_death.sqf

 

put this in your mission pbo and call it in compiles.sqf

private ["_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
disableSerialization;
if (deathHandled) exitWith {};

deathHandled = true;

//Prevent client freezes
_display = findDisplay 49;
if(!isNull _display) then {_display closeDisplay 0;};
if (dialog) then {closeDialog 0;};
if (visibleMap) then {openMap false;};

_body = player;
_playerID = getPlayerUID player;

disableUserInput true;
//add weapon on back to player...
//if (dayz_onBack != "") then {
//	_body addWeapon dayz_onBack;
//};

_infected = 0;
if (r_player_infected && DZE_PlayerZed) then {
	_infected = 1;
};

PVDZE_plr_Died = [dayz_characterID,0,_body,_playerID,_infected, dayz_playerName];
publicVariableServer "PVDZE_plr_Died";

_id = [player,20,true,getPosATL player] call player_alertZombies;

uisleep 0.5;

player setDamage 1;
0.1 fadeSound 0;

player setVariable ["NORRN_unconscious", false, true];
player setVariable ["unconsciousTime", 0, true];
player setVariable ["USEC_isCardiac",false,true];
player setVariable ["medForceUpdate",true,true];

player setVariable ["startcombattimer", 0];
r_player_unconscious = false;
r_player_cardiac = false;

_array = _this;
if (count _array > 0) then {
	_source = _array select 0;
	_method = _array select 1;
	if ((!isNull _source) && (_source != player)) then {

		_canHitFree = player getVariable ["freeTarget",false];
		_isBandit = (player getVariable["humanity",0]) <= -2000;

		_punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop
		_humanityHit = 0;
		if (!_punishment) then {
			//i'm "not guilty" - kill me && be punished
			_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;

			_humanityHit = -(2000 - _myKills);
			_kills = _source getVariable ["humanKills",0];
			_source setVariable ["humanKills",(_kills + 1),true];

			PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
			publicVariableServer "PVDZE_send";

		} else {
			//i'm "guilty" - kill me as bandit
			_killsV = _source getVariable ["banditKills",0];
			_source setVariable ["banditKills",(_killsV + 1),true];
		};
	};
	_body setVariable ["deathType",_method,true];
};

terminate dayz_musicH;
terminate dayz_slowCheck;
terminate dayz_animalCheck;
terminate dayz_monitor1;
terminate dayz_medicalH;
terminate dayz_gui;

r_player_dead = true;

"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;

"colorCorrections" ppEffectEnable true;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01],  [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 1;

//Player is Dead!
3 fadeSound 0;

uisleep 1;

dayz_originalPlayer enableSimulation true;

addSwitchableUnit dayz_originalPlayer;
setPlayable dayz_originalPlayer;
selectPlayer dayz_originalPlayer;

//_myGroup = group _body;
//[_body] joinSilent dayz_firstGroup;
//deleteGroup _myGroup;

3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];

_body setVariable["combattimeout", 0, true];

//["dayzFlies",player] call broadcastRpcCallAll;
uisleep 2;

1 cutRsc ["DeathScreen","BLACK OUT",3];

playMusic "dayz_track_death_1";

"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;

uisleep 2;

for  "_x" from 5 to 1 step -1 do {
titleText [format["Returning to lobby in %1 second(s)...", _x], "PLAIN DOWN", 1];
	uisleep 1;
};

PVDZE_Server_Simulation = [_body, false];
publicVariableServer "PVDZE_Server_Simulation";

endMission "END1";
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...