add configurable values

allows for hosts to setup their own default values instead of new player
defaults
This commit is contained in:
DESKTOP-UH65DCE\MusTanG 2017-10-07 07:14:59 -05:00
parent c9039929ab
commit 25f2dd6691
3 changed files with 18 additions and 6 deletions

View File

@ -332,12 +332,12 @@ if !(EPOCH_ActiveTraderMission isequalto []) then {
// AH use only
if !(isNil "EPOCH_GMODE") then {
{
_varDefault = _defaultVarValues select _foreachindex;
_varDefault = _gModeVarValues select _foreachindex;
_varName = format["EPOCH_player%1",_x];
_varNameTmp = call compile format["_player%1Key",_x];
if !(isNil "_varNameTmp") then {_varName = _varNameTmp};
missionNamespace setVariable [_varName, _varDefault];
} forEach _gmVars;
} forEach _gModeVarNames;
};
// Update read only vars

View File

@ -18,7 +18,10 @@ EPOCH_forceUpdateNow = false;
_clientAliveTimer = diag_tickTime;
// init player stat vars
_gmVars = ["CfgEpochClient", "gmVars", ["Temp","Hunger","Thirst","Toxicity","Stamina","BloodP","Alcohol","Radiation"]] call EPOCH_fnc_returnConfigEntryV2;
_gmVarsInit = ["CfgEpochClient", "gmVars", [["Temp",98.6],["Hunger",500],["Thirst",500],["Toxicity",0],["Stamina",10],["BloodP",100],["Alcohol",0],["Radiation",0]]] call EPOCH_fnc_returnConfigEntryV2;
_gModeVarNames = _gmVarsInit apply {_x param [0,""]};
_gModeVarValues = _gmVarsInit apply {_x param [1,0]};
_customVarsInit = ["CfgEpochClient", "customVarsDefaults", EPOCH_customVarsDefaults] call EPOCH_fnc_returnConfigEntryV2;
_customVarNames = _customVarsInit apply {_x param [0,""]};
_defaultVarValues = _customVarsInit apply {_x param [1,0]};

View File

@ -108,9 +108,18 @@ class CfgEpochClient
{"Nuisance",0,{100,0}},
{"MissionArray",{},{}}
};
// Vars that get reset to defaults if godmode is enabled
gmVars[] = {"Temp","Hunger","Thirst","Toxicity","Stamina","BloodP","Alcohol","Radiation"};
// Vars and the value that gets set if godmode is enabled
gmVars[] = {
{"Temp",98.6},
{"Hunger",2500},
{"Thirst",1500},
{"Energy",2500},
{"Toxicity",0},
{"Stamina",100},
{"BloodP",100},
{"Alcohol",0},
{"Radiation",0}
};
hudConfigs[] = {
{{"BloodP","","",{"getPlayerDamage",">=",0.7}},"topRight","x\addons\a3_epoch_code\Data\UI\bleeding_ca.paa",{"forceUpdate"}},
{{"Oxygen","getPlayerOxygenRemaining","",{},{1,0,2,2,1,0.55}},"topRight","x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"},