Game Development Community

Making a game

by Josh Klev · in Torque Game Engine · 09/26/2007 (2:18 am) · 5 replies

I have made a small game the one in the getting started tutorial that comes with TGE but now ive made a world and i made it into the demo thing... i made it so i could open it with pressing f11 at the game i made in tutorial base but how do i make it load that game instead of the one i made when following the tut?

#1
09/26/2007 (9:53 am)
I don't remember what script file it's in (I want to say main.cs, the root one) you should find a function called loadMyMission and it's point to the mission file, just change it. This is assuming of course you have this function mapped to a button.
#2
09/26/2007 (10:56 pm)
. . . i havent done anything extra where do i get this...FUNCTION
#3
09/28/2007 (4:05 pm)
@Steve
Indeed, the loadMyMission function is at the bottom of the main.cs inside tutorial.base.

@Josh
The tutorial has all the info for creating a button that starts your mission. At the bottom of main.cs is this function:
function loadMyMission()
{
. . . . . . . . . . . . . . . . . . . .
   // make sure we are not connected to a server already
   disconnect();
   
   // Create the server and load the mission
   createServer("SinglePlayer", expandFilename("./data/missions/gameonemission.mis"));

   // Make a local connection
   %conn = new GameConnection(ServerConnection);

. . . . . . . . . . . . . . . . . . . .
}
When called, this function loads "gameonemission.mis". You can change this if you like.
#4
06/16/2008 (8:02 pm)
I would like to know the function that loads a specific level as opposed to loading the one specified for loadMyMIssion...
#5
06/17/2008 (8:49 am)
Benjamin - You could have answered this yourself having found this thread, as you can see in the above example you found the createServer() command passes in the mission name, search through your project and read through that createServer() function and you'll see it calls a function called loadMission()

Now there's a good name for a function that loads missions ;)

A lot of functions in TGE have useful names like that, so a few mins of digging with a search of your code can probably answer a lot of questions like this.