Change dayz_survived to actual play time

Vanilla commits:

18eaecb19f

b76b1200ca

78ea61e334

8309427f0d

Should be ready for Hive update @icomrade . If you upload it to a test
folder I'll test it.
This commit is contained in:
ebayShopper
2017-04-13 18:35:28 -04:00
parent 267f34572e
commit 9fc72a8b87
7 changed files with 30 additions and 228 deletions

View File

@@ -1,6 +1,7 @@
[NEW] Added a few loot positions for Namalsk and Takistan. @skigoggles [NEW] Added a few loot positions for Namalsk and Takistan. @skigoggles
[NEW] Added DZE_limitPlots so admins can limit plot poles to 1 per UID, disabled by default. @oiad [NEW] Added DZE_limitPlots so admins can limit plot poles to 1 per UID, disabled by default. @oiad
[NEW] Pumpkin, sunflower, and hemp plants spawned with createVehicle can be harvested with a knife now. #1928 @F507DMT [NEW] Pumpkin, sunflower, and hemp plants spawned with createVehicle can be harvested with a knife now. #1928 @F507DMT
[NEW] The journal and dayz_survived variable now contain actual play time [array] instead of days since the character was created [number].
[UPDATED] Zombie pathing. Zeds should now run more direct to players. [UPDATED] Zombie pathing. Zeds should now run more direct to players.
[UPDATED] The RIS attachment can be removed from the SA58_RIS_DZ now. @LunaCB [UPDATED] The RIS attachment can be removed from the SA58_RIS_DZ now. @LunaCB
@@ -41,4 +42,5 @@
[FIXED] Glitch where group icons scaled very large momentarily while moving off screen. [FIXED] Glitch where group icons scaled very large momentarily while moving off screen.
[NEW] Added temporary check for mission file overwrite exploit. This can be removed after Bohemia patches it. [NEW] Added temporary check for mission file overwrite exploit. This can be removed after Bohemia patches it.
[INFO] HiveExt.dll has been updated to return character_data duration in the 101 call for the dayz_survived stat. Source is available at github.com/vbawol/DayZhiveEpoch/pull/13 @icomrade
[INFO] See Documents\CHANGE LOG 1.0.6.txt for the full list of 1.0.5.1 --> 1.0.6 changes. [INFO] See Documents\CHANGE LOG 1.0.6.txt for the full list of 1.0.5.1 --> 1.0.6 changes.

View File

@@ -1,4 +1,4 @@
private ["_ys","_ms","_ds","_b","_2","_6","_7","_8","_9","_10","_str_left_text","_1","_3","_4","_5","_blood_in_pack","_blood_in_inv","_mag_arr","_backpack","_11","_mags_for_weap","_mssv_cnt","_weapon","_config","_survivors","_moon","_spawnselection","_disabledTemperature"]; private ["_currentTime","_totalMins","_days","_hours","_mins","_ys","_ms","_ds","_b","_2","_6","_7","_8","_9","_10","_str_left_text","_1","_3","_4","_5","_blood_in_pack","_blood_in_inv","_mag_arr","_backpack","_11","_mags_for_weap","_mssv_cnt","_weapon","_config","_survivors","_moon","_spawnselection","_disabledTemperature"];
_survivors = playersNumber west; _survivors = playersNumber west;
_str_left_text = " _str_left_text = "
@@ -20,223 +20,15 @@ _1 = name player;
dayz_currentGlobalZombies = count entities "zZombie_Base"; dayz_currentGlobalZombies = count entities "zZombie_Base";
/* //Work out survival time
if (player hasWeapon "ItemWatch") then _currentTime = floor (dayz_sessionTime / 60);
{ _totalMins = (player getVariable "SurvivalTime") + _currentTime;
if (dayz_Survived == Dayz_logonDate) then // only interested if the same - assume server will only run over one day before restart _days = floor (_totalMins / 1440);
{ _totalMins = (_totalMins - (_days * 1440));
switch (true) do _hours = floor (_totalMins / 60);
{ _mins = (_totalMins - (_hours * 60));
case (Dayz_logonTime > 20): {_2 = (localize "str_playerstats_journal_1_a")};
case (Dayz_logonTime > 17): {_2 = (localize "str_playerstats_journal_1_b")}; dayz_Survived = [_days,_hours,_mins,_totalMins];
case (Dayz_logonTime > 12): {_2 = (localize "str_playerstats_journal_1_c")};
default {_2 = (localize "str_playerstats_journal_1_d")};
};
} else
{
switch (true) do
{
case (Dayz_logonTime > 20): {_2 = (localize "str_playerstats_journal_1_e")};
case (Dayz_logonTime > 17): {_2 = (localize "str_playerstats_journal_1_f")};
case (Dayz_logonTime > 12): {_2 = (localize "str_playerstats_journal_1_g")};
default {_2 = (localize "str_playerstats_journal_1_h")};
};
};
} else
{
_2 = (localize "str_playerstats_journal_1_i");
};
_3 = Dayz_logonTown;
_4 = worldName;
_ys = str (date select 0);
_ms = "";
_ds = str (date select 2);
switch (true) do
{
case (date select 1 == 1):{_ms = (localize "str_playerstats_journal_month_1")};
case (date select 1 == 2):{_ms = (localize "str_playerstats_journal_month_2")};
case (date select 1 == 3):{_ms = (localize "str_playerstats_journal_month_3")};
case (date select 1 == 4):{_ms = (localize "str_playerstats_journal_month_4")};
case (date select 1 == 5):{_ms = (localize "str_playerstats_journal_month_5")};
case (date select 1 == 6):{_ms = (localize "str_playerstats_journal_month_6")};
case (date select 1 == 7):{_ms = (localize "str_playerstats_journal_month_7")};
case (date select 1 == 8):{_ms = (localize "str_playerstats_journal_month_8")};
case (date select 1 == 9):{_ms = (localize "str_playerstats_journal_month_9")};
case (date select 1 == 10):{_ms =(localize "str_playerstats_journal_month_10")};
case (date select 1 == 11):{_ms =(localize "str_playerstats_journal_month_11")};
case (date select 1 == 12):{_ms =(localize "str_playerstats_journal_month_12")};
};
_5 = format[localize "str_playerstats_journal_2_date", _ds, _ms, _ys];
// can't test dayz_Survived at home
switch (true) do
{
case (dayz_Survived == 0): {_6 = (localize "str_playerstats_journal_2_info_1")};
case (dayz_Survived == 1): {_6 = (localize "str_playerstats_journal_2_info_2")};
case (dayz_Survived > 1): {_6 = format [localize "str_playerstats_journal_2_info_3", dayz_Survived]};
default {};
};
switch (true) do
{
case (!r_fracture_legs and !r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_1")};
case (r_fracture_legs and r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_2")};
case (r_fracture_legs): {_7 = (localize "str_playerstats_journal_3_3")};
case (r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_4")};
default {};
};
switch (true) do
{
case (r_player_infected):
{
if (!r_fracture_legs and !r_fracture_arms) then
{
_8 = (localize "str_playerstats_journal_4_1");
} else
{
_8 = (localize "str_playerstats_journal_4_2");
};
};
default {_8 = ""};
};
if (r_fracture_legs or r_fracture_arms) then
{
switch (true) do
{
case (r_player_blood < 3000): {_9 = (localize "str_playerstats_journal_5_1")};
case (r_player_blood < 6000): {_9 = (localize "str_playerstats_journal_5_2")};
case (r_player_blood < 9000): {_9 = (localize "str_playerstats_journal_5_3")};
case (r_player_blood < 11000): {_9 = (localize "str_playerstats_journal_5_4")};
case (r_player_blood == 12000): {_9 = (localize "str_playerstats_journal_5_5")};
default {_9 = "."};
};
}else
{
switch (true) do
{
case (r_player_blood < 3000): {_9 = (localize "str_playerstats_journal_5_6")};
case (r_player_blood < 6000): {_9 = (localize "str_playerstats_journal_5_7")};
case (r_player_blood < 9000): {_9 = (localize "str_playerstats_journal_5_8")};
case (r_player_blood < 11000): {_9 = (localize "str_playerstats_journal_5_9")};
case (r_player_blood == 12000):
{
if (r_player_infected) then
{
_9 = (localize "str_playerstats_journal_5_10");
} else
{
_9 = (localize "str_playerstats_journal_5_11");
};
};
default {_9 = "."};
};
};
_blood_in_pack = false;
_backpack = unitBackpack player;
if (!isNull _backpack) then
{
_mag_arr = getMagazineCargo _backpack;
if ("ItemBloodbag" in (_mag_arr select 0)) then
{
_blood_in_pack = true;
};
};
_blood_in_inv = false;
if ("ItemBloodbag" in (magazines player)) then
{
_blood_in_inv = true;
};
_10 = "";
if (r_player_blood < 9000 and (_blood_in_inv or _blood_in_pack)) then
{
if (_blood_in_inv) then
{
_10 = (localize "str_playerstats_journal_6_1");
} else
{
_10 = (localize "str_playerstats_journal_6_2");
};
};
if (r_player_blood < 9000 and ! _blood_in_inv and ! _blood_in_pack) then
{
_10 = (localize "str_playerstats_journal_6_3");
};
_11 = "";
_weapon = currentWeapon player;
_config = configFile >> "CfgWeapons";
// possibly filter out torch and the dayz_throwweapon thingy too. Need to get feedback..
if (_weapon != "" and _weapon != "Throw" and _weapon != "Put" and _weapon != "Flare") then
{
switch (true) do
{
case (getText (_config >> _weapon >> "melee") == "true"): // used getText as config entry had "" marks around it.
{
_11 = format [localize "str_playerstats_journal_7_1", getText (_config >> _weapon >> "displayName")];
};
case (_weapon == "ItemFlashlight" or _weapon == "ItemFlashlightRed"):
{
if (sunOrMoon == 1) then
{
_11 = format [localize "str_playerstats_journal_7_2", getText (_config >> _weapon >> "displayName")];
} else
{
_11 = format [localize "str_playerstats_journal_7_3", getText (_config >> _weapon >> "displayName")];
};
};
case (_weapon == "Makarov"):
{
_11 = format [localize "str_playerstats_journal_7_4", getText (_config >> _weapon >> "displayName")];
};
default
{
_mags_for_weap = getArray (_config >> _weapon >> "magazines");
_mssv_cnt = false;
{
if (_x in _mags_for_weap) then
{
_mssv_cnt = true;
};
} forEach (magazines player);
if (_mssv_cnt) then
{
if (player ammo _weapon > 0) then
{
_11 = format [localize "str_playerstats_journal_7_5", getText (configFile >> "CfgWeapons" >> _weapon >> "displayName")];
} else
{
_11 = format [localize "str_playerstats_journal_7_6", getText (configFile >> "CfgWeapons" >> _weapon >> "displayName")];
};
} else
{
_11 = format [localize "str_playerstats_journal_7_7", getText (_config >> _weapon >> "displayName")];
};
};
};
} else
{
_11 = (localize "str_playerstats_journal_7_8");
};
*/
_moon = if (dayz_ForcefullmoonNights) then { "Yes" } else { "No" }; _moon = if (dayz_ForcefullmoonNights) then { "Yes" } else { "No" };
@@ -266,7 +58,7 @@ _disabledTemperature = switch (dayz_temperature_override) do {
<t size='2' font='Zeppelin33' color = '#000000' align='left'>SpawnSelection: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%4</t><br/> <t size='2' font='Zeppelin33' color = '#000000' align='left'>SpawnSelection: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%4</t><br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Full Moon: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%12</t><br/> <t size='2' font='Zeppelin33' color = '#000000' align='left'>Full Moon: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%12</t><br/>
<br/> <br/>
<t size='2' font='Zeppelin33' color = '#000000' align='center'>Survived: %8 Day(s)</t><br/> <t size='2' font='Zeppelin33' color = '#000000' align='center'>Survived: %8 Day(s), %15 Hour(s), %16 Minute(s)</t><br/>
<br /> <br />
<t size='2' font='Zeppelin33' color = '#000000' align='center'>Survivors:%9</t><br/> <t size='2' font='Zeppelin33' color = '#000000' align='center'>Survivors:%9</t><br/>
<br/> <br/>
@@ -279,13 +71,15 @@ _disabledTemperature = switch (dayz_temperature_override) do {
(round(dayz_temperatur)), (round(dayz_temperatur)),
(round(player getVariable['humanity', 0])), (round(player getVariable['humanity', 0])),
(dayz_currentGlobalZombies), (dayz_currentGlobalZombies),
(dayz_Survived), (dayz_Survived select 0),
(_survivors), (_survivors),
(round diag_fps), (round diag_fps),
(round diag_fpsmin), (round diag_fpsmin),
(_moon), (_moon),
(_disabledTemperature), (_disabledTemperature),
(dayz_presets) (dayz_presets),
(dayz_Survived select 1),
(dayz_Survived select 2)
]; ];
// right page - blank until humanity is checked // right page - blank until humanity is checked

View File

@@ -1,4 +1,4 @@
private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee","_coins","_bankCoins","_globalCoins"]; private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee","_survivalTime","_coins","_bankCoins","_globalCoins"];
//_playerUID = _this select 0; //_playerUID = _this select 0;
_charID = _this select 1; _charID = _this select 1;
_model = _this select 2; _model = _this select 2;
@@ -25,6 +25,7 @@ _banditKills = player getVariable ["banditKills",0];
//_achievements = player getVariable ["Achievements",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; //_achievements = player getVariable ["Achievements",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
_combattimeout = player getVariable["combattimeout",0]; _combattimeout = player getVariable["combattimeout",0];
_inCombat = player getVariable ["inCombat",false]; _inCombat = player getVariable ["inCombat",false];
_survivalTime = player getVariable ["SurvivalTime",0];
_ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0]; _ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0];
_ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0]; _ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0];
_friendlies = player getVariable ["friendlies",[]]; _friendlies = player getVariable ["friendlies",[]];
@@ -90,7 +91,7 @@ player setVariable ["worldspace",_worldspace];
//player setVariable ["Achievements",_achievements]; //player setVariable ["Achievements",_achievements];
player setVariable ["combattimeout",_combattimeout,false]; player setVariable ["combattimeout",_combattimeout,false];
player setVariable ["inCombat",_inCombat,true]; player setVariable ["inCombat",_inCombat,true];
player setVariable ["SurvivalTime",_survivalTime,false];
player setVariable ["ConfirmedHumanKills",_ConfirmedHumanKills,true]; player setVariable ["ConfirmedHumanKills",_ConfirmedHumanKills,true];
player setVariable ["ConfirmedBanditKills",_ConfirmedBanditKills,true]; player setVariable ["ConfirmedBanditKills",_ConfirmedBanditKills,true];
player setVariable ["friendlies",_friendlies,true]; player setVariable ["friendlies",_friendlies,true];

View File

@@ -665,6 +665,7 @@ if (!isDedicated) then {
Dayz_freefall = [ time, 0, 0.1 ]; Dayz_freefall = [ time, 0, 0.1 ];
dayz_getoutTime = 0; dayz_getoutTime = 0;
dayz_hitByTime = 0; dayz_hitByTime = 0;
dayz_sessionTime = 0; //Approximate time elapsed since login in seconds
skipGearSound = false; skipGearSound = false;
TimeOutDisplayed = false; TimeOutDisplayed = false;
voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"]; voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];

View File

@@ -846,12 +846,14 @@ class FSM
"};" \n "};" \n
"" \n "" \n
"//Work out survival time" \n "//Work out survival time" \n
"_totalMins = _survival select 0;" \n "_totalMins = _survival select 3;" \n
"_days = floor (_totalMins / 1440);" \n "_days = floor (_totalMins / 1440);" \n
"_totalMins = (_totalMins - (_days * 1440));" \n "_totalMins = (_totalMins - (_days * 1440));" \n
"_hours = floor (_totalMins / 60);" \n "_hours = floor (_totalMins / 60);" \n
"_mins = (_totalMins - (_hours * 60));" \n "_mins = (_totalMins - (_hours * 60));" \n
"" \n "" \n
"player setVariable [""SurvivalTime"",(_survival select 3),false];" \n
"" \n
"//player variables" \n "//player variables" \n
"dayz_characterID = _charID;" \n "dayz_characterID = _charID;" \n
"dayz_hasFire = objNull; //records players Fireplace object" \n "dayz_hasFire = objNull; //records players Fireplace object" \n
@@ -860,7 +862,7 @@ class FSM
"dayz_lastMeal = (_lastAte * 60);" \n "dayz_lastMeal = (_lastAte * 60);" \n
"dayz_lastDrink = (_lastDrank * 60);" \n "dayz_lastDrink = (_lastDrank * 60);" \n
"dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n "dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n
"dayz_Survived = _days; //total alive dayz" \n "dayz_Survived = [_days,_hours,_mins,(_survival select 3)]; //total alive dayz" \n
"" \n "" \n
"//load in medical details" \n "//load in medical details" \n
"r_player_dead = player getVariable[""USEC_isDead"",false];" \n "r_player_dead = player getVariable[""USEC_isDead"",false];" \n
@@ -1166,7 +1168,7 @@ class FSM
"dayz_musicH = [] spawn player_music;" \n "dayz_musicH = [] spawn player_music;" \n
"dayz_slowCheck = [] spawn player_spawn_2;" \n "dayz_slowCheck = [] spawn player_spawn_2;" \n
"Dayz_logonTime = daytime;" \n "Dayz_logonTime = daytime;" \n
"Dayz_logonDate = dayz_Survived;" \n "Dayz_logonDate = floor ((_survival select 0) / 1440);" \n
"_position = getPosATL player;" \n "_position = getPosATL player;" \n
"_radius = 200;" \n "_radius = 200;" \n
"//Current amounts" \n "//Current amounts" \n
@@ -1957,7 +1959,7 @@ class FSM
"Dayz_logonTown = ""Wilderness"";" \n "Dayz_logonTown = ""Wilderness"";" \n
"if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n
"" \n "" \n
"[_world,Dayz_logonTown,format[localize ""str_player_06"",dayz_Survived]] spawn {uiSleep 5; _this spawn BIS_fnc_infoText;};" \n "[_world,Dayz_logonTown,format[localize ""str_player_06"",(floor ((_survival select 0) / 1440))]] spawn {uiSleep 5; _this spawn BIS_fnc_infoText;};" \n
"" \n "" \n
"dayz_myPosition = getPosATL player;" \n "dayz_myPosition = getPosATL player;" \n
"Dayz_loginCompleted = true;" \n "Dayz_loginCompleted = true;" \n

View File

@@ -58,6 +58,8 @@ sched_medical = { // 1 second
} else { } else {
[] spawn fnc_usec_playerHandleBlood; [] spawn fnc_usec_playerHandleBlood;
}; };
dayz_sessionTime = dayz_sessionTime + 1;
[_unconHdlr] [_unconHdlr]
}; };

View File

@@ -14,7 +14,7 @@ if (isNil "sm_done") exitWith { diag_log ("Login cancelled, server is not ready.
_inventory = []; _inventory = [];
_backpack = []; _backpack = [];
_survival = [0,0,0]; _survival = [0,0,0,0];
_model = ""; _model = "";
_isInfected = 0; _isInfected = 0;
_CharacterCoins = 0; _CharacterCoins = 0;