Update public variables

It makes no sense to rename the identical DayZ PVs to have an E in their
name. I don't see any good reason it was done in the first place. All it
accomplishes is breaking script compatibility between the two mods and
requiring different publicvariable.txt filters. The only time it makes
sense is for custom Epoch variables that aren't used in vanilla.

All admins have to do to update custom scripts is swap the names
according to the change log.

Note I've submitted a pull request to replace PVDZ_veh_Save with
PVDZ_obj_Save in official too because they are duplicates.
This commit is contained in:
ebaydayz
2016-03-18 21:39:22 -04:00
parent 6a6db58291
commit 4bd9a9aa0b
95 changed files with 420 additions and 491 deletions

View File

@@ -31,8 +31,8 @@ if (local _animalbody) then {
{
// only send to other players
if(isPlayer _x && _x != player) then {
PVDZE_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZE_send";
PVDZ_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZ_send";
};
} count _inRange;

View File

@@ -20,8 +20,8 @@ if (local _zombiebody) then {
_inRange = _pos nearEntities ["CAManBase",100];
{
if(isPlayer _x && _x != player) then {
PVDZE_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZE_send";
PVDZ_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZ_send";
};
} count _inRange;

View File

@@ -1,26 +0,0 @@
private ["_unit","_selection","_strH","_damage"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if (_selection != "" && local _unit) then {
_strH = "hit_" + (_selection);
_unit setHit[_selection,_damage];
//player sidechat str _damage;
_unit setVariable [_strH,_damage,true];
if (_damage == 0) then {
if (isServer) then {
[_unit,"repair"] call server_updateObject;
} else {
PVDZE_veh_Update = [_unit,"repair"];
publicVariableServer "PVDZE_veh_Update";
};
} else {
if (isServer) then {
[_unit,"damage"] call server_updateObject;
} else {
PVDZE_veh_Update = [_unit,"damage"];
publicVariableServer "PVDZE_veh_Update";
};
};
};

View File

@@ -1,23 +0,0 @@
private["_unit","_selection","_damage","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if ((_selection != "") && local _unit) then {
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_total = (_dam + _damage);
if (_total > 1) then {
_total = 1;
};
_unit setVariable [_strH,_total,true];
if (_damage >= 1) then {
//["PVDZE_veh_Update",[_unit,"damage"]] call callRpcProcedure;
PVDZE_veh_Update = [_unit,"damage"];
publicVariableServer "PVDZE_veh_Update";
};
} else {
_damage = 0;
};
_damage

View File

@@ -35,11 +35,13 @@ if ((count _list) < dayz_maxAnimals) then {
if (((player distance _Pos) < dayz_animalDistance) && {!(surfaceIsWater _Pos)} && {(count _list) <= 1}) then {
if (_type == "DZ_Pastor") then { _agent = createAgent [_type, _Pos, [], 0, "NONE"]; } else { _agent = createAgent [_type, _Pos, [], 0, "FORM"]; };
uiSleep 0.001;
//Disable simulation
PVDZ_Server_Simulation = [_agent, false];
publicVariableServer "PVDZ_Server_Simulation";
_agent setPos _Pos;
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
PVDZE_zed_Spawn = [_agent];
publicVariableServer "PVDZE_zed_Spawn";
};
uiSleep 1;
};

View File

@@ -32,8 +32,10 @@ _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";
//Send Death Notice
//["PVDZ_plr_Death",[dayz_characterID,0,_body,_playerID,dayz_playerName]] call callRpcProcedure;
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,_infected,dayz_playerName];
publicVariableServer "PVDZ_plr_Death";
_id = [player,20,true,getPosATL player] call player_alertZombies;
@@ -68,8 +70,8 @@ if (count _array > 0) then {
_humanityHit = -(2000 - _myKills);
_kills = _source getVariable ["humanKills",0];
_source setVariable ["humanKills",(_kills + 1),true];
PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
publicVariableServer "PVDZE_send";
PVDZ_send = [_source,"Humanity",[_source,_humanityHit,300]];
publicVariableServer "PVDZ_send";
} else {
//i'm "guilty" - kill me as bandit
_killsV = _source getVariable ["banditKills",0];
@@ -154,7 +156,7 @@ for "_x" from 5 to 1 step -1 do {
uiSleep 1;
};
PVDZE_Server_Simulation = [_body, false];
publicVariableServer "PVDZE_Server_Simulation";
PVDZ_Server_Simulation = [_body, false];
publicVariableServer "PVDZ_Server_Simulation";
endMission "END1";

View File

@@ -86,8 +86,8 @@ player setVariable["CharacterID",_charID,true];
player setVariable["worldspace",_worldspace,true];
player setVariable["friendlies",_friendlies,true];
player setVariable["tagList",_tagList,true];
PVDZE_serverStoreVar = [player,"Achievements",_achievements];
publicVariableServer "PVDZE_serverStoreVar";
PVDZ_serverStoreVar = [player,"Achievements",_achievements];
publicVariableServer "PVDZ_serverStoreVar";
call dayz_resetSelfActions;

View File

@@ -57,11 +57,11 @@ if(_pickup) then {
//["PVDZ_obj_Delete",[_objectID,_objectUID]] call callRpcProcedure;
_activatingPlayer = player;
PVDZE_obj_Delete = [_objectID,_objectUID, _activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
publicVariableServer "PVDZ_obj_Destroy";
if (isServer) then {
PVDZE_obj_Delete call server_deleteObj;
PVDZ_obj_Destroy call server_deleteObj;
};
deleteVehicle _obj;

View File

@@ -66,8 +66,8 @@ if(!isNull _obj && alive _obj) then {
_backpacks = getBackpackCargo _obj;
// Remove from database
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZ_obj_Destroy";
// Set down vault "take" item
_bag = createVehicle [_packedClass,_pos,[], 0, "CAN_COLLIDE"];

View File

@@ -6,7 +6,7 @@
/***********************************************************
ASSIGN DAMAGE TO A UNIT.
Called by "HandleDamage" vehicle Event Handler
or by "PVCDZE_veh_SH" PV
or by "PVCDZ_veh_SH" PV
or by zombie_attack
- Function fnc_veh_handleDam
@@ -37,8 +37,8 @@ if (local _unit) then {
_unit setHit [_selection, _total];
if (!isServer) then {
PVDZE_veh_Update = [_unit,"damage"];
publicVariableServer "PVDZE_veh_Update";
PVDZ_obj_Save = [_unit,"damage"];
publicVariableServer "PVDZ_obj_Save";
} else {
[_unit, "damage"] call server_updateObject;
};
@@ -47,8 +47,8 @@ if (local _unit) then {
//if ( (count _this > 5) AND {(_this select 5)}) then {
// vehicle is not local to this client, ask the client which vehicle is local to set damage
//_this resize 5; // delete "broadcast" boolean
PVDZE_send = [_unit,"VehHandleDam",_this];
publicVariableServer "PVDZE_send";
PVDZ_send = [_unit,"VehHandleDam",_this];
publicVariableServer "PVDZ_send";
//};
};

View File

@@ -14,11 +14,11 @@ if (isServer) then {
[_unit, "killed"] call server_updateObject;
} else {
if (DZE_Debug_Damage && ((!isPlayer _unit) || ((isPlayer _unit) && (vehicle _unit != _unit) && (_unit != _killer)))) then {
PVDZE_veh_Update = [_unit, "killed",_killer];
PVDZ_obj_Save = [_unit, "killed",_killer];
} else {
PVDZE_veh_Update = [_unit, "killed"];
PVDZ_obj_Save = [_unit, "killed"];
};
publicVariableServer "PVDZE_veh_Update";
publicVariableServer "PVDZ_obj_Save";
};
// everyone removes their EH for this vehicle

View File

@@ -13,17 +13,19 @@ or by action/repair.sqf
- return : 0 :)
broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
************************************************************/
private ["_hitpointnames","_log"];
private ["_hitpointnames","_log","_damage","_action"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
_action = if (_damage == 0) then {"repair"} else {"damage"};
_hitpointnames = [];
{
_hitpointnames set [count _hitpointnames, getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints" >> _x >> "name")];
} forEach (_unit call vehicle_getHitpoints);
if ((isNil "_selection") OR {(!(_selection IN _hitpointnames))}) exitWith {_this select 2};
if ((isNil "_selection") OR {(!(_selection in _hitpointnames))}) exitWith {_this select 2};
_SVname = "hit_" + _selection;
@@ -33,21 +35,20 @@ _selection, _unit getVariable [_SVname, 0] ];
if (local _unit) then {
// only local unit can set the damage of a vehicle part
_unit setVariable [_SVname, 0, true];
_unit setHit [_selection, 0];
_unit setVariable [_SVname, _damage, true];
_unit setHit [_selection, _damage];
_log = format["%1. setH!t[%2,0]", _log, _selection];
if (!isServer) then {
PVDZ_veh_Save = [_unit, "repair"];
publicVariableServer "PVDZ_veh_Save";
PVDZ_obj_Save = [_unit, _action];
publicVariableServer "PVDZ_obj_Save";
_log = _log + ". Requesting server hive write";
}
else {
[_unit, "repair"] call server_updateObject;
} else {
[_unit, _action] call server_updateObject;
_log = _log + ". Writing to hive";
};
}
else {
if ( (count _this > 3) AND {(_this select 3)}) then {
} else {
if ((count _this > 3) && {(_this select 3)}) then {
// vehicle is not local to this client, ask the client which vehicle is local to set damage
_this resize 3; // delete "broadcast" boolean
_log = _log + ". Broadcasting to all";