Game Development Community

Problem compiling Torquescript in sample

by Michael Burge · in Torque Game Engine · 12/24/2008 (4:57 am) · 0 replies

Hello,

I've just gotten Torque, and I've been trying to wrap my head around it; but I'm getting several errors when Torque compiles the script for the sample FPS/Racer demo. Even more, I'm not sure if it's an issue with Torsion or with Torque:

In Torsion, if I set up a project in the sample directory and try to run it, everything seems to compile and work except for these 2 lines:

creator/ui/lightEditor.gui (2140): string always evaluates to 0.
creator/ui/lightEditor.gui (2157): string always evaluates to 0

These correspond to the 2 'if' statements below:

function sgLightDBList::onSelect(%this, %id, %text)
{
   if(sgLightEditor.activePanel != sgLightEditorLightEditorPanel)
   {
      error("sgLightDBList::onSelect> Error Light Editor panel not set.");
	  return;
   }
   
   sgLightEditor.activePanel.currentDBName = sgLightDBList.getText();  
   //commandToServer('sgGetLightDBId', sgLightEditor.activePanel.currentDBName);
   //this never used to work...
   sgLightEditor.activePanel.currentDB = nameToId(sgLightEditor.activePanel.currentDBName);
   //echo(sgLightEditor.activePanel.currentDBName);
   //echo(sgLightEditor.activePanel.currentDB);
   sgLightEditor.activePanel.setGui();
}

function sgFilterDBList::onSelect(%this, %id, %text)
{
   if(sgLightEditor.activePanel != sgLightEditorCinematicFilterEditorPanel)
   {
      error("sgFilterDBList::onSelect> Error Filter Editor panel not set.");
	  return;
   }
   
   sgLightEditor.activePanel.currentDBName = sgFilterDBList.getText();  
   //commandToServer('sgGetLightDBId', sgLightEditor.activePanel.currentDBName);
   sgLightEditor.activePanel.currentDB = nameToId(sgLightEditor.activePanel.currentDBName);
   //echo(sgLightEditor.activePanel.currentDBName);
   //echo(sgLightEditor.activePanel.currentDB);
   sgLightEditor.activePanel.setGui();
}

After reading some documentation, I can change the '!=' to the string compare '!$=' and the compile error goes away; however, since neither of the objects appear to be strings, I feel I'm duct-taping some bigger underlying problem.

If I run the .exe directly, the sample starts up and everything appears to work fine. Pressing the tilde key to bring up the script console shows that there are no compilation errors; however, I get some resource loading errors - I get about 30 "could not locate texture" messages(even though the textures must be loading since I can see them in the demo) and bringing up the world editor shows another gui error:

creator/editor/EditorGui.cs (878): Unable to find object: '' attempting to call the function 'open'
creator/editor/EditorGui.cs (2973): Unable to find object: 'MessageHud' attempting to call the function 'close'

I'm not sure if these 2 errors are related, or if the Torque messages are innocent and it's a bug in Torsion - but I do know that I can't run the sample from Torsion, and I would prefer to use it.

Any help would be appreciated - I'm sure I just overlooked something, having just bought the engine.

-- Michael Burge

About the author

Recent Threads