Game Development Community

TorqueScript IDE/Editor -- Torsion

by David Higgins · in Torque Game Builder · 08/16/2006 (12:34 pm) · 7 replies

For those of you who are just trying out TGB, or any of the other T-engines, and your anything like me ... and get frustrated trying to learn a new langauge like TorqueScript with alpha/beta level documentation and limited tutorials ... you might find a good use in also trialing the Torsion IDE for TorqueScript, which according to it's developers is being developed along-side the Torque engines (correct me if I'm wrong?) and modifications to the Torque engine have been made to take account for some of Torsions abilities like inline debugging (though I've not yet figured out how to do this ... lacking documentation and all).

IntelliSense, code-folding, syntax highlighting, and a few other nifty tricks and treats are all found within Torsion ... once I make a final decision on Torque, and if/when I decide to license it and use it ... Torsion will definately be part of the package.


Just a heads up to those of you who are trying out TGB and are thinking to yourselfs "What, no script editor?"

#1
08/16/2006 (1:15 pm)
Thanks for the tip, yeah It actually mentions it in the tutorials. Unfortunately afaik it wont compile the code. So you can still code an error without noticing it. so is just an editor not an IDE
#2
08/16/2006 (1:20 pm)
Won't compile the code? Hrm, fraid I didn't run into that issue ... There is a compile option in Torsion, and I was able to use it ...


From the project menu, with an active project loaded, select "Precompile" or "Precompile All". Any script errors that exist, that would throw an exception during compilation (not run-time) are identified.

This is with version "1.0.654 alpha"

Hope that helps ... and I did not realize the tutorials mentioned it, I noticed the "Torsion" directory in the TGB install path, but had no idea what it was ... then again, I did not read every single tutorial yet ... and most likely won't read them all before I purchase the product. I'm more of a hands-on learner, learn from my own mistakes ... reference manuals are my main educational tool, unfortuneately the TorqueScript manuals are lacking in quite a few places ... they have function definitions (function name and parameters) but are missing quite a few descriptions and parameter summaries ... though, this was true of the 1.1.0 build, not sure if most of them were corrected in the 1.1.1 documentation ... I noticed they added GUI stuff to the 1.1.1 documentation for TGB
#3
08/16/2006 (1:48 pm)
Hey guys.

What Torsion does i've dubbed 'precompile' because it just does a pass compiling the changed scripts before running your game. It does this using the game EXE itself, so you'll only get the errors that TGE itself would return when it compiles the script into the DSO byte code. Now it doesn't actually execute the code... only compiles it... so many errors like functions not existing or misnamed variables will not be caught. This is a benefit and a curse when you have such a loose language like TorqueScript.

In the future i hope to see more error checking from Torque's compiler which Torsion will automatically benefit from.
#4
08/16/2006 (2:14 pm)
The was going to be a book released on Torque Script (Maximum Torque: The Ultimate Guide to Game Scripting (GarageGames S.)by Kenneth Finney, but it seems like the date just keeps getting pushed up. It was supposed to be released in April 2006, then November 2006, and I just looked it was pushed up again to June 2007. Publishers shouldn't post a book on Amazon if the date isn't positive. But one thing I guess there is a book going to be released in the future.
#5
08/16/2006 (2:37 pm)
An example of Torsions precompile can be noted as follows,


modify any script, in this example game.cs in your game's root folder,

add any blatantly incorrect syntax errors, such as just typing random letters and then tell Torsion to Precompile and you will recieve

Precompiling...

//-------------------------- 8/16/2006 -- 14:34:48 -----
Compiling main.cs...
main.cs Line: 14 - parse error
>>> Advanced script error report.  Line 14.
>>> Some error context, with ## on sides of error halt:
// initializeProject
// Perform game initialization here.
//---------------------------------------------------------------------------------------------
function initializeProject()
{
   [b]assadasdsa[/b]
   // Load up the in game gui.
   exec("~/gui/mainScreen.gui");
## ##  
   // Exec game scripts.
   exec("./gameScripts/game.cs");
   
   // Remove the following four lines if you would like to start the game without running the
   // level builder.
   if ($runWithEditors)
   {
      toggleLevelEditor();
      return;
>>> Error report complete.


Untitled - 1 scripts(s), 1 error(s)

However, if you create a function and it performs illegal operations or would somehow throw an exception only at run-time because it is syntactically correct but logically flawed, then you would recieve no errors


main.cs
//---------------------------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------
// initializeProject
// Perform game initialization here.
//---------------------------------------------------------------------------------------------

function performError()
{
   // code that would error during run-time
}

// remaining code removed for readability ...

Precompiling...

//-------------------------- 8/16/2006 -- 14:36:35 -----
Compiling main.cs...

Untitled - 1 scripts(s), 0 error(s)

Hope that helps ...
#6
08/16/2006 (6:01 pm)
Now my hope is that eventually i'll get some time to improve the TorqueScript compiler in Torque itself to spit out warnings/errors for any detectable mistakes. Now the trick is detecting these mistakes... and that is extremely difficult with a loosely typed language like TorqueScript.
#7
08/17/2006 (6:56 am)
Yeah I'd imagine, you'd have to follow every variable assignment to check for typing.