End of Mission by timeout
by Kimberly Unger · in Torque Game Engine · 01/23/2004 (12:24 pm) · 5 replies
I've been attempting to get missions to end with time out and it works almost right. I'm using onGameDurationEnd to time out the mission and this works fine untill it starts the next mission. I want to have it go to a end of game screen that is for loosing.
What needs to be changes to be made to make this happen?
What needs to be changes to be made to make this happen?
#2
01/23/2004 (12:39 pm)
There are many ways to do this. One way is to schedule the game cycle function to begin say 30 seconds after the game timer expires and show your scoreboard screen during that time.
#3
I get the onGameDurationEnd function called ok with the game duration scheduleing logic. I set up a set of echos to show the logic path (see below). I can not see why the load mission is being called.
====>(server/scripts)cycleGame
====>(server/scripts)onCycleExec
====>(server/scripts)Game::endGame - Begin
*** MISSION RESET
====>(server/scripts)Game::endGame - End
====>(server/scripts)onCyclePauseEnd
*** ENDING MISSION
====>(server/scripts)Game::onMissionEnded - Begin
====>(server/scripts)Game::onMissionEnded - End
====>GameConnection::endMission
*** LOADING MISSION: P51/data/missions/track1.mis
01/23/2004 (2:04 pm)
Ron: I took a look at the disconnect() chain and it is not called until the 'quit' button is pressed. The game is a single player game so this makes since.I get the onGameDurationEnd function called ok with the game duration scheduleing logic. I set up a set of echos to show the logic path (see below). I can not see why the load mission is being called.
====>(server/scripts)cycleGame
====>(server/scripts)onCycleExec
====>(server/scripts)Game::endGame - Begin
*** MISSION RESET
====>(server/scripts)Game::endGame - End
====>(server/scripts)onCyclePauseEnd
*** ENDING MISSION
====>(server/scripts)Game::onMissionEnded - Begin
====>(server/scripts)Game::onMissionEnded - End
====>GameConnection::endMission
*** LOADING MISSION: P51/data/missions/track1.mis
#4
onCycleExec calls the endGame function - this then tells all the clients that the game is over and to display the end of game gui (by executing a GameEnd command to the client).
After $Game::EndGamePause onCyclePauseEnd is called which then finds a new mission file and calls loadMission with it.
LoadMission calls EndMission (which calls onMissionEnded).
This is exactly what your echos are showing.
So, to find out how the end of game GUI is displayed, have a look in server/game.cs function endGame(), and then in client/scripts function clientCmdGameEnd() which does the client side processing. $Game::EndGamePause dictates exactly how long your screen will be displayed for...
If thats not what you were looking for let me know...
01/24/2004 (2:07 am)
When game duration ends it calls cycleGame - this then sets up a 0 sec timer to call on CycleExec (so that the process ending the game is divorced from the actual end of game processing).onCycleExec calls the endGame function - this then tells all the clients that the game is over and to display the end of game gui (by executing a GameEnd command to the client).
After $Game::EndGamePause onCyclePauseEnd is called which then finds a new mission file and calls loadMission with it.
LoadMission calls EndMission (which calls onMissionEnded).
This is exactly what your echos are showing.
So, to find out how the end of game GUI is displayed, have a look in server/game.cs function endGame(), and then in client/scripts function clientCmdGameEnd() which does the client side processing. $Game::EndGamePause dictates exactly how long your screen will be displayed for...
If thats not what you were looking for let me know...
#5
Thanks for the help. I've got it working now. As soon as I get it cleaned up I'll post it for others.
01/26/2004 (8:56 am)
Adam:Thanks for the help. I've got it working now. As soon as I get it cleaned up I'll post it for others.
Associate Ron Yacketta
-Ron