Game Development Community

Build errors

by Andrew H · in Torque Game Builder · 09/28/2011 (3:57 pm) · 4 replies

I've built a game - it works fine within TGB, but when I build it, it fails whenever an animation ends. According to the console log, it should have worked fine - but it just has an error and quits.

function antivirusTyperClass::onAnimationEnd(%this)
{
   if($currentLevel $= "startUp")
   {
      if (antivirusTyper.getAnimation() $= "antivirusInitialType")
      {
         antivirusTyper.playAnimation("antivirusBlinky");
      }
      
      else if (antivirusTyper.getAnimation() $= "antivirusBlinky")
      {
         goRandomCode();
         exec("game/gui/skipButtonControl.gui");
         Canvas.pushDialog(skipButtonControl);
      }
      
      //This is here I'm getting the faulty reaction
      else if (antivirusTyper.getAnimation() $= "randomCode")
      {
         switchToProfileSelection();
      }
   }
}

//And here's the switchToProfileSelection() function:

function switchToProfileSelection()
{ 
   exec("game/gui/profileSelection.gui");
   Canvas.pushDialog(profileSelection);
   antivirusTyper.BlendColor = "1 1 1 0.000000";
   Canvas.popDialog(skipButtonControl);
   sceneWindow2D.loadLevel("game/data/levels/virusBuster.t2d");
}

#1
09/29/2011 (5:58 pm)
Never mind. I am just going to change the order in which certain things appear - hopefully this will jostle stuff around in such a way this doesn't happen.
#2
09/29/2011 (9:20 pm)
Let us know how that works out, I'm curious as to how this is bugging out.
#3
09/30/2011 (1:35 pm)
loadLevel deletes antivirusTyper it is called from.
#4
09/30/2011 (2:34 pm)
Rpahut - I feared that - that's why I had antivirusTyper merely trigger an external function, thus preventing such an issue.