This feature is supported as of BeamNG.tech and .drive version 0.22 to latest.
The Triggers section is used to position clickable boxes on vehicles which emulate buttons, switches, door handles and other hand-operated components.
This section cannot exist on its own. It needs an Event section, which determines the code to be executed, and TriggerEventLinks which links the two.
events
defines the actual things to execute (likeinput_actions.json
, but inside a part)triggerEventLinks
links together triggers andevents
0.34.2.0
contains
883
entries in
495
sections distributed over
18553
parts in
4681
jbeam files.Triggers section arguments
example value for Box type:
{"x":0.25, "y":0.05, "z":0.08}
example value for Sphere type:
0.25
Uses the intrinsic Euler -X -Z -Y rotation system, the center of rotation being the corner of the box that defines position.
example value:
{"x":0, "y":0, "z":0}
Uses the intrinsic Euler -X -Z -Y rotation system, the center of rotation being the corner of the box that defines position.
example value:
{"x":0.2, "y":0.26, "z":-0.05}
TriggerEventLinks section arguments
Commonly used values are:
- action0 = left mouse button
- action1 = right mouse button
- action2 = middle mouse button
Events section arguments
Required arguments
Optional arguments
At least one of them must be defined for the event to work.
Simple Example
{
"triggers":[
["id", "label", "idRef:", "idX:", "idY:","type", "size", "baseRotation", "rotation","translation", "baseTranslation"],
["cargodoorR", "", "cd4r","cd4rr","cd3r", "box",{"x":0.25, "y":0.05, "z":0.08},{"x":0, "y":0, "z":0},{"x":0, "y":0, "z":0},{"x":0, "y":0, "z":0},{"x":0.2, "y":0.26, "z":-0.05}],
],
"triggerEventLinks":[
["triggerId:triggers", "action", "targetEventId:events"],
["cargodoorR", "action0", "toggle_doorR"]
],
"events":[
["id", "title", "desc"],
["toggle_doorR", "ui.inputActions.van.toggle_doorR.title", "ui.inputActions.van.toggle_doorR.description", {"onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0)", "order": 2}]
],
}