Game Development Community

Bug in getWord both 1.3 and 1.4 TGE?

by Frank Carney · in Torque Game Engine · 01/20/2007 (10:26 pm) · 1 replies

$bug::check::loc[0] ="-1 -1  0";
$bug::check::loc[1] = "0 -1  0";
$bug::check::loc[2] = "1 -1  0";
$bug::check::loc[3] ="-1  0  0";
$bug::check::loc[4] = "1  0  0";
$bug::check::loc[5] ="-1  1  0";
$bug::check::loc[6] = "0  1  0";
$bug::check::loc[7] = "1  1  0";

// show getWord bug
function bug::getWord()
{
   for(%count = 0; %count < 8; %count++)
   {           
      %pos = $bug::check::loc[%count];
      %posAfter = "1[" SPC getWord(%pos,0) SPC "]" SPC 
                  "2[" SPC getWord(%pos,1) SPC "]" SPC
                  "3[" SPC getWord(%pos,2) SPC "]";
      echo("before:"SPC %pos SPC "after:" SPC %posAfter);
   }
}

This code spits out the wrong output. It seems to lose data and it is not consistent about which one it loses. It even switches positions of the data. You will have to run it to understand what I am talking about. Either there is something really wrong with getWord or I am using it wrong.

Thanks,
Frank Carney

About the author

I Started programming in HS and have never stopped. Now an 18 year vet of programming anything from assembler on a NES console to a nuclear waste processing system. If it can be programmed I may have tried to program it!


#1
01/20/2007 (10:45 pm)
Another one of those damn whitespace issues! Do NOT put more than 1 space in the data like I did above. GetWord apparently does not like multiple whitespaces between values!

Here is a way to make it pretty but gets rid of the whitespace issues:
$clife::check::loc[0] ="-1" SPC "-1" SPC "0";
$clife::check::loc[1] = "0" SPC "-1" SPC "0";
$clife::check::loc[2] = "1" SPC "-1" SPC "0";
$clife::check::loc[3] ="-1" SPC  "0" SPC "0";
$clife::check::loc[4] = "1" SPC  "0" SPC "0";
$clife::check::loc[5] ="-1" SPC  "1" SPC "0";
$clife::check::loc[6] = "0" SPC  "1" SPC "0";
$clife::check::loc[7] = "1" SPC  "1" SPC "0";