Triggers

0.23.3.0 contains 47 entries in 34 sections distributed over 9148 parts in 2189 jbeam files.

Required arguments

id
name
string
type
Uniquely identifies the trigger. Need to be unique for the whole vehicle
label
name
string
type
If not empty, will displays a descriptive text above the trigger
idRef
name
number
type
Reference node for the coordinate system
idX
name
number
type
X node for the coordinate system
idY
name
number
type
Y node for the coordinate system
type
name
string
type
Type of the trigger

valid values:

  • box
  • sphere (experimental, might not work correctly right now)
size
name
table
type
Size in 3D coordinates

example value:

{"x":0.25, "y":0.05, "z":0.08}
table
type
Rotation in Euler angles (degrees)

example value:

{"x":0, "y":0, "z":0}
rotation
name
table
type
Rotation in Euler angles (degrees)
Used for animation and alike. Unused right now.
table
type
Translation in local coordinate system
Used for animation and alike. Unused right now.
table
type
Initial translation in local coordinate system

example value:

{"x":0.2, "y":0.26, "z":-0.05}

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}]
  ],
}
  • events defines the actual thigns to execute (like input_maps.json, but inside a part)
  • triggerEventLinks links together triggers and events
Page created: 29 March 2021, at 12:52
Last modified: 24 July 2021, at 10:20

Any further questions?

Join our discord