From e1f48ea5579d65b36acf36d6f7d6e50def4042e8 Mon Sep 17 00:00:00 2001 From: oiad Date: Sun, 3 Sep 2017 19:03:33 +1200 Subject: [PATCH] Allow modular buildables to refund defined parts This allows typically not refunded modular buildables to be configured by the server admin. For example: DZE_modularConfig = [ ["CinderWall_DZ", [["CinderBlocks",7],["MortarBucket",2]]], ["CinderWallDoor_DZ", [["CinderBlocks",7],["MortarBucket",2],["ItemTankTrap",3],["ItemPole",[1,3]]]] ]; This would refund 7 cinder blocks and 2 mortar for "CinderWall_DZ" For "CinderWallDoor_DZ" you would get 7 cinder blocks, 2 mortar, 3 tank traps and a random number of poles between 1 and 3. The refund amount can be an array where the first param is the minimum and the second is the maximum, it will refund a random amount between them. Thanks to @BigEgg for the suggestion and sample code. --- SQF/dayz_code/configVariables.sqf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 04b0afaec..9bef190eb 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -93,6 +93,21 @@ DZE_dirWithDegrees = true; // When rotating objects with Q&E, use the custom deg DZE_buildMaxMoveDistance = 10; // Max distance player can walk from start position when building. Anything >= the differnce between DZE_PlotPole values is not recommended (allows walking into other plots). DZE_buildMaxHeightDistance = 10; // Max distance player can raise or lower object from start position when building. +DZE_modularConfig = []; +/* + Array of classnames with magazine based loot to be refunded on deconstruction of modular built items that do not typically refund. + + For example: + DZE_modularConfig = [ + ["CinderWall_DZ", [["CinderBlocks",7],["MortarBucket",2]]], + ["CinderWallDoor_DZ", [["CinderBlocks",7],["MortarBucket",2],["ItemTankTrap",3],["ItemPole",[1,3]]]] + ]; + + This would refund 7 cinder blocks and 2 mortar for "CinderWall_DZ" + For "CinderWallDoor_DZ" you would get 7 cinder blocks, 2 mortar, 3 tank traps and a random number of poles between 1 and 3. + The refund amount can be an array where the first param is the minimum and the second is the maximum, it will refund a random amount between them. +*/ + // Door Management DZE_doorManagement = true; // Enable Door Management by @DevZupa. DZE_doorManagementMustBeClose = false; //Players must be within 10m of door to be added as a door friend.