R3vo/Sandbox1 – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 1: Line 1:
= Display3DEN - Tree View Data =
= Field Repair =
[[Spearhead 1944]] introduces a system that allows to execute a field repair from within a vehicle. The [[BIS_fnc_holdActionAdd|hold action]] is available if the player's vehicle damage exceeds a predefined threshold.
{{Feature|informative|The action is not available by default but has to be implemented by the scenario creator.}}


The various tree view controls in [[Eden Editor]] all store information about the item. The following will list which tree view holds what data:
== Adding the Action ==
=== Scripted ===
The is added to the vehicle by executing <sqf inline>_vehicle call SPE_missionUtilityFunctions_fnc_addRepairAction</sqf>.
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 [[Event Scripts#initPlayerLocal.sqf|initPlayerLocal.sqf]].


{| class="wikitable"
Example:
|+ Control 71 - Empty Groups (Compositions)
<sqf>
|-
// initPlayerLocal.sqf
! Command !! Example Data
myVehicle call SPE_missionUtilityFunctions_fnc_addRepairAction
|-
</sqf>
| [[tvValue|value]] || Example
 
|-
=== Module ===
| [[tvData|Data]] || Example
{{Wiki|TODO|⧼Do Stuff⧽}}
|-
 
| [[tvText|Text]] || Example
== 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 <sqf inline>SPE_RepairAction_BaseDuration = 5;</sqf> where 5 is the time in seconds the action takes.
This base value is then multiplied by a difficutly factor and an engineer bonus.
 
==== Engineer Bonus ====
By default, players who are [[getUnitTrait|engineers]] repair 100% faster. This value can be adjusted by changing <sqf inline>SPE_RepairAction_EngineerBonus = 1; //Engineers have no bonus</sqf>
 
== Interval ==
The interval defines how many seconds have to pass between two repairs. <sqf inline>SPE_RepairAction_Interval = 30;</sqf>
 
== Damage Thresholds ==
The damage Thresholds are defined in <sqf inline>SPE_RepairAction_DamageThresholds = [0.5, 0]</sqf>. The first value is the threshold for <sqf inline>SPE_CadetMode == true</sqf> the second one for <sqf inline>SPE_CadetMode == false</sqf>. 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 <sqf inline>SPE_CadetMode == true</sqf>, the vehicle can be fully repaired and all [[getAllHitPointsDamage|parts]] can be repaired.
 
On higher difficulties <sqf inline>SPE_CadetMode == false</sqf> 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.
 
# The vehicle is alive
# Player has to be in the vehicle
# The vehicle has to be slower than 10 km/h
# The vehicle has to be of [[isKindOf|type]] "AllVehicles"
# In none cadet mode, the vehicle has to be able to either [[canFire|fire]] or [[canMove|move]]
# The vehicle is not burning <sqf inline>SPE_Vehicle_OnFire == false</sqf>
# The time in seconds after the last repair execution is greater than <sqf inline>SPE_RepairAction_Interval</sqf>
 
== Strategics ==
{{Wiki|TODO|⧼Do Stuff⧽}}

Revision as of 18:16, 15 July 2024

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 but has to be implemented by the scenario creator.

Adding the Action

Scripted

The 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.

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, thetracks, 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⧽