TorqueScript what the forget are you doing.
I removed the comment after break; and suddenly bottom print is displayed:
function brickDetector_OFF_Image::onFire(%this, %obj, %slot)
{
%obj.schedule(0,"playThread",2,shiftRight);
%obj.schedule(200,"playThread",1,armReadyRight);
%obj.unMountImage(0);
%obj.mountimage(brickDetector_ON_Image, 0);
%client=%obj.client; //%client refers to the client of the object that triggered this state
%name="_asd";
%radius=32; //32 Torque Units = 64 Studs
//Initialize container search
initContainerRadiusSearch(%pos, %radius, $TypeMasks::FxBrickObjectType);
while (isObject(%obj = containerSearchNext()))
{
if (%obj.getName() $= %name)
{
commandToClient(%client,'bottomPrint',"<color:ffffff>Detecting: " @ %name @ " | Distance: " @ (vectorDist(%pos, %obj.getPosition)*2) @ " Bricks");
break;
}
}
}
Then I remove another comment and the bottom print does not display:
function brickDetector_OFF_Image::onFire(%this, %obj, %slot)
{
%obj.schedule(0,"playThread",2,shiftRight);
%obj.schedule(200,"playThread",1,armReadyRight);
%obj.unMountImage(0);
%obj.mountimage(brickDetector_ON_Image, 0);
%client=%obj.client; //%client refers to the client of the object that triggered this state
%name="_asd";
%radius=32; //32 Torque Units = 64 Studs
initContainerRadiusSearch(%pos, %radius, $TypeMasks::FxBrickObjectType);
while (isObject(%obj = containerSearchNext()))
{
if (%obj.getName() $= %name)
{
commandToClient(%client,'bottomPrint',"<color:ffffff>Detecting: " @ %name @ " | Distance: " @ (vectorDist(%pos, %obj.getPosition)*2) @ " Bricks");
break;
}
}
}
I removed a god damn comment. Why does that break the damn script.
The distance is still broken. It displays 0 at all times so I have no idea if the looping actually works.