Game Development Community

Changes in scripting language

by Sean H. · in Torque Game Engine Advanced · 01/17/2009 (1:24 am) · 5 replies

What are the major differences in the scripting language for different versions of torque/tgea? Of course for the most part, the functions and features of torquescript are identical in all torque engines. After going through the scripts for tge and tgea, Ive noticed a couple significant changes. Post any changes/upgrades to the torque scripting language youve encountered.

The main difference between tge1.5.2 and tgea1.7 is the addition of material definitions and shader datablocks. Also, tgea1.7 requires a call to initRenderInstManager() before material definitions. tgea1.7.1 seems to have gotten rid of initRenderInstManager() so it's not longer needed. Tgea1.7.1 also saw substantial changes to the sound interface. All function names were changed from alx..() to sfx..() in the transition between 1.7 and 1.7.1. Tgea1.7.1 also changed the method for creating the canvas. In 1.7 you use creatCanvas(name) or creatEffectCanvas(name) but in 1.7.1 you create a canvas object using "new GuiCanvas(Canvas);" and then set the name of the window using "Canvas.setWindowTitle(%windowTitle);".

Those are the main changes I've found. I emphasize changes because I'm not talking about any additions of new functions or object types but changes to the core scripting language for the different engines.

#1
01/17/2009 (3:31 am)
Sean - I'm not really sure what you're trying to achieve, the language itself is exactly the same between the different versions of Torque (TGE, TGEA, etc).

It's the engine itself that is different and requires some different functions to be called from Torquescript but you mention that you're not after new functions or objects?!?

You might want to check the documentation for TGEA out either in your SDK download or the online version on the site as it includes a porting guide which details a few differences.
#2
01/17/2009 (4:46 am)
Other than your aforementioned changes and a few differently named console functions due to changes across the engines, there really isn't a difference in the scripting language itself. Script is script is script. Keywords are the same, syntax is the same, operators, etc, etc, only within how you tie it all together due to new or differing engine functions and object/name changes is there any difference.

I think that what you are after are different script methods and usage changes, but those will vary from user to user and project to project.
#3
01/17/2009 (7:41 am)
Quote:Other than your aforementioned changes and a few differently named console functions due to changes across the engines, there really isn't a difference in the scripting language itself.

Do you have a list of all the console function names and console object fields that were changed in different versions of the engine? This is what I'm most interested in; changes to the console functions and console objects which affect the portability of script between different versions of the engine.

#4
01/17/2009 (7:48 am)
There isn't much of a change between the two Sean - a few sfx things, lighting block changes but as I mentioned that's in the porting guide as part of the documentation
#5
01/17/2009 (10:17 am)
@Sean - Here is a quick way to do this. Fire up each version of Torque you want to compare and in the console type:

cls();
dumpConsoleClasses();
dumpConsoleFunctions();
quit();

... now edit console.log to remove everything before cls() and after quit(). Then rename the console.log to mark it as specific to that version of Torque.

Repeat this for each version of Torque you want to test.

You now have a list of all the engine exported classes and functions for each version of Torque (with docs). You can use a program like Beyond Compare to do a quick diff between the different versions and see what specifically changed.