Game Development Community

EndGame() problem. Pls help

by Billy Am · in Torque Game Engine · 07/11/2005 (5:37 am) · 3 replies

Hi folks
I have set 2 triggers at my track trigger.cp=0 and trigger.cp=1. and in the triggers.cs's function onEnterTrigger , I did if(%trigger.cp == 1) EndGame();. But the game keeps crashing when my car reaches the trigger area ... can anyone help ? thanks
billy

#1
07/11/2005 (6:11 am)
Remode the endGame for now and use echo() to trace the issue in the console.
#2
07/11/2005 (7:04 am)
Without endgame , the game won't crash ... and what is remode? remove?
billy
#3
07/11/2005 (8:08 am)
Hi guys
I managed to go down to irc channel and was helped by atincjon :P his solution is pasted below

$GameIsEnding = 0;

function MyEndGame() {
if( $GameIsEnding == 0 )
$GameIsEnding = schedule( 100, 0, "EndGame");
}

This is my onEnterTrigger method

$GameIsEnding=0;

if(%trigger.cp == 1){
MyEndGame();
}

then add the function below ... :P thanks everyone!!!

billy