Question about objectSceneDatablocks
by Spencer Grey · in Torque Game Builder · 06/13/2006 (9:51 am) · 1 replies
Hey guys,
I'm trying to set up a hierarchy of classes (ie: Orc ~> Humanoid ~> Entity), but whenever I have a chain of two or more classes the app throws an error. The code is:
----
new t2dSceneObjectDatablock (Entity) {
};
new t2dSceneObjectDatablock (Humanoid : Entity) {
superClass = Entity;
};
new t2dSceneObjectDatablock (Orc : Humanoid) {
class = Humanoid;
str = 10;
sta = 10;
dex = 10;
agi = 10;
int = 10;
wis = 10;
};
----
The error message I get for passing in to the player's config is:
Buffer overrun detected! (etc etc etc).
Sometimes I don't even get that, and it just downright crashes to the desktop. The code I'm using to init the player is:
---
$player = new t2dStaticSprite() { config = "Orc"; scenegraph = t2dScene; };
---
I also tried :
---
$player = new t2dStaticSprite(Player : Orc) { scenegraph = t2dScene; };
---
That didnt crash give me any error messages, but it didnt set the player's class either. He was able to access attributes I assigned to him, but not any of the class functions.
Any ideas about what I'm doing wrong? From what I can tell, this is the same syntax that the RTS tutorial is using. I even copied their datablocks and tried setting my player to CirclesWorker or whatever. That crashed me too.
I'm at a loss. Thanks in advance.
I'm trying to set up a hierarchy of classes (ie: Orc ~> Humanoid ~> Entity), but whenever I have a chain of two or more classes the app throws an error. The code is:
----
new t2dSceneObjectDatablock (Entity) {
};
new t2dSceneObjectDatablock (Humanoid : Entity) {
superClass = Entity;
};
new t2dSceneObjectDatablock (Orc : Humanoid) {
class = Humanoid;
str = 10;
sta = 10;
dex = 10;
agi = 10;
int = 10;
wis = 10;
};
----
The error message I get for passing in
Buffer overrun detected! (etc etc etc).
Sometimes I don't even get that, and it just downright crashes to the desktop. The code I'm using to init the player is:
---
$player = new t2dStaticSprite() { config = "Orc"; scenegraph = t2dScene; };
---
I also tried :
---
$player = new t2dStaticSprite(Player : Orc) { scenegraph = t2dScene; };
---
That didnt crash give me any error messages, but it didnt set the player's class either. He was able to access attributes I assigned to him, but not any of the class functions.
Any ideas about what I'm doing wrong? From what I can tell, this is the same syntax that the RTS tutorial is using. I even copied their datablocks and tried setting my player to CirclesWorker or whatever. That crashed me too.
I'm at a loss. Thanks in advance.
Torque Owner Spencer Grey
Should I be doing this with ScriptObjects instead? I'm kind of confused about when to use which.
I set up a weapon hierarchy with ScriptObjects which works great. I got the sense that I should be using datablocks though, since the RTS tutorial was using them.
Should I continue with SOs or ?