Game Development Community

RC1: Animation builder - play time wrong

by Jason McIntosh · in Torque Game Builder · 06/01/2006 (3:34 pm) · 3 replies

I used the animation builder for the first time and set the Total Play Time to 0.5 (half a second, right?) with 4 frames from one of the example image maps.

But the play time incorrectly "snapped" to 0.1 instead, and anything under 1 seems to snap to 0.1, whether it's 0.2, 0.5, 0.9 or whatever. Any value over 1.0 behaves as it should.

#1
06/01/2006 (11:16 pm)
To fix this go into your "TorqueGameBuilder\games\tools\animationEditor\scripts\" directory... and open the ABGuiScripts.ed.cs and change out this function

function AnimationBuilder::enforceNumberFormat(%num)
{
   %firstChar = getSubStr(%num, 0, 1);
   
   if(%firstChar $= ".")
   {
      %num = "0" @ firstCharm;      
   } else if(%firstChar == 0)
   {
      %num = 0.1;
   }
   
   return %num;
}

with this function

function AnimationBuilder::enforceNumberFormat(%num)
{
   %firstChar = getSubStr(%num, 0, 1);
   
   if(%firstChar $= ".")
   {
      %num = "0" @ firstCharm;      
   } else if(%num == 0)
   {
      %num = 0.1;
   }
   
   return %num;
}

Seems I was having it compare the first character to 0 to revert it to 0.1 (since animations go wonky at 0 time)... i nstead I should've been comparing the whole num :)
#2
06/02/2006 (5:33 am)
Thanks for the fix, Matthew.
#3
06/10/2006 (6:15 pm)
This is still happening in RC2 for me. Changing the "else if" from firstChar to %num does fix it though.
Thanks!
-Andrew