Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addons/repair/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@

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

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);
Expand Down
25 changes: 22 additions & 3 deletions docs/wiki/framework/repair-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down