TorqueScript documentation/Tutorial?
by Vern Jensen · in Torque Game Builder · 06/16/2006 (2:30 pm) · 4 replies
OKay, so I recently bought Torque Game Engine. Pretty cool. I've gone through 1 and 1/2 tutorials so far, and also skimmed most of the manual on TGE. However, I don't see anything that documents the syntax of TorqueScript. I'm a longtime C and Java programmer, so I'm not new to programming, but I'd like to know what the rules are for TorqueScript itself. Is there a reference for this?
For instance:
- Can I create variables local to a function?
- How about global variables?
- Arrays? 2D/3D arrays?
- Can functions return values?
- What's the difference between $foo and %foo?
- All the example code seems to use braces for everything, even for single statements, such as
if (something)
{
statement;
}
Are the braces required by TorqueScript, even if only one statement is used?
I know I could experiment to answer some of my questions, but I'd much rather read a "TorqueScript Reference". Does such a thing exist?
-Vern
For instance:
- Can I create variables local to a function?
- How about global variables?
- Arrays? 2D/3D arrays?
- Can functions return values?
- What's the difference between $foo and %foo?
- All the example code seems to use braces for everything, even for single statements, such as
if (something)
{
statement;
}
Are the braces required by TorqueScript, even if only one statement is used?
I know I could experiment to answer some of my questions, but I'd much rather read a "TorqueScript Reference". Does such a thing exist?
-Vern
#2
http://tdn.garagegames.com/wiki/TorqueScript_Quick_Reference
One more questions unanswered by that reference and the other forums though:
How do I create local variables? In C, you'd just do:
int myValue;
float whatever;
In TorqueScript, it seems like you just start using it, but then how does the script compiler know what type of variable it is?
-Vern
06/16/2006 (5:59 pm)
Thanks. I also found this:http://tdn.garagegames.com/wiki/TorqueScript_Quick_Reference
One more questions unanswered by that reference and the other forums though:
How do I create local variables? In C, you'd just do:
int myValue;
float whatever;
In TorqueScript, it seems like you just start using it, but then how does the script compiler know what type of variable it is?
-Vern
#3
www.garagegames.com/docs/tge/general/ch05.html
-Vern
06/16/2006 (6:30 pm)
I also just found this:www.garagegames.com/docs/tge/general/ch05.html
-Vern
Torque Owner Philip Mansfield
Default Studio Name