TScript Prigramming book
by Martyn · in Torque Game Builder · 09/17/2008 (11:43 am) · 4 replies
Hi I have a quick question.
I have no background in Torque script or any lanaguage and I am slowly working through the tutorials but would like a little more to give myself a boost in learning the scripting.
At first I was thinking of paying for someone to teach me but im not sure on the costs involved in that.
Then I knew there was a book to that I thought was mainly aimed at TGE but wondered if it would also be benificial for someone using TGB
Thanks for you comments :)
I have no background in Torque script or any lanaguage and I am slowly working through the tutorials but would like a little more to give myself a boost in learning the scripting.
At first I was thinking of paying for someone to teach me but im not sure on the costs involved in that.
Then I knew there was a book to that I thought was mainly aimed at TGE but wondered if it would also be benificial for someone using TGB
Thanks for you comments :)
About the author
I have been interested in game development for around 10 years, it has always remained a hobby. I am now looking to develop my skills and maybe progress it from a hobby into a 2nd income.
#2
Thanks
09/18/2008 (4:37 am)
Thank you for your suggestion - I was debabting on if it would be better for me to go and learn a more basic lanaguage and then move up the ladder so to say onto either Tscript or CThanks
#3
09/18/2008 (12:33 pm)
Thinking In C++ is a highly regarded C++ primer that is also available for free on the internet. If you are going to learn a scripting language to get started slow why not just start learning TorqueScript? Nothing wrong with learning something else if there is a particularly well written guide to it, but there is information on TorqueScript, if you need help knowing where to look just ask.
#4
I suggested Ruby, because it learned from the mistakes of every other language to date, if that makes since. And it is a scripted / interpreted language that has a real time debugger that lets you immediately see the results of an operation. It is very beginner friendly for those reasons.
That said, C++ and TorqueScript look nothing like Ruby Syntactically. So you may want to start with C/C++.
And its really not about moving up the ladder, or one being harder than the other. You could say that Ruby is a MUCH higher level language than C/C++.
Here is a Ruby script that traverses sub folders in the "helper" directory, taking every image along the way and storing them in a list. It then reverses the order of the items and renames them one by one (output 000.png, output 001.png, etc) while copying them to a central map folder. I do this so that I can build a sprite sheet from images in multiple folders using the montage command line tool from image magick, and it saves me hours of work. This same program would be several pages long in another language:
If you do go with C I would suggest the book 'Absolute Beginners Guide to C (Second Edition).' You can pick it up on Amazon for 23 bucks. It is a very good approach to learning C.
I always suggest learning C, and then approaching C++. After all, C++ is object oriented C, it's not a huge jump.
Take them in any order you want, but learn as many languages as you can.
MOO's and MUD's are also a great way to learn about C and C++. Kind of a virtual world / Block party for nerds, but they usually teach classes for free. I learned a great deal that way when I was a teenager.
09/18/2008 (3:32 pm)
C and C++ are fine languages, and they are both what I started out in. Technically, I guess I started with Pascal and Borland C++(I worked in a dish room to earn enough money to buy that Borland compiler when I was 14...). What I was trying to express, is that a lot of people make the mistake of focusing on a single language, and they wind up in a rut.I suggested Ruby, because it learned from the mistakes of every other language to date, if that makes since. And it is a scripted / interpreted language that has a real time debugger that lets you immediately see the results of an operation. It is very beginner friendly for those reasons.
That said, C++ and TorqueScript look nothing like Ruby Syntactically. So you may want to start with C/C++.
And its really not about moving up the ladder, or one being harder than the other. You could say that Ruby is a MUCH higher level language than C/C++.
Here is a Ruby script that traverses sub folders in the "helper" directory, taking every image along the way and storing them in a list. It then reverses the order of the items and renames them one by one (output 000.png, output 001.png, etc) while copying them to a central map folder. I do this so that I can build a sprite sheet from images in multiple folders using the montage command line tool from image magick, and it saves me hours of work. This same program would be several pages long in another language:
#!/usr/local/bin/ruby
require 'find'
require 'ftools'
x = 0
prefix = ""
fileList = Array.new
Find.find("/Users/loridand/MyGames/helper/") do | currentFile |
if File.file?(currentFile)
if currentFile.split("/")[-2] != "map"
if /output.*png/ =~ currentFile.split("/")[-1]
fileList.push(currentFile)
end
end
end
end
fileList.reverse.each do | finalFile |
if x < 10
prefix = "00"
elsif x < 100
prefix = "0"
else
prefix = ""
end
File.copy(finalFile, "/Users/loridand/MyGames/helper/map/output #{prefix}#{x}.png")
x += 1
endIf you do go with C I would suggest the book 'Absolute Beginners Guide to C (Second Edition).' You can pick it up on Amazon for 23 bucks. It is a very good approach to learning C.
I always suggest learning C, and then approaching C++. After all, C++ is object oriented C, it's not a huge jump.
Take them in any order you want, but learn as many languages as you can.
MOO's and MUD's are also a great way to learn about C and C++. Kind of a virtual world / Block party for nerds, but they usually teach classes for free. I learned a great deal that way when I was a teenager.
Torque Owner Dorian Yeager
This is only my 10c so take it with a grain of salt. Torque is still an engine written for programmers. Programmers (the real ones anyway) do not study a language. Programmers study the nature of programming languages. Personally, I've worked in Ruby, LISP, VB.Net, VB6, C++, C, PHP, Perl, and Python.
The reason that I'm able to do this, is that I understand the features that make a programming language. Knowing this, I can pick up a reference and start programming.
Torque is no different. They provide a reference, and if you understand programming, then there is not much to learn. Anything that lies outside of the pattern you can come here and ask questions about.
I guess what I'm saying is, you need to pick up a good beginners language if you want to start down the road of coding.
Back when I was a college instructor and I taught programming languages, I always started my students with Ruby. It's very similar to VB.Net, costs nothing, and it has features that are cutting edge. You can use it for just about anything.
Pick up a copy of the Pick Axe: 'Programming Ruby: The Pragmatic Programmers' Guide'
The only money that needs to be spent here is on books. Pay no one. If they were a real programmer that was capable of anything they would not need your money.
In the event that you listen to me and decide to actually learn programming, the Ruby community is chocked full of the brightest developers on the net and they gladly assist beginners in the forum areas. You can also email me and ask questions on anything that you don't understand. Dalorin-atsigngoeshere-gmail.com
Dorian