Spearhead 1944 Vehicle Customization
The Spearhead 1944 Vehicle Customization Menu was first introduced in the scenario Panzerkampfwagen. In order to add the feature to your scenario follow the steps on this page.
The Spearhead 1944 vehicle customization feature allows the player to customize one or multiple selected vehicles and is fully multiplayer compatible
Customization includes:
- Selecting a different vehicle from a defined list
- Changing the paint job, if any are available
- Adjust the parts shown such as additional shields, camo nets or armor
In addition to that, each vehicle can have a custom Vehicle Description displaying additional information to the player.
Lastly, each vehicle will have a Vehicle Strength. This value is calculated from the vehicles config cost property and set into relation of all vehicles that can be selected.
Setup
For this example we are going to add an action to two tanks that are then available to all players.
- Place two tanks with the name SPE_o_Player_Tank_SP and SPE_o_Player_Tank_MP in Eden Editor
- Create a file called init.sqf in the scenario folder, see Event Scripts
- Paste the following code into the file
- Preview the scenario and approach one of the tanks
- Now select the action entry and open the menu
Function Documentation
[_mode, _vehicle, _vehicleClasses, _vehicleDescriptions, _variablesToCopy, _params] call SPE_missionUtilityFunctions_fnc_vehicleCustomization;
- _mode - String: Defines the mode. Use init to open the UI. The other modes are used internally.
- _vehicle - Object: Defines the vehicle that can be customized
- _vehicleClasses - Array of Strings: The vehicle classes that will be available for selection
- _vehicleDescriptions - Array of Strings: The description for each vehicle class. Order needs to match the order of _vehicleClasses
- _variablesToCopy - Array of Strings: Variables that will be copied upon switching the vehicle from the old to the new vehicle. These variables will automatically be made public
- _params - Array - Internal use only!
Restrictions
Some limitations were implemented to prevent faulty behaviour. These consist of:
- The vehicle needs to be alive
- There must be at least one vehicle class defined
- The speed of the vehicle needs to be smaller than 1
- Only one player at a time can customize a vehicle
- In multiplayer the vehicle has to be empty
- In multiplayer only one player can customize a vehicle. The first player opening the menu will block other players from doing so until it's closed
Appropriate hints are displayed to inform the player why customization is currently not possible