Game Development Community

dev|Pro Game Development Curriculum

Mission in main menu GUI

by Frank Bignone · 04/29/2003 (1:19 pm) · 15 comments

Download Code File

Here is a short code sample to display mission inside the main menu gui. This code is based on the torque example and will load the waterworld mission in the main menu gui.

I have not added any camera path in the waterworld mission, but you may add some dynamic camera path (see my previous resources) and have some nice view of your mission in your main menu gui (like in the Orbz game).

To install the code samples, just unzip the archive in your example directory (do not forget to make a backup before).

If you want to change it, look at the loadMenu function in the fps/client/init.cs file.

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
04/28/2003 (10:48 pm)
hm, the link doesnt work yet... :(
guess we'll have to wait til its approved...
#2
04/29/2003 (5:01 am)
yup :) Probably won't be long till approved

Frank, thanks much for coming up with this ressource so fast. For those that don't know, I just asked how to do this a couples of days ago and Frank was not home. So, seeing this, he has done the ressource as soon as he came back home. Your wife will hate me ! :) Can't wait to try this.
#3
04/29/2003 (7:48 am)
@Gilles : as you say i did it quickly : so there is no dynamic camera and the player still spawns. The best way to add it is to make a special mission with a code and disable the player spawning when loading that mission map.

BTW, i no longer have a wife.... but it's in my todo-list ;)
#4
04/29/2003 (9:03 am)
Your camera pathcode is a must with this menu. I already use it hardly for our racing game, so I'm ready :) For the spawn, it will load in observer mode in my case so it's not really a problem if someone has already implemented teams.

Da..n, you've just remembers me to include this big task on my todo-list too !

Task #2793 : "Including a wife in the gameplay"
Estimated time to do : 2 min to 3 years (depend on the model)
Priority : Low

I knew I had forgot something. :)
#5
04/29/2003 (1:49 pm)
hm, ok, now the resource IS approved, but the link still doesnt work... could anybody fix this, plz? :)
#6
04/29/2003 (2:07 pm)
I have corrected it by uploading again the file. It should work.
#7
04/29/2003 (2:08 pm)
link works now apparently
#8
04/29/2003 (4:35 pm)
Works like a charm Frank. Thanks a million !
#9
05/23/2003 (3:54 pm)
Frank,
It doesnt seem to work. It shows me a blank grey screen. The console log shows the following in the end:

*** Mission loaded
fps/client/init.cs (117): Unable to find object: '' attempting to call function 'add'
fps/client/init.cs (118): Unknown command setConnectArgs.
Object ServerConnection(1358) GameConnection -> NetConnection -> SimGroup -> SimSet -> SimObject
fps/client/init.cs (119): Unknown command setJoinPassword.
Object ServerConnection(1358) GameConnection -> NetConnection -> SimGroup -> SimSet -> SimObject
fps/client/init.cs (120): Unknown command connectLocal.
Object ServerConnection(1358) GameConnection -> NetConnection -> SimGroup -> SimSet -> SimObject


I have not made any changes to the script files. Can you please help?

thanks.
#10
04/11/2005 (11:36 am)
*bump*

I've just tried it in v1.3 with the lighting pack, and it works brilliantly. I never knew something like that was possible in just script.

I made a stripped down copy of LoadingGui for when it's loading the background mission, to get rid of the cancel button and make it a bit smaller. It requires changes to client/scripts/missionDownload.cs to use globals in place of LoadingGui, LoadingProgress and LoadingProgressTxt.
Then, in function handleLoadInfoMessage, replacing

Canvas.setContent("LoadingGui");

with something like

if ($mainMenu)
{
Canvas.setContent("MiniLoadingGui");
$loadGui = MiniLoadingGui;
$loadProgress = MiniLoadingProgress;
$loadProgressTxt = MiniLoadingProgressTxt;
}
else
{
Canvas.setContent("LoadingGui");
$loadGui = LoadingGui;
$loadProgress = LoadingProgress;
$loadProgressTxt = LoadingProgressTxt;
}

There might be an easier way to do that though, I'm still relatively new to torque.
#11
05/07/2006 (2:11 am)
This may be slightly old, but it doesn't seem to work 100% these days. Anyone know why I'd get the message:

SimObject::object missing call to SimObject::onRemove

when quitting the game after adding the above?

EDIT: After review, apparently quit(); doesn't clean it up too well. Made a new function called GetLost() that just calls Disconnect() then Quit(). No longer get the problem. Of course this only address that angle of the level clean-up but thats the only issue I had. Edit'ing this in for others.
#12
06/01/2006 (1:01 pm)
Unknown object "wife" attempting to call function "PlayMyGame"
#15
01/05/2008 (10:58 pm)
Just tested this with TGE 1.5.2, works perfectly.
Needed to modify some code though.