Getting a mission in the main menu GUI
by Thomas Shaw · in Torque Game Engine · 05/08/2005 (1:32 am) · 12 replies
Hey everyone. My goal is to get a mission to load in the main menu GUI and do a fly-trough of our level in this. It would be the background for our game's main menu, and its something you see very commonly these days.
Anyway, I was trying to use the following resource.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4171
All I did was changed the init.cs file to load the stronghold mission instead of whatever one he had listed. So my code looks like this.
When I try and start the game it comes up with the loading mission dialog (with cancel button) and hangs, never even beginning to load the mission. Does anyone have any idea how to fix this, and how to remove the cancel button?
The other option is using somebody else's script.
Anyway, I was trying to use the following resource.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4171
All I did was changed the init.cs file to load the stronghold mission instead of whatever one he had listed. So my code looks like this.
$mainMenu = false;
function loadMainMenu()
{
// Startup the client with the Main menu...
$mainMenu = true;
createServer("SinglePlayer", "fps/data/missions/stronghold.mis");
%conn = new GameConnection(ServerConnection);
%RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
Canvas.setContent( MainMenuGui );
Canvas.setCursor("DefaultCursor");
}When I try and start the game it comes up with the loading mission dialog (with cancel button) and hangs, never even beginning to load the mission. Does anyone have any idea how to fix this, and how to remove the cancel button?
The other option is using somebody else's script.
#2
-To have the game load and show all the logos
-It will then load a mission (without the "loading mission" dialouge) into the background, and have my main menu GUI usable right on top of the mission while the mission is doing a fly through.
Is there anyone that can help with this? It seems pretty tough.
06/15/2005 (11:19 am)
Another problem with this resource is that it doesn't allow me to have a menu over the mission. Look, here is my ultimate goal:-To have the game load and show all the logos
-It will then load a mission (without the "loading mission" dialouge) into the background, and have my main menu GUI usable right on top of the mission while the mission is doing a fly through.
Is there anyone that can help with this? It seems pretty tough.
#3
What you'll want to do (this is just a rought idea)
have the game load the mission after the splash screens (fine where the loading dialog code is and either change it or just don't have it bring that gui up... then create your own start game gui that you can overlay over the mission flythrough (just make the main control a basic "GuiControl" so its transparent)
06/15/2005 (11:25 am)
No offense, but it sounds like you need to work with Torque and Torquescript a little more... What you'll want to do (this is just a rought idea)
have the game load the mission after the splash screens (fine where the loading dialog code is and either change it or just don't have it bring that gui up... then create your own start game gui that you can overlay over the mission flythrough (just make the main control a basic "GuiControl" so its transparent)
#4
Robert
06/15/2005 (11:26 am)
I would try adding a GuiTSCtrl "behind" the GuiControl of the MainMenu. That should allow you to see the mission. (You will also want to remove the bitmap background then).Robert
#5
06/15/2005 (1:08 pm)
I've done this a while back, but was dissapointed by it, because it would take about 10 seconds to load datablocks, load objects, etc., before the main menu would become available. It just wasn't good for me to have a game's menu to take so long to load. =/
#6
06/15/2005 (1:29 pm)
@Matthew it isn't the Torquescript that is the kicker, I feel fine with a lot of TS, but I haven't done ANYTHING with GUIs other than read the 1.3 Docs on the topic. I guess there is no point in posting on the private forums if people are just going to tell you "It sounds like you need to work with it a little more". Honestly I think this is one of the more complex things I am being asked to do in this project.
#7
Chris, why did you need to load all the datablocks and objects before the menu loaded? Surely you only need execute the cs files with content in the background mission.
Ian
06/15/2005 (2:16 pm)
I've done this, and it works well. The GUI is pretty easy to use actually. Put a TSCtrl like there is in PlayGui.gui as the "parent" of everything, and set it to display the mission as the PlayGui does. To be honest, if this is one of the more complex things you're being asked to do you should be happy, because it really isn't complex at all. Read some .gui files. If you're really having difficulty you could even put your main menu stuff as a child within PlayGui.cs, but I don't really advise that.Chris, why did you need to load all the datablocks and objects before the menu loaded? Surely you only need execute the cs files with content in the background mission.
Ian
#8
06/15/2005 (2:56 pm)
Well it is the most complex of my first iteration work, I don't know what the future holds. Anyway, what else to people suggest? I'll start trying this stuff tomorrow evening.
#9
06/15/2005 (3:52 pm)
Well I scripted it quick.. so I probably overdid it for the menu. I'm satisfied with a bitmap menu, though. :P
#10
It also has the advantage of a much shorter pre-load time.
06/15/2005 (4:06 pm)
Just a quick thought, but if it were me doing this, I would load a level and run a video capture program then save it as an avi and use that as my back drop for my main menu. This has the advantage of giving exactly the look you want w/o having to worry about the players video card being too old (or possibly possesing a bad driver) and display some of the nicer things the engine can do.It also has the advantage of a much shorter pre-load time.
#11
Ian
06/15/2005 (4:16 pm)
It has the disadvantage of being bad quality and not being interactive though.Ian
#12
06/15/2005 (4:22 pm)
Again I didn't mean any offense (why I said that)... and it was meant towards the flow and connection sequence of Torque (that way you can intercept the commands that would load the "Loading" messages. Usually after you work with Torque and the sequences of it for a while you get an idea of how to modify things within it.
Torque Owner Nick Zafiris
Nick