Running with $runWithEditors = false?
by Jaime Wojick · in Torque Game Builder · 02/16/2006 (10:54 am) · 10 replies
Could someone point me in the right direction to read about this?
With $runWithEditors set to true I am able to run my game, but with $runWithEditors set to false all I get is the default black T2D logo.
I have $defaultGame set to the name of my test folder. Is there something else I am neglecting to do?
Thanks
Jaime
With $runWithEditors set to true I am able to run my game, but with $runWithEditors set to false all I get is the default black T2D logo.
I have $defaultGame set to the name of my test folder. Is there something else I am neglecting to do?
Thanks
Jaime
#2
02/16/2006 (11:21 am)
Run game works from the editor, but you don't have that menu when running without the editor.
#3
Therefore, I thought that Launch -> Run Game is the same as when T2D loads up without the editors, it goes straight to the game, and the toggleLevelEditor(); in T2D/main.cs (Where T2D is your game folder, and if you still have the same functions in main.cs) doesn't work with the editors set to off.
Are you sure you haven't got an error in any of your scripts, like main.cs where you define if the game runs with editors or where you define the defaultGame?
02/16/2006 (12:37 pm)
My understanding is that Launch -> Run Game ran the game that was in the $defaultGame variable.Therefore, I thought that Launch -> Run Game is the same as when T2D loads up without the editors, it goes straight to the game, and the toggleLevelEditor(); in T2D/main.cs (Where T2D is your game folder, and if you still have the same functions in main.cs) doesn't work with the editors set to off.
Are you sure you haven't got an error in any of your scripts, like main.cs where you define if the game runs with editors or where you define the defaultGame?
#4
--------- Initializing MOD: T2D ---------
Loading compiled script tutorial/data/content/sampleDatablocks.cs.
Loading compiled script tutorial/gameScripts/game.cs.
Loading compiled script tutorial/gameScripts/initializeT2D.cs.
Loading compiled script tutorial/data/content/datablocks.cs.
Loading compiled script tutorial/gui/mainScreen.gui.
tutorial/main.cs (37): Unable to find function toggleLevelEditor
T2D Engine (v1.1.0 [Beta#1.1]) initialized...
Exporting keybindings.
Exporting T2D preferences.
I noticed in the sample programs (fish, spacescroller, etc) that the package was named differently (T2D_SPACESCROLLER for example).
I am probably just missing some very basic concept of how to set up a project from scratch...
02/16/2006 (3:07 pm)
Hmmm...this is what the log is reporting when I run without the editor--------- Initializing MOD: T2D ---------
Loading compiled script tutorial/data/content/sampleDatablocks.cs.
Loading compiled script tutorial/gameScripts/game.cs.
Loading compiled script tutorial/gameScripts/initializeT2D.cs.
Loading compiled script tutorial/data/content/datablocks.cs.
Loading compiled script tutorial/gui/mainScreen.gui.
tutorial/main.cs (37): Unable to find function toggleLevelEditor
T2D Engine (v1.1.0 [Beta#1.1]) initialized...
Exporting keybindings.
Exporting T2D preferences.
I noticed in the sample programs (fish, spacescroller, etc) that the package was named differently (T2D_SPACESCROLLER for example).
I am probably just missing some very basic concept of how to set up a project from scratch...
#5
I was able to get a new project working with the splash screen stuff. It worked with and without the editors, but haven't been able to kick off the setupT2DScene() from the end of the second splash screen.
02/16/2006 (9:08 pm)
Making a bit of progress...I was able to get a new project working with the splash screen stuff. It worked with and without the editors, but haven't been able to kick off the setupT2DScene() from the end of the second splash screen.
#6
It can't find the function to toggle the LevelEditor to open when it starts, as the editors are set to not run, so instead of running the editors, it just loads the game that you have set it too.
If you wanted to run with editors on, but you didn't want the LevelEditor to load up and display it's self instead of displaying your game, then you would comment or remove that line.
02/17/2006 (1:27 am)
Quote:tutorial/main.cs (37): Unable to find function toggleLevelEditor
It can't find the function to toggle the LevelEditor to open when it starts, as the editors are set to not run, so instead of running the editors, it just loads the game that you have set it too.
If you wanted to run with editors on, but you didn't want the LevelEditor to load up and display it's self instead of displaying your game, then you would comment or remove that line.
#7
tdn.garagegames.com/wiki/Torque_2D/Getting_Started/T2DBasicStartUpTutorial
Anyway, you are on the right track in wanting to call setupT2DScene because that is what the Run Game command calls. You also need to make sure mainScreenGui is being loaded with a Canvas.setContent(mainScreenGui); Basically, mainScreenGui contains your sceneWindow2D which you need to display your scenegraph.
02/17/2006 (8:33 am)
Hmm, I suppose I should expand on the startup tutorial on TDN to cover stuff like this. You can see what is there so far here:tdn.garagegames.com/wiki/Torque_2D/Getting_Started/T2DBasicStartUpTutorial
Anyway, you are on the right track in wanting to call setupT2DScene because that is what the Run Game command calls. You also need to make sure mainScreenGui is being loaded with a Canvas.setContent(mainScreenGui); Basically, mainScreenGui contains your sceneWindow2D which you need to display your scenegraph.
#8
Thanks for the info.
02/17/2006 (10:12 am)
Ah, excellent! I'll give that a shot. So far it seems setting up the project is the most difficult part, everything else has been pretty easy to wrap my head around.Thanks for the info.
#9
Canvas.setContent (mainScreenGui) was getting called during initializeGame(), but that function was called before the function to load the splash screens.
I added a function that called Canvas.setContent(mainScreenGui) and setupT2DScene() after the final splash completed and everything works great.
I was even able to use the Packing Util to build a release version of it.
Thanks again everyone who put in their $0.02
02/18/2006 (2:17 pm)
That worked, thanks a lot.Canvas.setContent (mainScreenGui) was getting called during initializeGame(), but that function was called before the function to load the splash screens.
I added a function that called Canvas.setContent(mainScreenGui) and setupT2DScene() after the final splash completed and everything works great.
I was even able to use the Packing Util to build a release version of it.
Thanks again everyone who put in their $0.02
#10
03/06/2006 (4:52 pm)
Oh great. This has been a painful questionmark to straighten out. I do, as a new user, recommend you add it to one of the basic tutorials since I really felt I missed that part after doing several of them.
Torque Owner Chris Labombard
Premium Preferred