Long time subscriber first time poster
by Daniel MD · in Technical Issues · 05/28/2006 (3:10 pm) · 7 replies
I am a long time subscriber to the newsletter and Forums, but this is my first post i read about the Toque 1.4 SDK and now i want to do something with it.
I have experience in C, C+, Java, Javascript and PHP... Torque Script looks a little bit like PHP.
I was wondering if there is a consise primer about Torque Script?
I have a couple of questions about it:
-Looks like there is no foreach cycle, Why is that? and how easy would it be to add it?
-No ternary operator (?:) i happen to use this allot but can do without.
-I have not looked at enought code, but i have not found a multidimensional array, are they supported?
I have bought two books "3D Game programming All in One" and the Advanced book also, are these uptodate?
I also noticed this book: "The Game Programmer's Guide to Torque" but the information about is very little, the TOC is wothless and there are no sample chapters... anyone can recommend it and provide a little bit more information.
Thanks for helping out a newbie to Torque Script :)
-Dan
I have experience in C, C+, Java, Javascript and PHP... Torque Script looks a little bit like PHP.
I was wondering if there is a consise primer about Torque Script?
I have a couple of questions about it:
-Looks like there is no foreach cycle, Why is that? and how easy would it be to add it?
-No ternary operator (?:) i happen to use this allot but can do without.
-I have not looked at enought code, but i have not found a multidimensional array, are they supported?
I have bought two books "3D Game programming All in One" and the Advanced book also, are these uptodate?
I also noticed this book: "The Game Programmer's Guide to Torque" but the information about is very little, the TOC is wothless and there are no sample chapters... anyone can recommend it and provide a little bit more information.
Thanks for helping out a newbie to Torque Script :)
-Dan
#2
Thanks for the info much appreciated.
Oh... the book did not mention a ternary operator that is why I asked :/
and it also did not mention multidimensional arrays... at least in the first chapters.
I already bought the 3DGPAIO books... and before i buy the GPGT book i need to know a little bit more information about it... is it a tutorial type book, is a reference book, if you could provide a very short review of the book it would be great.
Once again, Thank You
05/28/2006 (3:41 pm)
Hi Rubes, Thanks for the info much appreciated.
Oh... the book did not mention a ternary operator that is why I asked :/
and it also did not mention multidimensional arrays... at least in the first chapters.
I already bought the 3DGPAIO books... and before i buy the GPGT book i need to know a little bit more information about it... is it a tutorial type book, is a reference book, if you could provide a very short review of the book it would be great.
Once again, Thank You
#3
Some of the code in it won't work in 1.4
Both of those books are great for reference tho. There is a bunch of pages at the back that give you all the funtions, and such for torque script.
The other book, GPGT was made using 1.4 (from my understanding. I haven't bought it yet) There is a forum talking just about all 3 books.
05/28/2006 (3:50 pm)
3dgap1 was written using torque 1.2 and updated to 1.3Some of the code in it won't work in 1.4
Both of those books are great for reference tho. There is a bunch of pages at the back that give you all the funtions, and such for torque script.
The other book, GPGT was made using 1.4 (from my understanding. I haven't bought it yet) There is a forum talking just about all 3 books.
#4
Can you point me to that forum, i will try and find it (EDIT:Found It)... and thanks for the information on the books...
I found this piece of code on chapter 3 that is puzzling my head...
%shape.setTransform(%lx SPC %ly SPC %lz SPC "0 0 1 0");
What the heck are SPC? since there are no types (according to the book in TS), what are these SPC things? Thanks and sorry fur such newbie questions... as i said i am new at TS. (since i see no commas does it mean String Parameter Comma?)
05/28/2006 (4:05 pm)
Hi Mike, Can you point me to that forum, i will try and find it (EDIT:Found It)... and thanks for the information on the books...
I found this piece of code on chapter 3 that is puzzling my head...
%shape.setTransform(%lx SPC %ly SPC %lz SPC "0 0 1 0");
What the heck are SPC? since there are no types (according to the book in TS), what are these SPC things? Thanks and sorry fur such newbie questions... as i said i am new at TS. (since i see no commas does it mean String Parameter Comma?)
#5
05/28/2006 (5:25 pm)
SPC is the equivilant of @ " " @ , it basically appends strings (well, everything is a string in TS) with a space between them. @ is the operator for a standard string append.
#6
I did not realize that you have to use a string to pass parameters... a bit wierd, i was expecting the usual parameter list. Seems i have some particularities to learn.
Thank you all that replied,
-Dan
05/29/2006 (4:38 am)
Oh OK now i get it, Thanks PaulI did not realize that you have to use a string to pass parameters... a bit wierd, i was expecting the usual parameter list. Seems i have some particularities to learn.
Thank you all that replied,
-Dan
#7
for(%i = 0; %i < %num; %i++)
05/29/2006 (8:52 am)
Daniel torquescript uses the C and javascript syntax for for loops:for(%i = 0; %i < %num; %i++)
Torque 3D Owner Rubes
- yes, there is a ternary operator (x ? y : z) supported in TorqueScript
- I use multidimensional arrays in Torquescript, and there is an array resource that extends the functionality of arrays
- I have both 3DGPAIO and GPGT books (not the advanced book) and they are both good; of all of them I would recommend GPGT first. It covers a lot of basic information about Torque and is probably the best one for people starting out with Torque.