Game Development Community

GUI scripting issues

by Jordan Hirsh · in Torque Game Builder · 06/13/2006 (12:36 pm) · 2 replies

I am having a hard time puting in a start screen for my game. Here is what i have going so far.

Main.cs

exec("~/gui/HUD.gui");
exec("~/gui/startScreen.gui");
.
.
.
.
.
.
.
loadT2DIntro();

gui.cs

function loadFirstLevel()
{
startGame("~/data/levels/level1.t2d");
}

function loadT2DIntro()
{
Canvas.setCursor(DefaultCursor);
loadMainMenu();
}

function loadMainMenu()
{
Canvas.setContent(startScreen.gui);
}

game.cs

function startGame(%level)
{
// Set The GUI.
Canvas.setContent(HUD.gui);


$score = 0;
$power = 1;
currentScore.setText($score);


moveMap.push();
if( isFile( %level ) )
{
sceneWindow2D.loadLevel(%level);
}
}


Obviously this code looks like it should work to me, however when running the game when i hit the "play" button it just removes the current level and shows a blank base level editor. When i hit play again it shows my level1 and tells me "there was a problem saving your level as one did not exist. One has been created for you to work in and you may now save your level properly." with an ok button. I cannot seem to figure out what is going on. If anyone has any ideas I would be very grateful to hear them.


Thank you in advance
Jordan Hirsh

#1
06/13/2006 (1:03 pm)
Apon further inspection it is not rebuilding any of my .dso's. The console log is relatively clear. There is some stuff up at the top that i'm not entirely familiar with.
Initializing chunk mappings...
o 'TEXT' maps to TextChunk
o 'SCHK' maps to UnknownChunk
o 'SCHK' maps to SimChunk
Executing common/main.cs.
Executing tools/main.cs.
--------- Parsing Arguments ---------




Then the loading of my project seems fine
Executing 20XX/main.cs.
Executing 20XX/managed/datablocks.cs.
Executing 20XX/managed/persistent.cs.
Executing 20XX/managed/resources.cs.
Executing common/preferences/bind.cs.
Executing 20XX/gui/mainScreen.gui.
Executing 20XX/gui/HUD.gui.
Executing 20XX/gui/startScreen.gui.
Executing 20XX/gamescripts/gui.cs.
Executing 20XX/gameScripts/game.cs.
Executing 20XX/gameScripts/player.cs.
Executing 20XX/gameScripts/enemy.cs.
Executing 20XX/gameScripts/playerFire.cs.
Executing 20XX/managed/persistent.cs.
Executing 20XX/data/levels/level1.t2d.
Exporting Particle Editor preferences.
Exporting Tile Editor preferences.
Exporting Level Editor preferences.
Exporting Animation Builder preferences.
Exporting Image Editor preferences.
Exporting Gui preferences.
Exporting T2D preferences.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...

I am really at a loss as to what is going on here.
#2
06/13/2006 (3:50 pm)
So I reverted back to a previous version of my project and I am able to edit the game regularly however there are still 0 .dso's in my project. I have not noticed this before, is it normal that the TGB will run without compiling dso's?

I'm using RC2 btw...


Jordan