Skip to content

Event Fields

Ashley Bennett edited this page Mar 6, 2024 · 14 revisions

Trigger

(Attribute) Event to trigger the specified effects on.
Valid values:
Functional - tool becomes functional
Powered - tool becomes powered
Enabled - tool is enabled
Activated - tool function is activated via terminal or hotbar
LeftClick - tool function is activated by player left click
RightClick - tool function is activated by player right click
Click - tool function is activated by either player click
Firing - tool function is activated by any method
Hit - tool is working on something somewhere in its effect volume
RayHit - tool raycast hit something directly in front of the tool


Animation

(Optional) Specifies an animation to trigger on a subpart. Any number of these can be specified.

Subpart

(Required) Name of the subpart to apply the animation to. (Do not include the subpart_)

Type

(Required) Type of animation to apply.
Valid values: Rotate - Linear - Hide - Unhide

Direction

(Required for Rotate and Linear) A 3D vector defining the axis to move the subpart along or rotate it around.

Speed

(Optional) Speed in metres/s (to move) or degrees/s (to rotate) the subpart.

Duration

(Optional) Time in ticks to run the animation. If not preset or zero the animation will run indefinitely while the trigger is active.

WindupTime

(Optional) Time in ticks to accelerate into the movement at the start of the animation (and out of it at the end).


ParticleEffect

(Optional) Specifies a particle effect to generate at a specified location. Any number of these can be specified.

Name

(Required) This can be either the name of a specific particle effect to generate, or the SubtypeId of a Physical Material prefixed with MaterialProperties/ (i.e. MaterialProperties/ShipDrill) to generate different particles depending on the material being affected, per the ContactProperties section of the PhysicalMaterialDefinition.

Location

(Required) Location to generate the particle effect at.
Valid values:
Centre - Particle is spawned relative to the centre of the tool.
Emitter - Particle is spawned relative to the specified dummy.
Hit - Particle is spawned relative to the tool's forward raycast hit point.

Dummy

(Required if Location is Emitter) Name of the model dummy to spawn the particle relative to (if this is a subpart include the subpart_).

Offset

(Optional) The vector by which to offset the particle effect from the location specified in Location.


Beam

(Optional) Specifies a beam effect to be drawn between two points. Any number of these can be specified.

Start

(Required) Name of the dummy to start the beam at.

EndLocation

(Required) Location to end the beam at.
Valid values:
Emitter - End the beam at the specified End dummy.
Forward - Project the beam forward until it reaches the end of the tool's range.
Hit - Project the beam forward until it hits something or reaches the end of the tool's range.

End

(Optional) Name of the dummy to end the beam at if using Emitter EndLocation.

Material

(Optional) Name of a transparent material to use for the beam. Default value: WeaponLaser

Width

(Optional) Width of the beam in metres.
Default value: 0.5

Length

(Optional) Length of the beam in metres (only used if using Forward EndLocation.
Default value: 0

Color

(Optional) RGBA colour value for the beam. RGB fields cap at 255, Alpha values above 255 increase brightness/bloom.
Default value: 255, 255, 255, 1000


Sound

(Optional) Specifies a sound to play. Only one of these can be specified per event.

Name

(Required) Either the name of a specific audio definition to play, or the SubtypeId of a Physical Material prefixed with MaterialProperties/ (i.e. MaterialProperties/ShipDrill) to play different sounds depending on the material being affected, per the ContactProperties section of the PhysicalMaterialDefinition.