TriggerData

consoledoc.h

Defines shared properties for Trigger objects.

More...

Callbacks

void

Called when an object enters the volume of the Trigger instance using this TriggerData.

void

Called every tickPeriodMS number of milliseconds (as specified in the TriggerData) whenever one or more objects are inside the volume of the trigger.

void

Called when an object leaves the volume of the Trigger instance using this TriggerData.

int

Time in milliseconds between calls to onTickTrigger() while at least one object is within a Trigger's bounds.

bool

Forces Trigger callbacks to only be called on clients.

Detailed Description

Defines shared properties for Trigger objects.

The primary focus of the TriggerData datablock is the callbacks it provides when an object is within or leaves the Trigger bounds.

see:

Callbacks

onEnterTrigger(Trigger trigger, GameBase obj)

Called when an object enters the volume of the Trigger instance using this TriggerData.

Parameters:

trigger

the Trigger instance whose volume the object entered

obj

the object that entered the volume of the Trigger instance

onTickTrigger(Trigger trigger)

Called every tickPeriodMS number of milliseconds (as specified in the TriggerData) whenever one or more objects are inside the volume of the trigger.

The Trigger has methods to retrieve the objects that are within the Trigger's bounds if you want to do something with them in this callback. Parameters:

trigger

the Trigger instance whose volume the object is inside

onLeaveTrigger(Trigger trigger, GameBase obj)

Called when an object leaves the volume of the Trigger instance using this TriggerData.

Parameters:

trigger

the Trigger instance whose volume the object left

obj

the object that left the volume of the Trigger instance

int tickPeriodMS 

Time in milliseconds between calls to onTickTrigger() while at least one object is within a Trigger's bounds.

bool clientSide 

Forces Trigger callbacks to only be called on clients.