add forced overrides of vehicle and loot tables

This commit is contained in:
vbawol 2017-04-05 11:10:28 -05:00
parent b02209184f
commit 63817d743e
6 changed files with 20 additions and 3 deletions

View File

@ -66,6 +66,9 @@ starterTraderItems[] = { { "ItemSodaBurst", "meatballs_epoch", "MortarBucket", "
NPCSlotsLimit = 20; // Max number of traders static or dynamic. Warning! Higher the number lower performance.
forceStaticTraders = "true"; // disables traders moving from work to home
forcedVehicleSpawnTable = ""; // leave blank for default. Options: "allowedVehiclesList","allowedVehiclesList_CUP","allowedVehiclesList_MAD","allowedVehiclesList_MADCUP"
forcedLootSpawnTable = ""; // leave blank for default. Options: "CfgLootTable","CfgLootTable_CUP","CfgLootTable_MAD","CfgLootTable_MADCUP"
// Markers
showEarthQuakes = "true"; // show mineral viens caused by earthquakes
showShippingContainers = "true"; // Show location of events based loots (plants, shipping container, Carnival)

View File

@ -24,6 +24,9 @@ diag_log format["Epoch: Attempt Create Object: %1 for %2",_objArr, name _player]
_cfgPricing = 'CfgPricing' call EPOCH_returnConfig;
_lootTableIndex = if (EPOCH_modCUPVehiclesEnabled) then {if (EPOCH_mod_madArma_Enabled) then {3} else {1}} else {if (EPOCH_mod_madArma_Enabled) then {2} else {0}};
_allowedVehicleListName = ["allowedVehiclesList","allowedVehiclesList_CUP","allowedVehiclesList_MAD","allowedVehiclesList_MADCUP"] select _allowedVehicleIndex;
if !(EPOCH_forcedVehicleSpawnTable isEqualTo "") then {
_allowedVehicleListName = EPOCH_forcedVehicleSpawnTable;
};
_allowedVehiclesList = getArray(configFile >> "CfgEpoch" >> worldName >> _allowedVehicleListName);
//diag_log format ["DEBUG: Allowed Vehs: %1",_allowedVehiclesList];
_vehicles = [];

View File

@ -19,6 +19,9 @@ _pricingConfig = 'CfgPricing' call EPOCH_returnConfig;
_lootTableIndex = if (EPOCH_modCUPVehiclesEnabled) then {if (EPOCH_mod_madArma_Enabled) then {3} else {1}} else {if (EPOCH_mod_madArma_Enabled) then {2} else {0}};
_lootTableClass = ["CfgLootTable","CfgLootTable_CUP","CfgLootTable_MAD","CfgLootTable_MADCUP"] select _lootTableIndex;
if !(EPOCH_forcedLootSpawnTable isEqualTo "") then {
_lootTableClass = EPOCH_forcedLootSpawnTable;
};
_randomizeMagazineAmmoCount = ["CfgEpochClient", "randomizeMagazineAmmoCount", true] call EPOCH_fnc_returnConfigEntryV2;
if !(isNull _object) then{
_lootTable = [_type, "CfgMainTable", "tables"] call EPOCH_weightedArray;

View File

@ -27,6 +27,7 @@ _abortAndError = {
_cfgServerVersion = configFile >> "CfgServerVersion";
_serverSettingsConfig = configFile >> "CfgEpochServer";
_epochConfig = configFile >> "CfgEpoch";
_clientVersion = getText(_cfgServerVersion >> "client");
_configVersion = getText(_cfgServerVersion >> "config");
@ -99,7 +100,7 @@ WEST setFriend[EAST, 1];
diag_log format["Epoch: Setup World Settings for %1",worldName];
//World Settings
_worldSize = worldSize;
_epochWorldPath = configfile >> "CfgEpoch" >> worldName;
_epochWorldPath = _epochConfig >> worldName;
if (isClass _epochWorldPath) then {
_configSize = getNumber(_epochWorldPath >> "worldSize");
if (_configSize > 0) then {
@ -140,9 +141,12 @@ diag_log "Epoch: Loading vehicles";
// Vehicle slot limit set to total of all allowed limits
_allowedVehicleIndex = if (EPOCH_modCUPVehiclesEnabled) then {if (EPOCH_mod_madArma_Enabled) then {3} else {1}} else {if (EPOCH_mod_madArma_Enabled) then {2} else {0}};
_allowedVehicleListName = ["allowedVehiclesList","allowedVehiclesList_CUP","allowedVehiclesList_MAD","allowedVehiclesList_MADCUP"] select _allowedVehicleIndex;
if !(EPOCH_forcedVehicleSpawnTable isEqualTo "") then {
_allowedVehicleListName = EPOCH_forcedVehicleSpawnTable;
};
// do something here
_allowedVehiclesList = getArray(configFile >> "CfgEpoch" >> worldName >> _allowedVehicleListName);
_allowedVehiclesList = getArray(_epochConfig >> worldName >> _allowedVehicleListName);
_vehicleSlotLimit = 0;
{_vehicleSlotLimit = _vehicleSlotLimit + (_x select 1)} forEach _allowedVehiclesList;
_ReservedSlots = 50;

View File

@ -59,7 +59,9 @@ _configArray = [
["hiveAdminCmdTime", 5],
["DEBUG_VEH", false],
["useOldLoadVehicles", false],
["enableUnitTestOnStart", 0]
["enableUnitTestOnStart", 0],
["forcedVehicleSpawnTable",""],
["forcedLootSpawnTable",""]
];
EPOCH_fnc_returnConfigEntry = {

View File

@ -68,6 +68,8 @@ class CfgEpoch
telePos[] = {};
propsPos[] = {};
staticNpcPos[] = {};
forcedVehicleSpawnTable = "";
forcedLootSpawnTable = "";
allowedVehiclesList[] = {
{"C_Offroad_01_EPOCH",8},
{"C_Quadbike_01_EPOCH",8},