From 89ac9c0973a8d9655e979ec1cb75040de51d21c6 Mon Sep 17 00:00:00 2001 From: Tim Beswick Date: Fri, 22 Sep 2023 17:24:26 +0100 Subject: [PATCH 1/2] Allow setting spare wheels/tracks count in config --- addons/repair/XEH_postInit.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index f717e566513..58bb1be6e5a 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -64,7 +64,8 @@ private _spareTracks = _vehicle getVariable QGVAR(editorLoadedTracks); if (isNil "_spareTracks") then { - _spareTracks = parseNumber (_vehicle isKindOf "Tank"); // must match eden attribute default + private _defaultCount = parseNumber (_vehicle isKindOf "Tank"); // must match eden attribute default + _spareTracks = [configOf _vehicle >> QGVAR(spareTracks), "NUMBER", _defaultCount] call CBA_fnc_getConfigEntry; }; if (_spareTracks > 0) then { [_vehicle, _spareTracks, "ACE_Track"] call FUNC(addSpareParts); @@ -72,7 +73,8 @@ private _spareWheels = _vehicle getVariable QGVAR(editorLoadedWheels); if (isNil "_spareWheels") then { - _spareWheels = parseNumber (_vehicle isKindOf "Car"); // must match eden attribute default + private _defaultCount = parseNumber (_vehicle isKindOf "Car"); // must match eden attribute default + _spareWheels = [configOf _vehicle >> QGVAR(spareWheels), "NUMBER", _defaultCount] call CBA_fnc_getConfigEntry; }; if (_spareWheels > 0) then { [_vehicle, _spareWheels, "ACE_Wheel"] call FUNC(addSpareParts); From b1b8a956df528c91efb96625da6474d474bf83ba Mon Sep 17 00:00:00 2001 From: Tim Beswick Date: Tue, 10 Oct 2023 11:29:00 +0100 Subject: [PATCH 2/2] Update repair framework docs --- docs/wiki/framework/repair-framework.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/wiki/framework/repair-framework.md b/docs/wiki/framework/repair-framework.md index d825aa0372f..09e26864114 100644 --- a/docs/wiki/framework/repair-framework.md +++ b/docs/wiki/framework/repair-framework.md @@ -14,19 +14,38 @@ version: ## 1. Config Values -### 1.2 Setting Vehicle As Repair Location +### 1.1 Setting Vehicle As Repair Location A vehicle will be set as a repair truck based on the config `ace_repair_canRepair`. Setting `fullRepairLocation` needs to be enabled and is by *disabled* default. ```cpp -class CfgVehicles: Car_F{ - class MyRepairTruck { +class CfgVehicles { + class Car_F; + class MyTruck: Car_F { ace_repair_canRepair = 1; // Make repair vehicle }; }; ``` +### 1.2 Setting Vehicle Spare Wheels and Tracks + +A vehicle can have a default count of spare wheels/tracks based on the config `ace_repair_spareWheels` and `ace_repair_spareTracks`. +Values set in 3den for a vehicle will be used first. Vehicles with no value set in 3den or config will default to 1 spare wheel/track. + +```cpp +class CfgVehicles { + class Car_F; + class MyTruck: Car_F { + ace_repair_spareWheels = 4; + }; + class Tank_F; + class MyTank: Tank_F { + ace_repair_spareTracks = 4; + }; +}; +``` + ## 2. Variables ## 2.1 Make A Vehicle Into A Repair Truck