Trigger
by Jonas Antunes da silva · in General Discussion · 09/02/2006 (9:07 am) · 4 replies
Hi,
I'm trying to use Triggers in my game (when enter in the house, call the monsters, for example), but it's not working. I'm doing something wrong ofcourse.
How do I have proceed? Anyone have some tutorial about it?
Thanks a lot.
I'm trying to use Triggers in my game (when enter in the house, call the monsters, for example), but it's not working. I'm doing something wrong ofcourse.
How do I have proceed? Anyone have some tutorial about it?
Thanks a lot.
#2
function TempleOfEvilTrigger::onEnterTrigger( %this, %trigger, %obj )
{
echo( "The player has just entered the Temple of Evil! - Not the smartest move!");
Parent::onEnterTrigger( %this, %trigger, %obj );
}
I want to change de "echo" line for an action, like make de monsters attack de player.
I'm not finding how to conect de trigger area with the "monsters".
I understand how a Trigger works, but no with others objects.
Any help?
Thanks a lot!
09/12/2006 (5:49 pm)
For example, in this part of tutorial code I was reading:function TempleOfEvilTrigger::onEnterTrigger( %this, %trigger, %obj )
{
echo( "The player has just entered the Temple of Evil! - Not the smartest move!");
Parent::onEnterTrigger( %this, %trigger, %obj );
}
I want to change de "echo" line for an action, like make de monsters attack de player.
I'm not finding how to conect de trigger area with the "monsters".
I understand how a Trigger works, but no with others objects.
Any help?
Thanks a lot!
#3
"How can I, in arbitrary parts of script code, find arbitrary other monsters, given some selection criteria"?
09/13/2006 (10:06 am)
So, more generally, your question is:"How can I, in arbitrary parts of script code, find arbitrary other monsters, given some selection criteria"?
#4
then in the trigger code, you can just loop through all the TempleMonsters objects to activate them or whatever.
09/13/2006 (11:04 am)
Store the ID's for the "Temple of Evil" monsters in a Simset object. new Simset(TempleMonsters); TempleMonsters.add(%monsterID); ....
then in the trigger code, you can just loop through all the TempleMonsters objects to activate them or whatever.
Torque Owner Tim Heldna