Interaction maps define vehicle interaction actions in files ending with:
*.interaction.json
They use the same action-code format as input_actions.json, but they are primarily used by vehicle interactive triggers, especially triggers2 and triggerEventLinks2.
Common uses include:
Interaction maps are stored in vehicle folders:
vehicles/<vehicleName>/*.interaction.json
Examples:
vehicles/cannon/cannon_default.interaction.json
vehicles/us_semi/us_semi_default.interaction.json
vehicles/common/common_default.interaction.json
There can be multiple interaction map files per vehicle.
The common vehicle folder can define shared actions that other vehicles can reference.
{
"fileversion": 2,
"actions": {
"tailgate": {
"order": 1005.1,
"onDown": "controller.getControllerSafe('tailgateCoupler').toggleGroup()",
"title": "vehicle.interaction.tailgate.toggle.title",
"desc": "vehicle.interaction.tailgate.toggle.desc"
}
}
}
The actions object contains the same kind of action entries used by input_actions.json.
| Field | Type | Description |
|---|---|---|
fileversion |
integer | Interaction map format version. Current shipped files commonly use 2. |
actions |
object | Map of action ids to action definitions. |
Each entry inside actions is an input action.
Common fields:
| Field | Type | Description |
|---|---|---|
order |
number | Display/sorting order. |
onChange |
string | Code run when the input value changes. |
onDown |
string | Code run when a key/button/trigger is pressed. |
onUp |
string | Code run when a key/button/trigger is released. |
title |
string | Translation key or short display title. |
desc |
string | Translation key or short description. |
isCentered |
bool | Uses -1..1 input values instead of 0..1. |
icon |
string | Optional UI/icon hint used by some interaction systems. |
For the full action-code model, see Writing Action Code .
Interaction actions usually run in vehicle Lua.
Example toggle:
"door_FR": {
"order": 1000.4,
"onDown": "controller.getControllerSafe('door_FR_coupler').toggleGroup()",
"title": "vehicle.interaction.doors.FR.toggle.title",
"desc": "vehicle.interaction.doors.FR.toggle.desc"
}
Example analog / held action:
"lift": {
"order": 1.2,
"onChange": "custom_input.liftBarrel(VALUE)",
"title": "ui.inputActions.cannon.lift.title",
"desc": "ui.inputActions.cannon.lift.description",
"isCentered": true
}
VALUE is replaced by the current input value before the code runs.
Use:
onDown for toggles and one-shot actions.onChange for levers, sliders, analog inputs, and held controls.onUp for release behavior.triggers2 defines clickable trigger volumes on a vehicle.
triggerEventLinks2 connects those trigger volumes to input actions.
Example:
"triggerEventLinks2": [
["triggerId:triggers2", "triggerInput", "inputAction"],
["door_R", "action0", "door_FR"]
]
This means:
| Field | Meaning |
|---|---|
triggerId:triggers2 |
The id of the trigger volume. |
triggerInput |
Which trigger input activates it, such as action0. |
inputAction |
The interaction/action id to run. |
Common triggerInput values:
| Value | Meaning |
|---|---|
action0 |
Left mouse button / primary action. |
action1 |
Secondary action, often shift + left mouse or right mouse depending context. |
action2 |
Middle mouse button / tertiary action. |
inputAction usually points to an action in a *.interaction.json file.
triggerEventLinks2 does not point to legacy events. It points to input actions.The common interaction file:
vehicles/common/common_default.interaction.json
defines many shared actions, such as door, hood, trunk, latch, lightbar, coupling, trailer, hydraulic, and container actions.
Vehicle parts can reference these actions from triggerEventLinks2.
When a common: prefix is used in a trigger link, the action is resolved from the common action map / common action set rather than only the current vehicle’s interaction map.
Example:
["door_R", "action0", "common:door_FR"]
Use common actions when the behavior is already provided and matches your part.
Interaction actions can be hidden or disabled from the UI until the vehicle part declares that they are available.
Use the JBeam actionsEnabled section:
"actionsEnabled": [
["id"],
["tiltUp"],
["tiltDown"],
["extend"],
["retract"]
]
This is useful for vehicles with many optional parts. Only actions for installed parts should be shown to the player.
actionsEnabled, its tooltip or binding legend may not appear even if the action exists.| File | Main use |
|---|---|
input_actions.json / input_actions*.json |
General vehicle-specific bindings. |
*.interaction.json |
Vehicle interaction actions, especially clickable triggers2 controls. |
JBeam events |
Legacy part-local action definitions used with old triggers / triggerEventLinks. |
For new clickable vehicle interactions, prefer:
triggers2 + triggerEventLinks2 + *.interaction.json
Use input_actions*.json for normal vehicle controls that do not belong to a clickable interaction map.
Older trigger setups use:
triggers
triggerEventLinks
events
In that system, events defines the action code directly inside the JBeam part.
Newer triggers2 setups use:
triggers2
triggerEventLinks2
*.interaction.json
actionsEnabled
The action code moves out of JBeam events and into an interaction map.
Interaction actions can have normal input bindings.
Default binding files live in:
vehicles/<vehicleName>/inputmaps/
Example:
vehicles/cannon/inputmaps/keyboard.json
vehicles/cannon/inputmaps/xidevice.json
Use the Controls menu to create bindings, then move/rename the generated .diff files into the vehicle’s inputmaps folder as default .json files when appropriate.
Use a unique suffix for mod-provided binding files:
vehicles/my_vehicle/inputmaps/keyboard_my_mod.json
Interaction map:
{
"fileversion": 2,
"actions": {
"open_toolbox": {
"order": 10,
"onDown": "controller.getControllerSafe('toolboxLatch').toggleGroup()",
"title": "vehicle.interaction.toolbox.open.title",
"desc": "vehicle.interaction.toolbox.open.desc"
}
}
}
JBeam link:
"actionsEnabled": [
["id"],
["open_toolbox"]
],
"triggerEventLinks2": [
["triggerId:triggers2", "triggerInput", "inputAction"],
["toolbox_handle", "action0", "open_toolbox"]
]
The toolbox_handle trigger calls the open_toolbox action from the interaction map.
For tools that generate or modify interactions:
fileversion.triggerEventLinks2 and actionsEnabled.events unless intentionally converting to the old trigger system.inputAction reference in triggerEventLinks2.actionsEnabled entry against available actions.Possible causes:
triggerEventLinks2.inputAction does not match an action id.triggerInput.Possible causes:
actionsEnabled.Possible causes:
triggerEventLinks2 points to a different id.action0, action1, action2) is wrong.triggerEventLinks2 action resolves.actionsEnabled.See also: Actions , Bindings , Vehicle-Specific Bindings , Triggers2 .
Was this article helpful?