Cleanup variables.sqf

Epoch variables are grouped together now for easy comparison with
vanilla.
This commit is contained in:
ebaydayz
2016-03-19 19:58:37 -04:00
parent 4bd9a9aa0b
commit 9ce5a20417
14 changed files with 316 additions and 883 deletions

View File

@@ -11,6 +11,8 @@
- object_setFixServer --> fnc_veh_handleRepair - object_setFixServer --> fnc_veh_handleRepair
- vehicle_handleDamage --> fnc_veh_handleDam - vehicle_handleDamage --> fnc_veh_handleDam
- vehicle_handleKilled --> fnc_veh_handleKilled - vehicle_handleKilled --> fnc_veh_handleKilled
- Duplicate global variables have been renamed:
- dayz_updateObjects --> DayZ_GearedObjects
- Duplicate public variables have been renamed: - Duplicate public variables have been renamed:
- dayzPlayerLogin --> PVCDZ_plr_Login/PVCDZ_plr_PlayerAccepted - dayzPlayerLogin --> PVCDZ_plr_Login/PVCDZ_plr_PlayerAccepted
- dayzPlayerLogin2 --> PVCDZ_plr_Login2 - dayzPlayerLogin2 --> PVCDZ_plr_Login2

View File

@@ -41,7 +41,7 @@ class Loot: Default
"ItemSodaPepsi", "ItemSodaPepsi",
"ItemSodaMdew", "ItemSodaMdew",
"FoodEdible", "FoodEdible",
"FoodSteakCooked", "FoodBeefCooked",
"FoodCanBakedBeans", "FoodCanBakedBeans",
"FoodCanSardines", "FoodCanSardines",
"FoodCanFrankBeans", "FoodCanFrankBeans",

View File

@@ -264,7 +264,7 @@ if (isNil "keyboard_keys") then {
} else { } else {
_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8]; _nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
if (count _nearbyObjects > 0) then { if (count _nearbyObjects > 0) then {
if((diag_tickTime - dayz_lastCheckBit > 4)) then { if ((diag_tickTime - dayz_lastCheckBit > 4)) then {
[objNull, player, rSwitchMove,"GetOver"] call RE; [objNull, player, rSwitchMove,"GetOver"] call RE;
player playActionNow "GetOver"; player playActionNow "GetOver";
dayz_lastCheckBit = diag_tickTime; dayz_lastCheckBit = diag_tickTime;

View File

@@ -16,17 +16,13 @@ _anim4 = toArray _anim;
_anim4 resize 4; _anim4 resize 4;
_anim4 = toString _anim4; _anim4 = toString _anim4;
dayz_isKneeling = false;
dayz_isCrawling = false;
if (["pknl",_anim] call fnc_inString) then { if (["pknl",_anim] call fnc_inString) then {
_scaleMvmt = 0.2; //0.1; _scaleMvmt = 0.2; //0.1;
_scalePose = 0.6; //0.4 _scalePose = 0.6; //0.4
dayz_isKneeling = true;
} else { } else {
if (["ppne",_anim] call fnc_inString) then { if (["ppne",_anim] call fnc_inString) then {
_scaleMvmt = 0.3; _scaleMvmt = 0.3;
_scalePose = 0.14; _scalePose = 0.14;
dayz_isCrawling = true;
}; };
}; };

View File

@@ -101,10 +101,7 @@ if ("ItemMap_Debug" in items player) then {
_markerstr3 setMarkerBrushLocal "Border"; _markerstr3 setMarkerBrushLocal "Border";
_markerstr3 setMarkerSizeLocal [120, 120]; _markerstr3 setMarkerSizeLocal [120, 120];
diag_log ("SpawnWait: " +str(time - dayz_spawnWait));
diag_log ("LocalZombies: " +str(dayz_spawnZombies) + "/" +str(dayz_maxLocalZombies)); diag_log ("LocalZombies: " +str(dayz_spawnZombies) + "/" +str(dayz_maxLocalZombies));
diag_log ("GlobalZombies: " +str(dayz_CurrentZombies) + "/" +str(dayz_maxGlobalZombies));
diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds));
}; };
//Spawn Zeds & loot in buildings //Spawn Zeds & loot in buildings

View File

@@ -57,7 +57,6 @@ _muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");
if (count _muzzles > 1) then { if (count _muzzles > 1) then {
_currentWpn = currentMuzzle player; _currentWpn = currentMuzzle player;
}; };
player setPosATL dayz_spawnPos;
//Debug Message //Debug Message
// diag_log "Attempting to switch model"; // diag_log "Attempting to switch model";
@@ -227,5 +226,5 @@ if (!isNil "_newBackpackType") then {
call dayz_meleeMagazineCheck; call dayz_meleeMagazineCheck;
//reveal all near objects. //reveal all near objects.
{player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]); {player reveal _x} count (nearestObjects [getPosATL player,["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems","DZE_Base_Object"],75]);
//All is arbitrary and will need to be changed to ["AllVehicles","WeaponHolder","Land_A_tent"] ++ others (stashes etc.) //All is arbitrary and will need to be changed to ["AllVehicles","WeaponHolder","Land_A_tent"] ++ others (stashes etc.)

View File

@@ -1159,12 +1159,6 @@ class CfgWeight
class FoodSteakCooked
{
weight = 0.25;
};
class FoodbeefCooked class FoodbeefCooked
{ {
weight = 0.25; weight = 0.25;

View File

@@ -1,147 +0,0 @@
private ["_config","_classname","_itemChances","_itemCount","_weight","_type","_canZombie","_canLoot","_weighted","_j","_itemChancesSmall","_itemCountSmall"];
dayz_CBLChances = [];
dayz_CBLBase = [];
dayzE_CBLSChances = [];
dayzE_CBLSBase = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
};
for "_i" from 0 to ((count _config) - 1) do {
_classname = toLower(configName (_config select _i));
_itemChances = getArray (_config >> _classname >> "lootType");
_itemCount = count _itemChances;
//diag_log format["Classname: %1, Array: %2, Amount: %3", _classname, _itemChances, _itemCount];
if (_itemCount > 0) then {
if ((dayz_CBLBase find _classname) < 0) then {
_weighted = [];
_j = 0;
for "_l" from 0 to (_itemCount - 1) do {
_weight = round (((_itemChances select _l) select 2) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayz_CBLChances set [count dayz_CBLChances, _weighted];
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
} else {
dayz_CBLChances set [count dayz_CBLChances, [0]];
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
_itemChancesSmall = [] + getArray (_config >> _classname >> "lootTypeSmall");
_itemCountSmall = count _itemChancesSmall;
//diag_log format["loot_init.sqf %1", _itemChancesSmall];
if (_itemCountSmall > 0) then {
if (dayzE_CBLSBase find _classname < 0) then {
_weighted = [];
_j = 0;
for "_l" from 0 to(_itemCountSmall - 1) do {
_weight = round(((_itemChancesSmall select _l) select 2) * 100);
for "_k" from 0 to(_weight - 1) do
{
_weighted set[_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CBLSChances set [count dayzE_CBLSChances, _weighted];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
} else {
dayzE_CBLSChances set [count dayzE_CBLSChances, [0]];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
};
dayz_CLChances = [];
dayz_CLBase = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "cfgLoot";
} else {
_config = configFile >> "cfgLoot";
};
for "_i" from 0 to ((count (_config)) - 1) do {
_classname = configName (_config select _i);
_itemChances = getArray (_config select _i);
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do
{
_weight = round (((_itemChances select _l) select 1) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k, _l];
//_items set [count _items, ((_itemChances select _l) select 0)];
};
_j = _j + _weight;
};
dayz_CLBase set [count dayz_CLBase, _classname];
dayz_CLChances set [count dayz_CLChances, _weighted];
};
dayzE_CLSChances = [];
dayzE_CLSBase = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "cfgLootSmall";
} else {
_config = configFile >> "cfgLootSmall";
};
for "_i" from 0 to ((count (_config)) - 1) do {
_classname = configName (_config select _i);
_itemChances = getArray (_config select _i);
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round (((_itemChances select _l) select 1) * 100);
for "_k" from 0 to _weight - 1 do {
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CLSBase set [count dayzE_CLSBase, _classname];
dayzE_CLSChances set [count dayzE_CLSChances, _weighted];
};
dayz_ZombieBuildings = [];
dayz_LootBuildings = [];
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
};
for "_i" from 0 to (count (_config) - 1) do {
_type = _config select _i;
_canZombie = getNumber (_type >> "zombieChance") > 0;
_canLoot = getNumber (_type >> "lootChance") > 0;
if(_canZombie) then {
if(!((configName _type) in dayz_ZombieBuildings)) then {
dayz_ZombieBuildings set [count dayz_ZombieBuildings, configName _type];
};
};
if(_canLoot) then {
if(!((configName _type) in dayz_LootBuildings)) then {
dayz_LootBuildings set [count dayz_LootBuildings, configName _type];
};
};
};

File diff suppressed because it is too large Load Diff

View File

@@ -1053,6 +1053,9 @@ class FSM
" _currentWpn = _state select 0;" \n " _currentWpn = _state select 0;" \n
" _currentAnim = _state select 1;" \n " _currentAnim = _state select 1;" \n
" //Reload players state" \n " //Reload players state" \n
" if ((count _state > 3) && DZE_FriendlySaving) then {" \n
" DZE_Friends = _state select 3;" \n
" }; " \n
" if (count _state > 2) then {" \n " if (count _state > 2) then {" \n
" dayz_temperatur = _state select 2;" \n " dayz_temperatur = _state select 2;" \n
" };rentWpn = ""Makarov"";" \n " };rentWpn = ""Makarov"";" \n
@@ -1225,12 +1228,6 @@ class FSM
" _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n
" };" \n " };" \n
"} count entities ""SpawnableWreck"";" \n "} count entities ""SpawnableWreck"";" \n
"dayz_Totalzedscheck = [] spawn {" \n
" while {true} do {" \n
" dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n
" uiSleep 60;" \n
" };" \n
"};" \n
"" \n "" \n
"dayz_backpackcheck = [] spawn {" \n "dayz_backpackcheck = [] spawn {" \n
" while {true} do {" \n " while {true} do {" \n

View File

@@ -127,9 +127,6 @@ if (count _medical > 0) then {
//Add Wounds //Add Wounds
{ {
_playerObj setVariable["hit_"+_x,true, true]; _playerObj setVariable["hit_"+_x,true, true];
//["usecBleed",[_playerObj,_x,_hit]] call broadcastRpcCallAll;
//usecBleed = [_playerObj,_x,_hit];
//publicVariable "usecBleed";
} count (_medical select 8); } count (_medical select 8);
//Add fractures //Add fractures

View File

@@ -1,13 +1,3 @@
/*
server_updateNearbyObjects = {
private["_pos"];
_pos = _this select 0;
{
[_x, "gear"] call server_updateObject;
} count nearestObjects [_pos, dayz_updateObjects, 10];
}; */
/* /*
zombie_findOwner = { zombie_findOwner = {
private["_unit"]; private["_unit"];

View File

@@ -274,7 +274,7 @@ if (isServer && isNil "sm_done") then {
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then { if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then {
_object setvehiclelock "locked"; _object setVehicleLock "locked";
}; };
_totalvehicles = _totalvehicles + 1; _totalvehicles = _totalvehicles + 1;

View File

@@ -76,11 +76,7 @@ MaxMineVeins = 50; // Default: 50
MaxAmmoBoxes = 3; // Default: 3 MaxAmmoBoxes = 3; // Default: 3
//Zombie Variables //Zombie Variables
dayz_maxZeds = 500; // Default: 500
dayz_maxLocalZombies = 30; // Default: 15 dayz_maxLocalZombies = 30; // Default: 15
dayz_maxGlobalZombiesInit = 15; // Default: 15
dayz_maxGlobalZombiesIncrease = 5; // Default: 5
dayz_zedsAttackVehicles = true; // Default: true
//Animal Variables //Animal Variables
dayz_maxAnimals = 8; // Default: 8 dayz_maxAnimals = 8; // Default: 8