Game Development Community

Gui Help

by Freeman182 · in General Discussion · 04/16/2008 (9:27 am) · 2 replies

First of all can I say I know these are noob problems and all comments and help are very much appreciated, im a second year university student studying computergames tech and im having some problems using torque.

Im trying to design the main menu and the in game hud but im having some problems.

* Im trying to introduce a splash screen before the main menu loads up. Iv created a new guiFadeinBitmapCtrl and I save it as filename.gui & filename.gui.dso and everything works fine untill I close torque and re open it and there is no history of me ever having created it. The files are still in the folder but the guiFadeinBitmapCtrl doesn't appear in the drop down menu nor does the splash screen appear when torque is first loaded. I have since tired layering the fade over my main menu however whilst torque does remember its there after the image fades out im left with a black screen and cant access my menu

* Im having trouble getting the main menu to load the game the rest of my team is working on, I cant figure out the command I need to assign to the button on my menu

* Also I have created a simple window that pops up when you click a button on the menu however I cant find a way to close it once it has popped up the x wont work and the OK button I created wont close it either

* Now this problems completely baffled me iv implemented a health bar and I was running round the level my team created and it stopped working and I cant understand why. In the begging it would flash when the character took damage and recharged once he died. Now nothing happens at all and all I have is a static red bar

Again I know these problems are probably just something simple iv missed but I appreciate any time that you take to help me or just point me in the right direction.

#1
04/16/2008 (10:47 am)
I remember spending hours and hours and never could get a splash screen to work right, got it to work right one time, but it never worked again, even after not changing anything. I do know you need to do some scripting other than making the bitmap ctrl. Pretty sure you need to call it in main.cs and then have it load the main menu. I could be horribly wrong as this is just from memory though, and if so, sorry.

Getting the game to load you need to go into your game folder and the main.cs in there, not the one where the engine is, but the actual game folder. When you have the main.cs open search for "loadmymission" and change the file to the mission your team has been making. your button should have the command "loadmymission()".

As far as the window closing, you need to make sure the x is a child of the parent window and add this to your window control file, not the profile but the control code; "closeCommand = "Canvas.popDialog(The name of parent window here);"; " then your command for the x should be closeCommand = "Canvas.popDialog(the name of parent window here);";

sorry but don't remember enough about health bars to help you with your last question.
#2
04/16/2008 (11:22 am)
Have you exec'd the new screen? (often in: client/init.cs, initClient method.)
(It seems likely that you have, as you see the .dso.)

Check how the starter.fps demo does it:
I believe there is a function loadStartup() in the StartupGui. It sets the content of the canvas to the startup screen. It is called by the client/init.cs initClient method.

I have options in my initClient to call loadStartup for the GG/Torque Logo, or a different splash screen, or loadMainmenu().

Make sure there is no syntax error in your screen's script. If the screen isn't loaded properly (executed) it won't show up in the Gui editor screen menu. Check the console.log carefully for errors.

Another trick is to run the batch file to kill all the DSOs. Perhaps your init.cs has an error and isn't being recompiled.