OOP in Torque - help with basic objects and setup
by Chris "Hyena" Vogel · in Torque Game Builder · 01/08/2006 (6:36 pm) · 4 replies
Wow... It's amazing what we forget when we don't use it. I haven't done any real programming in almost a year, and I need some help getting back into it.
I've been reading the Torquescript reference and some old forum posts trying to remember how to go about OOP in T2D, and I'm not really getting it. So I figured I'd ask for some help.
What I'm trying to do is define (c++ style) classes, create objects derived from those classes, and access functions and members of said objects.
I remember that T2D makes this pretty easy and is similar to C++, but I am just having trouble actually doing it! Maybe my brain is just fried tonight, I don't know...
If someone could post some actual script examples and link me to some decent object references, I'd apreciate it. I'm not really interested in multiple levels of inheritance or polymorphism, I just want to get a strong handle of basic OOP in T2D.
Thanks!
Chris
I've been reading the Torquescript reference and some old forum posts trying to remember how to go about OOP in T2D, and I'm not really getting it. So I figured I'd ask for some help.
What I'm trying to do is define (c++ style) classes, create objects derived from those classes, and access functions and members of said objects.
I remember that T2D makes this pretty easy and is similar to C++, but I am just having trouble actually doing it! Maybe my brain is just fried tonight, I don't know...
If someone could post some actual script examples and link me to some decent object references, I'd apreciate it. I'm not really interested in multiple levels of inheritance or polymorphism, I just want to get a strong handle of basic OOP in T2D.
Thanks!
Chris
#2
01/12/2006 (12:15 pm)
Glad you found what you needed :) I must've missed this thread or I would've replied (been pretty busy on the strategy tut)... in the part of the strategy tut (that I'm finishing up now in fact) I use a makeshift ScriptObject class system for actions and objects, might be of interest :)
#3
01/12/2006 (12:34 pm)
Cool, I look forward to seeing in Matthew!
#4
Your RTS tutorial is really looking great by the way matt, it's helped me get a feel for a little bit of the functionality in the engine that isn't covered in the torquescript reference or docs that came with t2d like scriptobjects.
01/14/2006 (12:33 pm)
Well, let me add my name to the list of people that would love to see a good basic explination of how scriptobjects work as a whole on TDN, especially its oo functionality.Your RTS tutorial is really looking great by the way matt, it's helped me get a feel for a little bit of the functionality in the engine that isn't covered in the torquescript reference or docs that came with t2d like scriptobjects.
Torque Owner Chris "Hyena" Vogel
But anyways, I dug around and found THIS thread which gives some useful info throughout it. If anyone is looking for answers to my questions above, this might be the place to start.