Game Development Community

GUI "loadMyMission" problems

by William Shellman · in Game Design and Creative Issues · 03/18/2008 (4:23 am) · 7 replies

I have recently been dipping into the GUI creation tutorials, and began to attempt to make a new background image for the Start Screen. I have placed the Start Button, the Score Counter, and added all the instructed code to the proper files (although I may have missed or misspelled something). My buttons and the background are fine, but the "Start" button will not load the game. I rechecked my spellings and locations of text, checked the button configurations, and the game still won't open. I was wondering, is the problem perhaps that I need to re-compile the engine in order to incorporate the changes? Any help here would be greatly appreciated.

#1
03/18/2008 (5:30 am)
Did you save you game as "gameonemission.mis"?
#2
03/18/2008 (9:47 am)
If you made source code changes, then yes you would have to re-compile the engine. When working with script you would have to delete the existing .dso files and allow the script files to re-compile at run-time.

It's always good to check and double-check spelling and syntax. If you are not getting any obvious error messages then make sure your button's command calls the correct function. Make sure that function tries to load the correct mission file.
#3
03/18/2008 (1:38 pm)
In response to Caleb, no, I did not save the mission as "gameone". It has a "personal" name that I do not wish to release at this time, but I did not save the mission as "gameone". At any rate, then it is the name of the "tutorial.base copy that I created as my mission that needs to be in the script changes? I do have the folder (directory) labeled as "GameOne", however. So, is it the directory name, or the actual TorqueDemo file "-------.mis" name that needs to be scripted? If further explanation is needed, I will respond to it promptly. Thanks for your help, Caleb! Now, on to Michael! I thought that might have been the problem, but I wanted to make sure before re-compiling the engine. I would like to co-ordinate all my resources for the game and prep them before re-compiling. I want it to be done in one swift stroke, all animations, dialog, scripting, the whole ball of wax! I know, I know! Just plain crazy, huh? I am not even close to accomplishing that, but until I'm ready to actually activate my game, I would rather not jumble around the engine too much. I realize that quite possibly, none of the scripting, animations, or audio and such are possible unless the engine is re-compiled to accomodate them, but I thought I'd check things thoroughly beforehand. But, if the only way to get things moving along is to re-compile, then the choice is clear. I will have to! I want to thank you for the information,
And thanks to everyone else who responded.
#4
04/08/2008 (11:25 pm)
Well i am in almost the same boat .. the start button does not work When i hit the start button i get an message waiting for server .. or loading mission which never loads...
#5
04/08/2008 (11:39 pm)
Ok i kinda sorta figard it out You needs have the saved game gameonemission.mis or change the code in you "gameone" folder the main. cs in that folder has a line under the heading LOAD MY MISSION

createServer("SinglePlayer", expandFilename("./data/missions/gameonemission.mis"));

did not make a gameonemission.mis .........

so change the line to
createServer("SinglePlayer", expandFilename("./data/missions/flat.mis"));

and it will work ... always remeber to follow the Whole tutorial then it will work ... but if your like me lol you wil need to learn how to read code quickly to fix problems that arise......
#6
04/19/2008 (6:33 am)
Thanks, Everyone! So let me see if I've got it right! First of all, I have to have my game saved as "GameOne.mis", or, "gameone.mis"? Do the capital letters matter, because I have my game saved as "GameOne.mis"? Second, if I have a main.cs named "GameOne".cs, or, "gameone.cs", in my Gameone folder, I need to look for LOADMYMISSION and change the line to what is specified in your post?
I have studied the instructions for the project I am working on, and I followed exactly what it said, but I do have a problem with my compiler program. I am using Visual Studio C++ 2005 Express Edition, but for some reason, my system registers as having Visual Studio 2008 as well. When I reboot my system or start up, I receive the error message:

Your SQL Server installation is either corrupt or has been tampered with
(Unable to load SQLBOOT.DLL (HRESULT 0x80070005)).
Please uninstall then re-run setup to correct this problem.

I had a very bad experience the first time I re-compiled my engine, and Visual Studio crashed and burned!!! I ended up having to start from scratch and everything was fine until I attempted to save the Visual Studio Files onto a disc. apparently, I moved the file somehow and now it is corrupt. I did not try to cut or paste it onto a disc, I only tried to copy the files to the disc. I am very weary of trying to uninstall SQL Server because of the terrible catastrophy I recently dealt with. I was wondering if you or anyone else out there has had this type of problem with Visual Studio, and if there is anyone who can help me out with this crazy thing! Can SQL Server be uninstalled without uninstalling other Visual Studio components? Or is it manditory that you remove the entire Visual Studio, then re-install it? I realize that in order to remove Visual Studio, you must follow a series of steps in order, thus the reason for the question of removing the Server only, or the entire thing. I hope that I will only need to focus on the SQL Server because the rest of the program is fine. But I'm sure that the SQL Server has to be functioning correctly as well in order to re-compile the engine. I will wait for your response before I continue any further. Thanks for all your help!!!
#7
04/19/2008 (10:36 am)
The tutorial.base is a generic game example used for learning purposes. It's where many people will get their feet wet.

Open the C:\Torque\TGE_1_5_2\example Directory.
Copy tutorial.base Folder.
Paste the copied tutorial.base Folder in C:\Torque\TGE_1_5_2\example Directory
Rename the Folder from copy_of_tutorial.base to GameOne.

Now you have a copy of the tutorial.base folder that is renamed and still inside the example folder.
The tutorial assumes you haven't moved the folder to some other drive or other directory to avoid confuson.
The Tutorial directs you to name the Folder as GameOne for simplicity of the tutorial but you are free to rename it anything you like so long as when you read GameOne in the tutorial then you know it is referring to your new project Folder.
The Copy / Paste is done to preserve the original folder, just incase you goof, go astray, or otherwise mess up.

Hint: tutorial.base is full of TorqueScript files not to be confused with TorqueDemo game engine written in C++ and compiled with Microsoft Visual compiler.
The TorqueScript files are what the tutorial is having you change and learn from.
TorqueScript files all have a .cs extension.
TorqueScript files that are compiled by the TGE engine all have a .dso extension.

When you reach the point in the tutorial labeled: Graphic User Interface you need to pay closer attention so taking a break and getting a snack might be useful before diving into this section of game making for the very first time. When your break is over clear your head of anything and pretend your unwrapping a present.
( Thats to say Forget any assumptions you thought you knew and start fresh ).

In the section of the Tutorial immediately after you change the background image is where you'll add yur Start button.

GuiButtonCtrl ~ a TGE engine function that makes a button. This function is reached through TorqueScript for changing properties and actions.
You'll change the GuiButtonCtrl text field to " Start " so you have an obvious clue what that button will do when your done working with it.
The tutorial points you to the Parent section and tells you what you type: loadMyMission(); and then hit apply.

Here is why the tutorial told you to type loadMyMission();

In your new Project folder named GameOne, or named BlueFluffyClouds or whatever you named your new Folder, there are TorqueScript files and by order of hierarchy that function name you just typed in is going to be called when you click that newly made button.

Hint: If you mistype the text your told to type in, your game won't start because TGE game engine is written in C++ which demands that everything is case sensitive so LoadMyMission(); and loadMyMission(); may read the same, but they are distinctly different to the engine because of the Uppercase and lowercase spellings.

TorqueDemo calls main.cs which in turn calls your project folders main.cs and this trick was a bit confusing to me at first because there was 2 main.cs files.
TorqueDemo calls main.cs from the same directory it is in, First.
This main.cs file is a TorqueScript file that operates and manipulates your game setup before your games code is even started.
Once main.cs is completed your project directory is entered into. Your main.cs file is located and processed.
Near the end of your Project directories main.cs file is the actual TorqueScript function named loadMyMission(); notice that is is spelled exactly as you were told to enter it in the Tutorial.
And thats how your Start Button is brought to life.

The tutorial could have been better written but thats what you get when a Code writer is making a tutorial, you get the facts but much is assumed along way such as Your familiar with what a Project is, what window they mean when they say command section, and under Misc section, and the like. This is how we tend to get frustrated because without pictures, we have just words and are left to seek it out our selves.
Best tutorials are from real Teachers that are not just well versed but also able to explain the subject in several ways so the entire audience isn't left scratching their head and raising eyebrows.

As a last note, I had the same issue with the tutorial the first time through. Only difference was my start button grew to the size of my Game window and didn't work, or I was stuck in the Loading screen.
It all didn't come together and make sense to me until I spent many hours poking around in Directories looking for anything that made some sort of sense and would help me to relate to the tutorial.