Game Development Community

Building the project

by Jemand den es nicht gibt · in Torque Game Builder · 05/16/2006 (9:14 am) · 2 replies

Hey!

Today I tried out the package utility for the first time... great tool! It picked out all the files I needed and moved them to an extra directory but when I run it my level isn't shown and startGame("...") doesn't help there either. Now... is that a bug or am i doing something wrong? :)

#1
05/16/2006 (9:24 am)
There is a logical error in the standard startGame() function which looks like this:
function startGame(%level)
{
   // Set The GUI.
   Canvas.setContent(mainScreenGui);
   Canvas.setCursor(DefaultCursor);

   moveMap.push();

   if( isFile( %level ) )
      sceneWindow2D.loadLevel(%level);
}

But it should rather look like this:
function startGame(%level)
{
   // Set The GUI.
   Canvas.setContent(mainScreenGui);
   Canvas.setCursor(DefaultCursor);

   moveMap.push();

   [b]if( isFile( %level )  || isFile( %level @ ".dso") )[/b]
      sceneWindow2D.loadLevel(%level);
}

Otherwise the level won't load as only the compiled file is delivered in the packaged build.
#2
05/16/2006 (9:29 am)
Doh! Thanks! ... I was blind not to see that one.