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.33.3.0
contains
792
entries in
454
sections distributed over
17428
parts in
4472
jbeam files.Triggers section arguments
dictionary or number
type
{“x”:1, “y”:1, “z”:1} (box), 1 (sphere)
default
Size in 3D coordinates in case of Box type, radius in case of Sphere type
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}
Used for animation and alike. Unused right now.
Used for animation and alike. Unused right now.
dictionary
type
{“x”:0, “y”:0, “z”:0}
default
Initial translation in local coordinate system
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
Very short name of the action, will be displayed in various game menues
Full description, may be displayed as tool-tip, should be about one sentence long
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}]
],
}