Game Development Community

Play Game always starts simple.mis

by James Novosel · in Torque 3D Professional · 09/10/2009 (7:22 pm) · 4 replies

I created a new project, added a new level (.mis). The project levels window displays "newMission", "SciFiOne_Buildings" (my new mis) and "simple". No matter which one I select, when I click the Play Game button, the simple.mis is loaded.

Shouldn't this play the level I have selected ?

Noticed that the gamescriptsclientinit.cs is different from the one in the default FPS, specifically it has a loadDefaultMission function that does a

createServer( "SinglePlayer", "levels/simple.mis" );
( if I change this to createServer( "SinglePlayer", "levels/SciFiOne_Buildings.mis" ); it works just fine, but now this is the only one that will load...)

Not sure if this is a bug or not, but I would expect the level I selected to load when I click on Play Game, or do we have to script this behavior ?

If this is expected behavior please disregard.

#1
09/10/2009 (8:16 pm)
The level selector in the ToolBox is for Launching World,Gui Editor the Play Game is a shortcut to the game.exe which launches the game as it will on the end users box.

It may be best to mimic the FPS genre kit, it has a level selector at start up. Maybe Michael Hall can tell you how to put it in the full template but I dont have a clue.
#2
09/10/2009 (8:48 pm)
Truth be told, I don't use the Toolbox so I have no idea ;)

But to get the level selector working in the Template you would basically need to add in the level selector Gui from the FPS kit, along with it's accompanying scripts, and use it instead of the loadDefaultMission() function. You would also have to make the "Start" button on you MainMenu point to the new command to push the new gui.

Or you can wait for the next release and see a nice change in the Template that will give you the level selector as part of the 'core' scripts.
#3
09/10/2009 (8:56 pm)
Ok, just tested the Toolbox and trying to load a level from the FPS Kit -- that will only take you to your selected level in the Editor, otherwise it simply starts the game and takes you to the MainMenu. So yeah, that's probably the expected behavior that you're seeing in the Template.
#4
09/10/2009 (10:27 pm)
I was expecting the same behavior from my new project as is exhibited by the samples - I get prompted for which level to play.

The mainMenuGui.gui's play button is:
Command = "onSinglePlayer();";
in my new project.

Changing this to:
Command = "Canvas.pushDialog(ChooseLevelDlg);";
as is in the FPS Genre Kit produces the expected behavior.

I'm guessing I need to change the mainMenuGui.gui in the templates directory so that new projects all do this.

(Shouldn't the template be setup this way?)

Thanks, considering this closed.