Whack-A-Mole code sample bug
by Gary Preston · in Torque Game Builder · 11/01/2006 (2:46 pm) · 1 replies
As noted in this thread www.garagegames.com/mg/forums/result.thread.php?qt=53019 and in www.garagegames.com/mg/forums/result.thread.php?qt=53175 the code sample "2 - Whack-A-Mole Tutorial - Respawning the mole.txt" has
When it really should be
As correctly shown in the code in the pdf tutorial.
Otherwise the config datablocks are not loaded when the level editor loads, they're only loaded upon running the mission which can cause them to be lost if you make any changes and save before running the mission. Minor bug, but since it's caused confusion for two people, thought I'd bring attention to it here.
----------------- Part 2 -----------------
Code Sample 2.1
"
function startGame(%level)
{
//exec game scripts
exec("./mole.cs");
exec("./respawnPoint.cs");
// Set The GUI.
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);
moveMap.push();
// this has been added:
sceneWindow2D.setUseObjectMouseEvents( true );
if( isFile( %level ) || isFile( %level @ ".dso"))
sceneWindow2D.loadLevel(%level);
}
"When it really should be
----------------- Part 2 -----------------
Code Sample 2.1
"
[b]exec("./respawnPoint.cs");[/b]
function startGame(%level)
{
//exec game scripts
exec("./mole.cs");
// Set The GUI.
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);
moveMap.push();
// this has been added:
sceneWindow2D.setUseObjectMouseEvents( true );
if( isFile( %level ) || isFile( %level @ ".dso"))
sceneWindow2D.loadLevel(%level);
}
"As correctly shown in the code in the pdf tutorial.
Otherwise the config datablocks are not loaded when the level editor loads, they're only loaded upon running the mission which can cause them to be lost if you make any changes and save before running the mission. Minor bug, but since it's caused confusion for two people, thought I'd bring attention to it here.
hamed