2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Aaron Clark - EpochMod.com
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Initalize variables used client side and server side
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-13 16:54:19 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/init/both_init.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
2017-09-06 19:00:03 +00:00
|
|
|
private ["_cfgDynamicSimulation","_communityStatsInit","_customVarsInit","_dynSimToggle"];
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[end]]]
|
2016-05-23 20:01:40 +00:00
|
|
|
|
|
|
|
// detect if Ryan's Zombies and Deamons mod is present
|
2017-04-02 04:17:46 +00:00
|
|
|
if (["CfgEpochClient", "ryanZombiesEnabled", true] call EPOCH_fnc_returnConfigEntryV2) then {
|
2016-11-09 23:23:16 +00:00
|
|
|
EPOCH_mod_Ryanzombies_Enabled = (parseNumber (getText (configFile >> "CfgPatches" >> "Ryanzombies" >> "version")) >= 4.5);
|
2016-07-07 19:50:35 +00:00
|
|
|
if (EPOCH_mod_Ryanzombies_Enabled) then {
|
|
|
|
diag_log "Epoch: Ryanzombies detected";
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
EPOCH_mod_Ryanzombies_Enabled = false;
|
2016-05-23 20:01:40 +00:00
|
|
|
};
|
|
|
|
|
2017-04-02 04:17:46 +00:00
|
|
|
// detect if Mad Arma is present
|
|
|
|
if (["CfgEpochClient", "madArmaEnabled", true] call EPOCH_fnc_returnConfigEntryV2) then {
|
|
|
|
EPOCH_mod_madArma_Enabled = (parseNumber (getText (configFile >> "CfgPatches" >> "bv_wheels" >> "version")) >= 2016);
|
|
|
|
if (EPOCH_mod_madArma_Enabled) then {
|
|
|
|
diag_log "Epoch: Mad Arma detected";
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
EPOCH_mod_madArma_Enabled = false;
|
2017-08-18 14:45:27 +00:00
|
|
|
};
|
2017-04-02 04:17:46 +00:00
|
|
|
|
2017-07-31 16:28:18 +00:00
|
|
|
// Check if Advanced Vehicle Repair is enabled
|
|
|
|
if (["CfgEpochClient", "UseAdvancedVehicleRepair", true] call EPOCH_fnc_returnConfigEntryV2) then {
|
|
|
|
EPOCH_AdvancedVehicleRepair_Enabled = true;
|
|
|
|
diag_log "Epoch: Advanced Vehicle Repair Enabled";
|
|
|
|
} else {
|
|
|
|
EPOCH_AdvancedVehicleRepair_Enabled = false;
|
|
|
|
};
|
2017-04-02 04:17:46 +00:00
|
|
|
|
2015-09-14 20:55:36 +00:00
|
|
|
// Init Custom vars
|
|
|
|
EPOCH_customVars = [];
|
|
|
|
EPOCH_defaultVars = [];
|
2016-04-08 20:21:46 +00:00
|
|
|
EPOCH_customVarLimits = [];
|
2015-11-08 15:26:38 +00:00
|
|
|
EPOCH_customVarsDefaults = [
|
2016-04-08 20:21:46 +00:00
|
|
|
["Temp",98.6,[106.7,95]],
|
|
|
|
["Hunger",5000,[5000,0]],
|
|
|
|
["Thirst",2500,[2500,0]],
|
|
|
|
["AliveTime",0,[0,0]],
|
|
|
|
["Energy",0,[2500,0]],
|
|
|
|
["Wet",0,[100,0]],
|
|
|
|
["Soiled",0,[100,0]],
|
|
|
|
["Immunity",0,[100,0]],
|
|
|
|
["Toxicity",0,[100,0]],
|
|
|
|
["Stamina",100,["EPOCH_playerStaminaMax",0]],
|
|
|
|
["Crypto",0,[250000,0]],
|
2017-08-18 13:25:07 +00:00
|
|
|
["HitPoints",[0,0,0,0],[1,1,1,1]],
|
2016-04-08 20:21:46 +00:00
|
|
|
["BloodP",100,[190,0]],
|
|
|
|
["SpawnArray",[],[]],
|
|
|
|
["Alcohol",0,[100,0]],
|
2016-05-23 20:01:40 +00:00
|
|
|
["Radiation",0,[100,0]],
|
2016-06-16 21:53:59 +00:00
|
|
|
["Nuisance",0,[100,0]],
|
|
|
|
["MissionArray",[],[]]
|
2015-09-14 20:55:36 +00:00
|
|
|
];
|
2015-11-08 15:26:38 +00:00
|
|
|
_customVarsInit = ["CfgEpochClient", "customVarsDefaults", EPOCH_customVarsDefaults] call EPOCH_fnc_returnConfigEntryV2;
|
2017-09-06 14:39:34 +00:00
|
|
|
EPOCH_customVars = _customVarsInit apply {_x param [0,""]};
|
|
|
|
EPOCH_defaultVars = _customVarsInit apply {_x param [1,0]};
|
|
|
|
EPOCH_customVarLimits = _customVarsInit apply {_x param [2,[]]};
|
2015-09-14 20:55:36 +00:00
|
|
|
EPOCH_customVarCount = count EPOCH_customVars;
|
|
|
|
|
2017-08-03 03:16:21 +00:00
|
|
|
// Init Community Stats
|
|
|
|
EPOCH_communityStats = [];
|
|
|
|
EPOCH_defaultStatVars = [];
|
2017-09-24 17:26:11 +00:00
|
|
|
EPOCH_communityStatsLimits = [];
|
2017-08-03 03:16:21 +00:00
|
|
|
_communityStatsInit = ["CfgEpochClient", "defineCommunityStats", []] call EPOCH_fnc_returnConfigEntryV2;
|
2017-09-24 17:26:11 +00:00
|
|
|
EPOCH_communityStats = _communityStatsInit apply {_x param [0,""]};
|
|
|
|
EPOCH_defaultStatVars = _communityStatsInit apply {_x param [1,0]};
|
|
|
|
EPOCH_communityStatsLimits = _communityStatsInit apply {_x param [2,[]]};
|
2017-08-03 03:16:21 +00:00
|
|
|
EPOCH_communityStatsCount = count EPOCH_communityStats;
|
|
|
|
|
2015-09-14 20:55:36 +00:00
|
|
|
//GroupSize (number) // Price (String)
|
|
|
|
EPOCH_group_upgrade_lvl = ["CfgEpochClient", "group_upgrade_lvl", [4,"100",6,"300",8,"500",10,"1000",12,"1500",13,"1750",14,"2000",15,"3000",16,"5000"]] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
|
2016-04-08 20:21:46 +00:00
|
|
|
// disable remote sensors on server and client as all Epoch AI is local to the side controlling it.
|
|
|
|
disableRemoteSensors (["CfgEpochClient", "disableRemoteSensors", true] call EPOCH_fnc_returnConfigEntryV2);
|
2017-09-06 19:00:03 +00:00
|
|
|
|
2017-07-08 23:53:24 +00:00
|
|
|
// Enable Dynamic simulation on both server and clients (maybe only needed server side)
|
2017-07-16 20:26:19 +00:00
|
|
|
// DynSim is handled locally and yes server and clients will need these configurations
|
2017-07-24 17:34:58 +00:00
|
|
|
_dynSimToggle = ["CfgDynamicSimulation", "enableDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2;
|
|
|
|
enableDynamicSimulationSystem _dynSimToggle;
|
|
|
|
if(_dynSimToggle)then
|
|
|
|
{
|
|
|
|
_cfgDynamicSimulation = 'CfgDynamicSimulation' call EPOCH_returnConfig;
|
|
|
|
"IsMoving" setDynamicSimulationDistanceCoef getNumber(_cfgDynamicSimulation >> "isMovingCoefValue");
|
|
|
|
"Group" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "groupDynSimDistance");
|
|
|
|
"Vehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "vehicleDynSimDistance");
|
|
|
|
"EmptyVehicle" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "emptyVehicleDynSimDistance");
|
|
|
|
"Prop" setDynamicSimulationDistance getNumber(_cfgDynamicSimulation >> "propDynSimDistance");
|
2017-08-15 19:19:03 +00:00
|
|
|
};
|