Trigger
A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger.
Callbacks
Public Static Attributes
bool
Disables rendering of all instances of this type.
bool
Disables selection of all instances of this type.
bool
Forces all Trigger's to render.
Public Attributes
string
The command to execute when an object enters this trigger. Object id stored in %obj. Maximum 1023 characters.
string
The command to execute when an object leaves this trigger. Object id stored in %obj. Maximum 1023 characters.
floatList
Defines a non-rectangular area for the trigger.
string
The command to execute while an object is inside this trigger. Maximum 1023 characters.
string
evaluation condition to trip callbacks (true/false)
bool
Do we trigger callacks just the once?
int
typemask filter
Public Functions
int
Get the number of objects that are within the Trigger's bounds.
Detailed Description
A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger.
TriggerData provides the callbacks for the Trigger when an object enters, stays inside or leaves the Trigger's volume.
Callbacks
onAdd(uint objectId)
Called when the Trigger is being created.
Parameters:
objectId | the object id of the Trigger being created |
onRemove(uint objectId)
Called just before the Trigger is deleted.
Parameters:
objectId | the object id of the Trigger being deleted |
Public Static Attributes
bool isRenderable
Disables rendering of all instances of this type.
bool isSelectable
Disables selection of all instances of this type.
bool renderTriggers
Forces all Trigger's to render.
Used by the Tools and debug render modes.
Public Attributes
string enterCommand
The command to execute when an object enters this trigger. Object id stored in %obj. Maximum 1023 characters.
string leaveCommand
The command to execute when an object leaves this trigger. Object id stored in %obj. Maximum 1023 characters.
floatList polyhedron
Defines a non-rectangular area for the trigger.
Rather than the standard rectangular bounds, this optional parameter defines a quadrilateral trigger area. The quadrilateral is defined as a corner point followed by three vectors representing the edges extending from the corner.
string tickCommand
The command to execute while an object is inside this trigger. Maximum 1023 characters.
string TripCondition
evaluation condition to trip callbacks (true/false)
bool TripOnce
Do we trigger callacks just the once?
int TrippedBy
typemask filter
Public Functions
getNumObjects()
Get the number of objects that are within the Trigger's bounds.
getObject(int index)
Retrieve the requested object that is within the Trigger's bounds.
Parameters:
index | Index of the object to get (range is 0 to getNumObjects()-1) |
The SimObjectID of the object, or -1 if the requested index is invalid.