Game Development Community

Datablock inheritence

by gamer · in Torque Game Engine · 10/13/2006 (6:09 pm) · 3 replies

I have
datablock ProjectileData (pchild:pParent){

}
function pParent::onCollision(%this,%obj,%col,%fade,%pos,%normal){

}

it doesn't seem to work in the sense that pParent::onCollission is not called when the pchild projectile gets fired onto something. the function does get called pParent projectile gets fired onto something work of course.

does datablock inheritence only copies data over and serves no other purpose?
thanks

#1
10/14/2006 (2:38 pm)
The calling up to base functions does not happen automatically when you override functions. You will have to call Parent expliticly.
#2
10/15/2006 (4:12 am)
Something wrong with your code see the datablock ProjectileData (pchild:pParent)

whats the difference with my code and yours, my code:

datablock ProjectileData(pchild::pParent)

your code:

datablock Projectiledata(pchild:pparent)

notice the "::" with myn and yours has ":"
#3
10/15/2006 (1:06 pm)
Saska,
yes, sorry that was a typo in the post, but I had datablock ProjectileData (pchild::pParent) in my actual code. Thanks!