Repair - Allow setting spare wheels/tracks count in config (#9481)

* Allow setting spare wheels/tracks count in config

* Update repair framework docs
This commit is contained in:
Tim Beswick 2023-10-12 17:45:56 +01:00 committed by GitHub
parent 2eb914836c
commit bd377c49fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View File

@ -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);

View File

@ -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