Fully 3D Menu
by Quargzon · in Torque 3D Beginner · 07/30/2013 (10:00 pm) · 17 replies
I'm fairly new to Torque 3D, so if the answer to this question is blatantly obvious, please don't blame me too much. XD
How would I go about making a main menu for a game that is a mission? For example, a scene with a 3D hologram hovering in front of the camera. I would like it to be possible to simply click on the 3D objects and have them act like GUI buttons. Somehow, I would need to do away with the main menu GUI, and have it jump straight to loading a mission, which I don't know how to do. I assume the 3D GUI's click detection would involve some kind of ray cast from the camera? I'm not sure how this kind of thing is done in Torque. Thanks!
How would I go about making a main menu for a game that is a mission? For example, a scene with a 3D hologram hovering in front of the camera. I would like it to be possible to simply click on the 3D objects and have them act like GUI buttons. Somehow, I would need to do away with the main menu GUI, and have it jump straight to loading a mission, which I don't know how to do. I assume the 3D GUI's click detection would involve some kind of ray cast from the camera? I'm not sure how this kind of thing is done in Torque. Thanks!
#2
Which, if you happened to try it, you would find that the link is broken. I already found that one.
I need to know how to change the order that things happen when the game starts up. Like, instead of it going "splash -> main menu GUI -> game mission" i need it to go "splash -> menu mission -> game mission". Any ideas?
07/30/2013 (10:37 pm)
Quote:Resource with loading mission in main menu
Which, if you happened to try it, you would find that the link is broken. I already found that one.
I need to know how to change the order that things happen when the game starts up. Like, instead of it going "splash -> main menu GUI -> game mission" i need it to go "splash -> menu mission -> game mission". Any ideas?
#3
www.packtpub.com/torque-3d-game-development-cookbook/book
07/30/2013 (10:43 pm)
Chapter 3 of David Wyands Torque 3D Game Development Cookbook covers just this topic. It's a great book to pickup that has a ton of stuff in it, check it out:www.packtpub.com/torque-3d-game-development-cookbook/book
#4
So, I'd replace the current mainMenuGui.gui with a bare-bones version of playGui.gui and then load your mission in the GameTSCtrl's onWake.
To see how to load/transition levels, look at the documentation under Scripting/Advanced/Mission Triggers.
Tweak and polish.
Hope that gives you some direction and some ideas, and we'd love to hear about your progress!
07/30/2013 (10:56 pm)
Well, for starters you could look at the /art/gui/playGui.gui file - You'll notice that the game display is handled by a gui object: the GameTSCtrl.So, I'd replace the current mainMenuGui.gui with a bare-bones version of playGui.gui and then load your mission in the GameTSCtrl's onWake.
To see how to load/transition levels, look at the documentation under Scripting/Advanced/Mission Triggers.
Tweak and polish.
Hope that gives you some direction and some ideas, and we'd love to hear about your progress!
#5
Oops, that sucks on that link. Someone might have a copy of it somewhere. I see a lot of people come through that don't search at all.
BTW, if you want to change the startup I would suggest picking up a copy of Torsion (if you have not) and use the search facilities to find stuff in the project. It has helped me a ton to find things.
I think you just have to load a GUI with a 3D rendering widget, but the mission loading might actually already take care of that. Of course that mission will need special handling of the action map and a fixed camera. It is too bad that link is dead.
07/30/2013 (10:59 pm)
@Quargzon,Oops, that sucks on that link. Someone might have a copy of it somewhere. I see a lot of people come through that don't search at all.
BTW, if you want to change the startup I would suggest picking up a copy of Torsion (if you have not) and use the search facilities to find stuff in the project. It has helped me a ton to find things.
I think you just have to load a GUI with a 3D rendering widget, but the mission loading might actually already take care of that. Of course that mission will need special handling of the action map and a fixed camera. It is too bad that link is dead.
#6
As for actually clicking on shapes, at the moment you'll have to do a raycast. Have a look at Richard's RTS tutorial, which should have some good info in that regard.
07/30/2013 (11:12 pm)
You might want to have a look at the default template main.cs at line 250. This little block of code automatically loads a mission on the Xbox 360 (don't get excited, it's legacy code). You might want to just get rid of all the ifs and stick in your menu mission.As for actually clicking on shapes, at the moment you'll have to do a raycast. Have a look at Richard's RTS tutorial, which should have some good info in that regard.
#7
...that is all...lol.
07/31/2013 (6:55 am)
...line 273: 'eidtor' is spelled incorrectly. "editor" should be the correct spelling......that is all...lol.
#8
07/31/2013 (8:05 am)
I'm sorry; I should have been more clear about my skill level with Torque. I downloaded it yesterday. I am very well-versed in programming, but I haven't the slightest clue how Torque handles the order that events occur in the game. Looking inside the files, I've found about 6 different init.cs files, and I'm just not sure where to start. Can anyone give me a few pointers?
#9
It should help you get started.
07/31/2013 (10:22 am)
You can take a look at this resource by Steve Acaster www.garagegames.com/community/resources/view/20769It should help you get started.
#10
Holy crap! That is a great guide! That is totally going in the links list.
07/31/2013 (11:59 am)
@Joseph,Holy crap! That is a great guide! That is totally going in the links list.
#11
Well I got out my old hard drive that has a bunch of old Torque resources and attachments. Sadly I don't have the mission on startup ones. I will keep looking though I my old hard drive is not that well organized...
07/31/2013 (12:39 pm)
@Quargzon,Well I got out my old hard drive that has a bunch of old Torque resources and attachments. Sadly I don't have the mission on startup ones. I will keep looking though I my old hard drive is not that well organized...
#12
I did not find the old resource. Hopefully someone that snagged it has it. In the meantime just keep asking questions on this thread. Also keep searching the forums. There is so much stuff in these forums it is hard to sort through. We will help you figure it out as long as you keep trying to learn from the links we give you (except the one I provided...). Yes, this engine is intimidating, but persistence will win the day.
I for one would love to see a new resource for this. So if you need any help with coding just post away. Use
07/31/2013 (3:18 pm)
@Quargzon,I did not find the old resource. Hopefully someone that snagged it has it. In the meantime just keep asking questions on this thread. Also keep searching the forums. There is so much stuff in these forums it is hard to sort through. We will help you figure it out as long as you keep trying to learn from the links we give you (except the one I provided...). Yes, this engine is intimidating, but persistence will win the day.
I for one would love to see a new resource for this. So if you need any help with coding just post away. Use
Quote:"[code][/code]"to post code you are stuck on.
#13
The main.cs file I was talking about sits right next to the executable (in the directory 'My Projects/Project Name/game') and is the main entry point to the engine - it's where everything starts. It's a bit of a confusing file, especially since a lot of the core functionality of the engine is split into the other onStart methods scattered around the scripts.
Other files named init.cs or main.cs aren't anything special; it's just a convention. If you want a thirty-thousand=foot overview of how the engine startup happens, you might like to take a look at my t3d-bones script project; it simplifies the default scripts way down to demonstrate what's at the very core of the loading process.
Once you're familiar with those basics, it should be a bit easier to parse the massive template scripts.
Also, I recommend starting with the Empty template if you can! It has less features, but also less to be confused by.
07/31/2013 (5:17 pm)
Quargzon: sorry, hope we aren't pitching things too far over your head! If you've managed to set up a new project with an executable, we'll be able to help.The main.cs file I was talking about sits right next to the executable (in the directory 'My Projects/Project Name/game') and is the main entry point to the engine - it's where everything starts. It's a bit of a confusing file, especially since a lot of the core functionality of the engine is split into the other onStart methods scattered around the scripts.
Other files named init.cs or main.cs aren't anything special; it's just a convention. If you want a thirty-thousand=foot overview of how the engine startup happens, you might like to take a look at my t3d-bones script project; it simplifies the default scripts way down to demonstrate what's at the very core of the loading process.
Once you're familiar with those basics, it should be a bit easier to parse the massive template scripts.
Also, I recommend starting with the Empty template if you can! It has less features, but also less to be confused by.
#15
I don't want sound like a salesman, but this book might be very useful for you :)
07/31/2013 (6:17 pm)
@Mack is right; Torque 3D Game Development Cookbook, Chapter 3 "Graphical User Interface" at page 112: "Displaying a level at the main menu"Quote:In this recipe, we will take this customization one step further by displaying an actual game level in the background of the main menu to add a level of professionalism to the game.
I don't want sound like a salesman, but this book might be very useful for you :)
#17
08/11/2013 (2:47 pm)
I tried the cook book but it did not work. But it helped me understand what the flow could be, There are other issues with using this like exiting the game to get back to the menu. After I get it done I'm going to post it in the resources.
Torque Owner Demolishun
DemolishunConsulting Rocks!
Resource with loading mission in main menu:
www.garagegames.com/community/resources/view/4171
You most likely will have to figure out how to point and click on objects to trigger events.
I would search for shapebase object click in game event or something similar. Maybe even click in mission on object. I am sure it has been done to some degree.