From f6da952cb57ae8ab67caf9c1a77334b1b01497cb Mon Sep 17 00:00:00 2001 From: He-Man Date: Sun, 28 Jul 2019 15:47:35 +0200 Subject: [PATCH] New syntax for Trader items (old one can also still be used) --- Server_Install_Pack/@epochhive/epochconfig.hpp | 16 ++++++++++++++++ Sources/epoch_server/init/server_variables.sqf | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index 90db9435..2404871b 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -147,10 +147,26 @@ forceRestartTime = 14400; // 4 hour restarts // Traders taxRate = 0.1; // controls the price increase for purchases +/* starterTraderItems[] = { // Starter Items for fresh spawned trader first array is classnames second is quantity. {"ItemSodaBurst","meatballs_epoch","MortarBucket","CinderBlocks","VehicleRepair","CircuitParts","ItemCorrugated","PartPlankPack","ItemRock","ItemRope","ItemStick"}, {5,5,5,5,5,5,5,5,5,5,5} }; +*/ + starterTraderItems[] = { // Starter Items for fresh spawned trader (old / above variant is also still working!) + {"ItemSodaBurst",5}, + {"meatballs_epoch",5}, + {"MortarBucket",5}, + {"CinderBlocks",5}, + {"VehicleRepair",5}, + {"CircuitParts",5}, + {"ItemCorrugated",5}, + {"PartPlankPack",5}, + {"ItemRock",5}, + {"ItemRope",5}, + {"ItemStick",5} + }; + NPCSlotsLimit = 30; // Max number of traders static or dynamic. Warning! Higher the number lower performance. forceStaticTraders = "true"; // disables traders moving from work to home TraderGodMode = "false"; // If true, Trader can not be killed by Players diff --git a/Sources/epoch_server/init/server_variables.sqf b/Sources/epoch_server/init/server_variables.sqf index 17258283..a1b2fc8c 100644 --- a/Sources/epoch_server/init/server_variables.sqf +++ b/Sources/epoch_server/init/server_variables.sqf @@ -89,6 +89,21 @@ private _serverSettingsConfig = configFile >> "CfgEpochServer"; missionNamespace setVariable[format["EPOCH_%1", _x select 0], _varData]; }forEach _configArray; +// Convert Starter Trader items from alternative syntax +if (count EPOCH_starterTraderItems == 0) then { + EPOCH_starterTraderItems = [[],[]]; +}; +if ((EPOCH_starterTraderItems select 0) isEqualTypeArray ["",0]) then { + private _EPOCH_starterTraderItems = [[],[]]; + { + if (_x isEqualTypeArray ["",0]) then { + (_EPOCH_starterTraderItems select 0) pushback (_x select 0); + (_EPOCH_starterTraderItems select 1) pushback (_x select 1); + }; + } foreach EPOCH_starterTraderItems; + EPOCH_starterTraderItems = _EPOCH_starterTraderItems; +}; + // Convert Starter Trader Magazines from mags to rounds { _maxrnd = 1;