Game Development Community

Parent datablock access

by Derk Adams · in Torque Game Engine · 11/17/2004 (10:07 am) · 4 replies

Greetings,

I am working with weapons at the moment. I have the following datablocks.

datablock ShapeBaseImageData(ACImage)
{
...
}

datablock ShapeBaseImageData(AC2Image : ACImage)
{
...
}

function ACImage::onFire(%this, %obj, %slot)
{
...
}

function AC2Image::onFire(%this, %obj, %slot)
{
???
}

What do I put into AC2Image::onFire() in order to have it execute ACImage::onFire() ?

I have tried:
ACImage::onFire(%this, %obj, %slot)
and
Parent::onFire(%this, %obj, %slot)

Thanks.

#1
11/17/2004 (10:22 am)
Would this be for Lore?
#2
11/17/2004 (10:52 am)
Anthony,

No. As my profile states, I am creating a BattleTech simulator. I have no access to Lore, haven't even played it.

Thanks.
#3
11/17/2004 (2:33 pm)
I dont believe datablocks have a concept of Parent:: usage. When you "inherit" like that you are not actually inheriting from the datablock. Instead what is happening is it is just making a copy of the datafields that datablock has set.
#4
11/17/2004 (3:41 pm)
Robert,

Ok, different tactic. I renamed ACImage::onFire to ACFire, so I have:

function ACFire(%this, %obj, %slot)
{
...
}

function AC2Image::onFire(%this, %obj, %slot)
{
ACFire(%this, %obj, %slot);
}

And it works like a charm.

Thanks.