Spearhead 1944 Field Repair

From Bohemia Interactive Community
Jump to navigation Jump to search

Field Repair

Spearhead 1944 introduces a system that allows to execute a field repair from within a vehicle. The hold action is available if the player's vehicle damage exceeds a predefined threshold.

The action is not available by default and has to be implemented by the scenario creator.

Adding the Action

Scripted

The action is added to the vehicle by executing _vehicle call SPE_missionUtilityFunctions_fnc_addRepairAction. The action has local effect which means it needs to be executed locally for every client that should have access to the action. Ideally, this is done by executing aboves code via initPlayerLocal.sqf.

Example:

// initPlayerLocal.sqf myVehicle call SPE_missionUtilityFunctions_fnc_addRepairAction

Module

🚧
TODO: ⧼Do Stuff⧽

Customization

The underlying system is quite flexiable and can be configured in multiple ways.

Duration

The base duration of the action can be changed via SPE_RepairAction_BaseDuration = 5; where 5 is the time in seconds the action takes. This base value is then multiplied by a difficutly factor and an engineer bonus.

SPE_RepairAction_BaseDuration has to be set before the action is added to a vehicle!

Engineer Bonus

By default, players who are engineers repair 100% faster. This value can be adjusted by changing SPE_RepairAction_EngineerBonus = 1; //Engineers have no bonus

Interval

The interval defines how many seconds have to pass between two repairs. SPE_RepairAction_Interval = 30;

Damage Thresholds

The damage Thresholds are defined in SPE_RepairAction_DamageThresholds = [0.5, 0]. The first value is the threshold for SPE_CadetMode == true the second one for SPE_CadetMode == false. These values define at which damage level the repair action is available and how much damage can be repaired. The values should be >= 0 and < 1.

What can be repaired?

What and how much can be repaired depends on the difficulty. In cadet mode SPE_CadetMode == true, the vehicle can be fully repaired and all parts can be repaired.

On higher difficulties SPE_CadetMode == false the repair is limited. Only vehicles with damage greater 0.5 can be repaired and only until their damage goes back down to 0.5. Besides that, only the crucial parts, responsible for keeping the vehicle operational, such as the engine, the tracks, the main gun and the turret can be repaired.

Pre-conditions

The following conditions need to be met for the action to show up.

  1. The vehicle is alive
  2. Player has to be in the vehicle
  3. The vehicle has to be slower than 10 km/h
  4. The vehicle has to be of type "AllVehicles"
  5. In none cadet mode, the vehicle has to be able to either fire or move
  6. The vehicle is not burning SPE_Vehicle_OnFire == false
  7. The time in seconds after the last repair execution is greater than SPE_RepairAction_Interval

Strategics

🚧
TODO: ⧼Do Stuff⧽