Game Development Community

Question about triggers

by Steve D · in Torque Game Engine · 01/29/2007 (7:42 am) · 2 replies

Hi all, triggers seem to be very straight forward but I am confused about one item. How do you code more than 1 unique trigger? From some example code that I read you create a trigger with the onenter and onexit functions but when you make a second trigger how do you code it so you can tell them apart?

#1
01/29/2007 (8:20 am)
Each trigger is define with a data block
datablock TriggerData([b]DefaultTrigger[/b])
{
   tickPeriodMS = 100;
};
the functions are associated to the name of the datablock
function [b]DefaultTrigger[/b]::onLeaveTrigger(%this,%trigger,%obj)
{
}
#2
01/29/2007 (8:38 am)
Oh! Thanks Anthony, that makes perfect sense now.