Torque 3D 1.1 Beta Tips&Tricks
by Rene Damm · in Torque 3D Professional · 02/18/2010 (8:54 pm) · 20 replies
Hey all,
Lately I was thinking that probably lots of good little stuff goes unnoticed between alpha/beta releases simply because there is no documentation yet and hardly anyone happens to accidentally stumble upon these things. So, in this thread, I'd like to just gather a few little tips&tricks on useful little improvements that have happened here and there between alpha and beta.
Of course, everyone is free to contribute, ask questions, provide feedback, etc. I myself will probably be adding various things over the next couple of days.
Lately I was thinking that probably lots of good little stuff goes unnoticed between alpha/beta releases simply because there is no documentation yet and hardly anyone happens to accidentally stumble upon these things. So, in this thread, I'd like to just gather a few little tips&tricks on useful little improvements that have happened here and there between alpha and beta.
Of course, everyone is free to contribute, ask questions, provide feedback, etc. I myself will probably be adding various things over the next couple of days.
About the author
#2
Integer and float fields as well as their respective vector types now accept TorqueScript expressions as input which will be evaluated and the result used for setting the field value.
For example, you can enter something like
For vector-type fields, be aware that whitespace is considered to separate fields so if you enter expressions, make sure to not have whitespace between subexpressions belonging to the same field:
But:
However, for vector-type fields, you don't actually need to specify each individual field. You may just as well enter an expression that evaluates to only part of the fields or evaluates to all fields at once:
Or more complex to get a vector pointing halfway between ObjA and ObjB:
One additional feature that actually gives a lot of power to expressions (especially in combination with multi-object selection in inspectors) is two special variables that allow to refer to the field's current value.
For example, to increase the radius on a number of point-lights by 10%, select the lights and in the "radius" field type:
Or to shift an object upwards by 10 units
Or to set a vector field to its normalized value
02/18/2010 (8:57 pm)
Numeric Fields In Inspectors Now Accept TorqueScript Expressions
Integer and float fields as well as their respective vector types now accept TorqueScript expressions as input which will be evaluated and the result used for setting the field value.
For example, you can enter something like
mPi() * mPow( 4, 2 )
For vector-type fields, be aware that whitespace is considered to separate fields so if you enter expressions, make sure to not have whitespace between subexpressions belonging to the same field:
1+2 3+4 // Works
But:
( 1 + 2 ) ( 3 + 4 ) // Does not work
However, for vector-type fields, you don't actually need to specify each individual field. You may just as well enter an expression that evaluates to only part of the fields or evaluates to all fields at once:
MyHouse.position
Or more complex to get a vector pointing halfway between ObjA and ObjB:
VectorAdd(ObjB.position,VectorScale(VectorNormalize(VectorSub(ObjA.position,ObjB.position)),VectorLen(VectorSub(ObjA.position,ObjB.position))/2)
One additional feature that actually gives a lot of power to expressions (especially in combination with multi-object selection in inspectors) is two special variables that allow to refer to the field's current value.
For example, to increase the radius on a number of point-lights by 10%, select the lights and in the "radius" field type:
%f*1.1 // %f refers to the current field value
Or to shift an object upwards by 10 units
%f %f %f+10 // Each %f refers to an individual vector component
Or to set a vector field to its normalized value
VectorNormalize(%v) // %v refers to complete vector field value
#3
Right-clicking on a field name in an inspector view will bring up a context menu with options relating to the fields type. Most importantly, these provide shortcuts between the different editors.
Datablock Field:

Shape File Field:

Image File Field:

Gui Profile Field:

Other fields have right-click menus, too.
//Edit:
The beta has an issue on Windows where these popup menus are appearing as empty horizontal strips because their "isPopup" property is not set to true (which is not needed on the Mac). Fixed for next release.
02/18/2010 (9:02 pm)
New Right-Click Menus On Inspector Fields
Right-clicking on a field name in an inspector view will bring up a context menu with options relating to the fields type. Most importantly, these provide shortcuts between the different editors.
Datablock Field:

Shape File Field:

Image File Field:

Gui Profile Field:

Other fields have right-click menus, too.
//Edit:
The beta has an issue on Windows where these popup menus are appearing as empty horizontal strips because their "isPopup" property is not set to true (which is not needed on the Mac). Fixed for next release.
#4
Right-click menus on the items in the World Editor and Gui Editor trees provide shortcuts to editor functionality.
World Editor:

Gui Editor
02/18/2010 (9:05 pm)
New Right-Click Menus in World Editor and Gui Editor Tree Views
Right-click menus on the items in the World Editor and Gui Editor trees provide shortcuts to editor functionality.
World Editor:

Gui Editor
#5
The library palette in the Gui Editor can be switched between two different organizations by right-clicking the "Library" tab page header and choosing a style:
02/18/2010 (9:06 pm)
Ability to Switch Between Alphabetical and Categorized View in Gui Editor Library
The library palette in the Gui Editor can be switched between two different organizations by right-clicking the "Library" tab page header and choosing a style:
#6
Color swatches in the various inspectors have new functionality. For one, colors can be rapidly copied between fields by dragging and dropping their color swatches on top of each other:

Then, color editing through color requesters is now live which means that as you move the sliders in the requesters around, the field's color value will immediately change and the change be immediately visible:

This is especially useful when editing lights.
02/18/2010 (9:08 pm)
New Color Swatch Functionality
Color swatches in the various inspectors have new functionality. For one, colors can be rapidly copied between fields by dragging and dropping their color swatches on top of each other:

Then, color editing through color requesters is now live which means that as you move the sliders in the requesters around, the field's color value will immediately change and the change be immediately visible:

This is especially useful when editing lights.
#7
Just as with lights, sound emitter max ranges can now be set interactively by using the scale tool on the emitter:

As can be seen in the image, there is also new feedback rendering of the inner, outer, and outside volume cones as well as visual feedback of the distance attenuation. However, as this is currently rendered as a cloud of 1-pixel points, it is usually very hard to see. Improving this is on my TODO list.
02/18/2010 (9:09 pm)
Sound Emitter Range Can Be Adjusted By Scaling
Just as with lights, sound emitter max ranges can now be set interactively by using the scale tool on the emitter:

As can be seen in the image, there is also new feedback rendering of the inner, outer, and outside volume cones as well as visual feedback of the distance attenuation. However, as this is currently rendered as a cloud of 1-pixel points, it is usually very hard to see. Improving this is on my TODO list.
#8
An inspector window on any object can be brought up with
02/18/2010 (9:11 pm)
Inspector Windows
An inspector window on any object can be brought up with
inspectObject( myObject ); // Example: browse the entire engine object tree: inspectObject( RootGroup ); // Example: browse the current GUI inspectObject( Canvas );
#9
TorqueScript has two new statements to simplify iteration over collections.
To iterate over a SimSet or SimGroup use foreach:
To iterate over each component of a vector use foreach$:
02/18/2010 (9:52 pm)
New TorqueScript Statements
TorqueScript has two new statements to simplify iteration over collections.
To iterate over a SimSet or SimGroup use foreach:
foreach( %obj in %simSet ) doSomethingWith( %obj );
To iterate over each component of a vector use foreach$:
foreach$( %str in "a b c d" ) doSomethingWith( %str );
#10
02/19/2010 (12:05 pm)
Nice. Thank you for "foreach"--thank you very, very, very much!
#12
Try it and see! =)
02/19/2010 (2:25 pm)
Here's a neat trick. You can achieve a really cool screen effect by simply shooting a few projectiles into a waterblock.Try it and see! =)
#13

Could be a bit lighter though ... but if I don't want to use a setting other than "normal" or they'll be too bright in a night time scene...
02/19/2010 (3:10 pm)
Yeah those ripples for surface pentration are great
Could be a bit lighter though ... but if I don't want to use a setting other than "normal" or they'll be too bright in a night time scene...
#14
Previously, "superClass" fields were restricted to be namespaces immediately linked to the native class being instantiated. This is no longer the case and arbitrary many levels of namespace parenting may be put between the native class namespace and the "superClass" namespace.
Also, "class" and "superClass" now can be dynamically set on objects and will cause proper relinking. Namespace linkage is also enabled now on all objects.
//Edit: Argh, actually it occurred to me after adding this to really check the beta whether this change made it in. It didn't. So, this will be only available in the next beta. Sorry for the confusion.
02/19/2010 (8:15 pm)
"superClass" Fields Allow For Deeper Script Namespace Hierarchies
Previously, "superClass" fields were restricted to be namespaces immediately linked to the native class being instantiated. This is no longer the case and arbitrary many levels of namespace parenting may be put between the native class namespace and the "superClass" namespace.
function BaseClass::someMethod( %this )
{
// ...
}
new ScriptObject( A )
{
superClass = "BaseClass";
class = "DerivedClass";
};
new ScriptObject( B )
{
superClass = "DerivedClass";
class = "DerivedDerivedClass";
};
new ScriptObject( C )
{
superClass = "DerivedDerivedClass";
class = "FinalClass";
};Also, "class" and "superClass" now can be dynamically set on objects and will cause proper relinking. Namespace linkage is also enabled now on all objects.
//Edit: Argh, actually it occurred to me after adding this to really check the beta whether this change made it in. It didn't. So, this will be only available in the next beta. Sorry for the confusion.
#16
02/19/2010 (11:41 pm)
Outstanding. Thanks Rene.
#18
Reparenting objects in the scene tree and reparenting objects in the Gui Editor control tree is now undoable which solves a long-standing woe.
02/20/2010 (7:30 am)
Reparenting In Tree Views Is Now Undoable
Reparenting objects in the scene tree and reparenting objects in the Gui Editor control tree is now undoable which solves a long-standing woe.
#19
A new dialog available via "Edit -> Select..." allows to select and deselect objects based on names, types, and parent group.

This dialog is available in both the World Editor as well as the Gui Editor.
//Edit:
The pattern matcher used by the dialog has a bug in the beta when doing case-insensitive character matches after wildcards. Fixed for next release.
02/20/2010 (7:38 am)
Objects Can Now Be Batch-Selected
A new dialog available via "Edit -> Select..." allows to select and deselect objects based on names, types, and parent group.

This dialog is available in both the World Editor as well as the Gui Editor.
//Edit:
The pattern matcher used by the dialog has a bug in the beta when doing case-insensitive character matches after wildcards. Fixed for next release.
#20
Rollouts can be configured to auto-collapse their sibling rollouts when they are expanded. This is, for example, used in the Library pane of the Gui Editor.
Additionally, by CTRL-clicking (CMD on Mac) a rollout header, it's auto-collapse behavior will reverse, i.e. a rollout configured to auto-collapse siblings will leave them expanded whereas a rollout configured to not auto-collapse will collapse them.

This is useful to keep multiple categories open in the Library pane or to collapse all but one group in an inspector in one single click.
02/20/2010 (8:12 am)
Auto-Collapsing Of Rollout Groups
Rollouts can be configured to auto-collapse their sibling rollouts when they are expanded. This is, for example, used in the Library pane of the Gui Editor.
Additionally, by CTRL-clicking (CMD on Mac) a rollout header, it's auto-collapse behavior will reverse, i.e. a rollout configured to auto-collapse siblings will leave them expanded whereas a rollout configured to not auto-collapse will collapse them.

This is useful to keep multiple categories open in the Library pane or to collapse all but one group in an inspector in one single click.

Associate Rene Damm
Inspectors Now Allow Editing Multiple Objects At The Same Time
Inspectors in the Gui Editor, World Editor and Datablock Editor now allow multiple objects to be selected and edited concurrently. A cross-section of their properties (i.e. all static and dynamic properties present in all selected objects) will be displayed and can be edited in single operations.
Of course, all this fully works with undo and redo.
The red borders around fields indicate fields that have different values in the selected objects.