Game Development Community

Error in whackamole tutorial - section 2

by Jim Evans · in Torque Game Builder · 12/02/2006 (4:59 am) · 2 replies

Theres an error in the whackamole tutorial proveded with the installer, in the second pdf, Respawning the Mole,
in code sample 2.6 at the bottom, the pdf has:

function mole::onAnimationEnd(%this)
{
if( %this.getAnimationName() [b]!$=[/b] ("[b]animMoleComeOut[/b]" @ %this.moleColor) )
{
// after deleting the old mole schedule a respawn
// >%this.sceneGraph< is the level
%this.sceneGraph.schedule( 1500, "spawnMole");
%this.safeDelete();
}
}
Code Sample 2.6

In the code listing .txt it has

function mole::onAnimationEnd(%this)
{
   if( %this.getAnimationName() [b]$=[/b] ("[b]animMoleWhacked[/b]" @ %this.moleColor) )
   {
      // after deleting the old mole schedule a respawn
      // >%this.sceneGraph< is the level
      %this.sceneGraph.schedule( 1500, "spawnMole");
      %this.safeDelete();
   }
}

in the if statement it has !$= rather then the $=

also, the pdf one checks if the animation is called animMoleComeOut, whereas the txt checks if it is animMoleWhacked.

(and then on top of that I made a typo where I typed spwan instead of spawned, but those two variances provide a little bit of nussiance as well...


EDIT: well after fixing my typo, it appears both methods work, I'm wondering why 2 different versions were included though.

#1
12/02/2006 (9:35 am)
Nice that it worked - and you do know that 1.1.3 is out, right? It'll be in your account ;)

The docs are much nicer now.
#2
12/02/2006 (3:02 pm)
Hmm, I just downloaded this one recently, so I assumed it was up to date, thanks for the info.

TGB is really moving along, it definetly has already come along way from where I last saw it (it had no level builder that I know of, it was the tile map editor), I didn't look into it too much then, but now it is a really great set of tools... I'll have to get 1.1.3 now and check that out.