Game Development Community

4+ Gui Menus in a Row (For Comic Style Cinemas)

by Michael "Doodle" Golden · in Torque Game Builder · 08/19/2009 (11:16 pm) · 1 replies

Alright, So I've got my game of three levels pretty much complete. Only problem is, whenever I try to insert my Cinematic transitions inbetween the levels, I can never get past the second or third screen.

For example:

startTitleScreen();
}

function startcinema01()
{
Canvas.popDialog(TitleScreenGui);
stopMusic(TitleMusic, "", true);
Canvas.pushDialog(Cinema01gui);
}

function cinema02()
{
Canvas.popDialog(Cinema01gui);
Canvas.pushDialog(Cinema02gui);
}

function cinema03()
{
Canvas.popDialog(Cinema02gui);
Canvas.pushDialog(Cinema03gui);
}

function startfirstlevel()
{
stopMusic();
Canvas.popDialog(Cinema03gui);
hideCursor();
%level=expandFilename("~/data/levels/level01.t2d");
if( isFile( %level ) || isFile( %level @ ".dso"))
sceneWindow2D.loadLevel(%level);
}

The code starts the main menu out, (After starting the Game), then when you click the START button on the menu, takes you to Cinema01, which when you click on Cinema 01 takes you to Cinema 02. Problem is, when you click on Cinema02 to go to the third and final Cinema... it crashes without giving me a reason in the console.

Any ideas? D:

This is a project that is due tomorrow, but doesn't necessarily NEED the artwork inbetween levels. Although everything WOULD make a lot more sense.

Thanks. :)

#1
08/21/2009 (1:30 pm)
You're experience a crash in the level loader. This is most likely caused by having object dependencies in components (IE: An engine-level component is expecting another object to exist). This crashes now and not other times for you probably because the level is loading the objects in a different order.

This really isn't a fun thing to fix. My recommendation would be to remove the direct object dependencies from the component, and either make the properties you are trying to acquire global fields in variables such as $GameData::MyCharactersSomething that can be checked from the engine, or find another way to do object lookup that does not require a direct object dependency.