Game Development Community

MessageBoxYesNo - How can I modify?

by Samarie · in Torque Game Engine · 06/25/2009 (2:00 pm) · 1 replies

Does anyone know how to modify the pop up message box from the "Getting Started Tutorial". When the player collects all of the torque objects at the end of the game. The message box pops up and ask "would you like to restart the game"?
"Yes" or "No".

I just want to replace the "loadMyMission" and "quit()" with a link to my mission files. How can I do
this? I'm new to torque. Thanks.

I would like my message box to say "Would you like to go North or South?"
When the player clicks on "North" it takes them to "north.mis". If they click "South", it takes them to "south.mis".

Here's the original "yes or no" code from the "Getting Started Tutorial"

function clientCmdSetScoreCounter(%score)
{
ScoreCounter.setText("Score:" SPC%score);
}

function clientCmdShowVictory(%score)
{
MessageBoxYesNo("You Win!,
"Would you like to restart the game ?",
"loadMyMission();",
"quit();";
}

About the author

I'm an undergraduate student studying game and simulation programming at a university.


#1
06/26/2009 (9:41 pm)
Modify the loadMyMission() function (I think it's in "tutorial.base/main.cs") to accept a parameter in it's create server command (ie. use a variable instead of a hardcoded path/name). This parameter would be your mission filename. You would then need to somehow determine what the "next" mission to load would be when you've completed the current mission and pass that filename (and path) as a parameter of loadMyMission()