It's possible create object namespaces in scritp?
by Luis Anton Rebollo · in Torque Game Engine · 03/17/2005 (2:18 am) · 5 replies
It's possible create object namespaces in scritp similar form than datablocks?
thx and sorry for my english.
thx and sorry for my english.
About the author
I'm working on a port of Torque3D to OpenGL and Linux/SteamOS
#2
customitem1,2,3,4 -> CustomItem -> Item ...
In torque documentation:
How i can declare a class in script???
Any idea.
03/17/2005 (11:41 am)
Thx for the reply but i need a class o namespace for object that uses same functions.customitem1,2,3,4 -> CustomItem -> Item ...
In torque documentation:
Objects are created in TorqueScript using the following syntax:
// In TorqueScript
%var = new [b]ObjectType[/b](Name : CopySource, arg0, ..., argn)
{...
...
[b]ObjectType[/b]- Is any class declared in the engine or in [b]script[/b] ...How i can declare a class in script???
Any idea.
#3
I learned i can declare class and superclass as field of SimObject declaration :)
It's possible declare as superclass Item o GameBase?
03/17/2005 (12:36 pm)
Ok, thx John.I learned i can declare class and superclass as field of SimObject declaration :)
It's possible declare as superclass Item o GameBase?
#4
I think it's impossible :(
03/17/2005 (12:52 pm)
Error: cannot change namespace parent linkage for Item from ShapeBase to ScriptObject.I think it's impossible :(
#5
03/17/2005 (1:21 pm)
Hmm I just posted in your new thread before I saw your replies here. I'm starting to get a small idea of what you want. It seems to me you are trying to create your own subclass of ShapeBase but want to do it in Torque Script exclusivley. I'm not 100% sure that's doable, but i'd have to do a little digging first. TS does support at least some OOP basics, but i'm not sure it takes it this far. Generally what you would do is create your subclass of ShapeBase on the C++ side then simply create an instance of your new class in the script. But let me do some digging around and see if you can do this 100% in script.
Torque Owner John Vanderbeck
VanderGames
$blah = new ScriptObject(MyObject); $blah.someField = 10; MyObject.someOtherField = 5; MyObject::onCallback(%this, %a, %b) { %c = %a + %b; echo(%c); }