Game Development Community

Trigger Issue

by John Eric Miller · in Torque Game Engine · 04/20/2003 (2:25 pm) · 3 replies

I am trying to make a trigger that loads a mission. I can execute the load mission function from the console with no problem but when I try to do it in a trigger my game blows up with an win XP exception. Does anyone have any ideas what is happening. I am calling the loadmission from the onEnterTrigger event. Just after startgame is called the program dies. I am using v 1.1.2 of Torque and have made no modifications to the C++ code.

#1
04/20/2003 (3:33 pm)
This is just a guess, but instead of directly loading the mission from the trigger, use the function schedule(...) to make the load of the new mission. I think you can have problems deleting objects from within a trigger that you will not have from within a schedule call.
#2
04/20/2003 (4:09 pm)
I would I schedule a loadmission function with 3 arguments?
#3
04/20/2003 (4:17 pm)
I figured it out. I did, schedule( 0, 0, loadMission, "script/data/missions/stronghold1.mis",false);
in my onEnterTrigger and it worked!

Thanks for the help! I had tried this earlier but I put quotes around the function name.