Game Development Community

Trigger callback bug! (1.5 beta 3)

by And Yet It Moves · in Torque Game Builder · 06/28/2007 (9:07 am) · 4 replies

Hello!

i got a serous problem with triggers here:
for the first time i tried to user a trigger for more than one object at the same time.
2 objects are inside a trigger that reacts on them. only ONE! of them causes onEnter, when you setCollisionSuppress true of this one it causes onLeave (what i expected) and the other one gets the onEnter (what shouldnt happen). the 2 objects have been inside the trigger all the time.

code to reproduce:

create an empty level with a trigger[trigger] and 2 objects[box, box2]. make sure the collision is set up right
box and box2 are inside of the trigger

function box::onLevelLoaded(%this, %scenegraph) {
echo("box loaded!" SPC %this.getId());
box.setGraphgroup(20);
}
function box2::onLevelLoaded(%this, %scenegraph) {
echo("box2 loaded!" SPC %this.getId());
box2.setGraphgroup(20);
}
function trigger::onLevelLoaded(%this, %scenegraph) {
tricker.setCollisionGroups("20");
//%this.setStayCallback(true);
}

function trigger::onEnter(%this, %obj) {
echo("entering" SPC %obj);
}

function trigger::onLeave(%this, %obj) {
echo("leaving" SPC %obj);
}

/* //to try out the on stay callback
function trigger::onStay(%this, %obj) {
echo("staying" SPC %obj);
}*/

when the level is loaded one of the boxes will cause an onEnter Callback (only one!) if you supress the collision of this box:

%box2.setCollisionSupress(true); //if %box2 called the onEnter

now the %box2 causes an onLeave, like expected and the box will cause an onEnter (although it was inside the trigger all the time). same strange behavior when setting collisionSuppress false again!

example console output:

box loaded! 1435
box2 loaded! 1437
entering 1437
==>box2.setCollisionSuppress(true);
leaving 1437
entering 1435
==>box2.setCollisionSuppress(false);
leaving 1435
entering 1437

#1
06/28/2007 (9:50 am)
It is true that objects can only actively collide with one other object at a time. But, triggers are set up to be passive colliders (i.e other objects collide with them). Make sure you have both of the objects set to send collisions.

If you do, than this is definitely a bug.
#2
06/28/2007 (11:45 am)
Wasn't there an issue that sounded quite similar with the collision behavior?
#3
06/29/2007 (1:52 am)
Send (even receive) collision is definitely turned on! seems like a trigger can for now only handle collision with one object at a time.

whats that about the collision behavior?! can you post a link?
#4
06/29/2007 (3:15 am)
The thread in question is this one: www.garagegames.com/mg/forums/result.thread.php?qt=63037

and to me it looks like this issues are connected.

EDITED: Added URL blocks. Still forget about the boards incapability of acting itself on http:// and www.