Game Development Community

dev|Pro Game Development Curriculum

Mission in main menu GUI 1.4

by Thanhda Tie · 07/03/2006 (11:18 am) · 16 comments

Download Code File

This is just a mod from the original Resource Mission in main menu GUI by Frank Bignone, but has been ported from Torque 1.3 to 1.4 users.

------------------------------------------

Original Resource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4171

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.

----------------------------------------------
DRL 2.0 Add on
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10232

If you want to get this to work with DRL 2.0, you are going to need to modify the following file
client\scripts\serverConnection.cs

//----------------------------------------------------------------------------
// GameConnection client callbacks
//----------------------------------------------------------------------------

function callItUpLOL()
{
   Canvas.setContent(MainMenuGui);
   resetDRL();
}
function fixTheDamnDRL()
{
   resetDRL();
}
function GameConnection::initialControlSet(%this)
{
   echo ("*** Initial Control Object");   
   // The first control object has been set by the server   
   // and we are now ready to go.      
   // first check if the editor is active   

   if (!Editor::checkActiveLoadDone())
   {
      if( $mainMenu )
      {
         Canvas.setContent(PlayGui);
         PlayGui.noCursor = "0";
         schedule(100,0,callItUpLOL);
         schedule(200,0,fixTheDamnDRL);
         resetDRL();
      }
      else if (Canvas.getContent() != PlayGui.getId())
      {
         Canvas.setContent(PlayGui);
         resetDRL();
      }
   }
}

In client/scripts/playGui.cs, add the following to the PlayGui::onWake method:

if($mainMenu == true)
   {
      PlayGui.noCursor = "0";
   }
   else
   {
      PlayGui.noCursor = "1";
   }

This update thanks go to C2, for help with syntax code.

#1
06/09/2006 (10:19 am)
Cool. Thanks for doing this.
#3
07/09/2006 (8:27 pm)
Works pretty good!
#4
07/20/2006 (10:21 am)
Great resource. Worked with first attempt!
#5
07/22/2006 (5:20 pm)
ABOUT -> Code File: missiongui_1.4.rar

Could you please pass a zip file my way.
Thanks Jesse.
#6
07/22/2006 (5:28 pm)
@Carpenter Software
Download winrar.
www.rarlab.com/
#7
08/07/2006 (5:23 pm)
Cool resource. It works great with TGE.

M. Varela thx :)
#8
08/20/2006 (3:03 am)
Good resource.
#9
12/10/2006 (9:45 pm)
I have a problem. Why is it when I move the loadMenu() command from init.cs to the startup.gui function that used to call for the mainmenu.gui that I get a crash every time I try to load a mission?

If I switch it back, it all works.
#10
03/05/2007 (1:32 am)
Hi everyone,
Just wanted to let you know that this resource works great with the 1.5 FPS Starter kit. I do, however, have a problem with the main menu showing in my project. It just loads the mission file with out the GUI. Any ideas?

Thanks!
#11
03/05/2007 (8:35 am)
Got it, sorry every... bone head mistake! :o)
Thanks anyways,
JP
#12
03/29/2007 (4:49 am)
Hi All,

Has anyone sen this working in TGEA?

I've tried this out of the box, and I just get 'another copy of Torque is already running' message and it crashes. It could of course be something I've done though...

Any thoughts, I'd love to get it in, it's a great way to spice up our GUI!
#13
03/29/2007 (7:10 am)
No, i havnt really tried. i dont use TGEA that much, try posting on the forums in the TGEA forum, maybe someone there would know how to port it
#14
03/29/2007 (7:13 am)
Okay, will do. I'll give it a go...
#15
06/27/2007 (2:19 pm)
I am trying to use this and I am getting errors when I am trying to connect to a new game I think because the game in the main menu is not actually being disconnected or ended... I tried to put in some code in the gui buttons I have to disconnect the mission in the main menu by calling disconnect() or endgame() in my functions for the buttons but it does not seem to be working, I am still getting an eror when trying to load a new mission. Any one have any idea how to fix this bug?
#16
11/19/2007 (5:26 am)
@ Harvey Greensall: still getting error or have you got successfull?
Bye :)