View Full Version : Game End Functions

15th Nov 2001, 08:58 AM
In a game type, I need to call a function whenever a match is ended, be it via score/time limit being hit or pressing escape and starting a new match midgame. I've tried putting the call in both RestartGame() & EndGame(), but it seemes neither of these gets called when you press escape and start a new game... any idea where I should call the function from?

15th Nov 2001, 12:31 PM
Dunno whether this'll work, but you could try the "Destroy()" function of the GameInfo class.
I don't even know whether it's called like that... Anyway, it's the function that's always called when an object is destroyed.

15th Nov 2001, 09:25 PM
There's a variable in game info called bGameEnded, you can try test the condition of the variable, if it's true then you can execute some code after it.

There's also a function called ResetGame(), maybe you can try that out for when you restart a new game. Im not sure though.

16th Nov 2001, 08:24 AM
yeah... I'm aware of the variable.... but I wasn't aware of that other function. Will test that out.

16th Nov 2001, 12:52 PM
it seems resetgame() is a static function... UCC tells me I cannot call instance functions from within a static function... damn.