Game Development Community

Explosion field in NetObject doesn't propagate?

by Danni · in Torque 3D Professional · 04/18/2011 (5:14 pm) · 3 replies

I have the following problem; I added a field to NetObject which is an ExplosionData object.

void NetObject::initPersistFields()
{
   addField("ballisticImpactEmitter", TypeExplosionDataPtr, Offset(ballisticImpactEmitter, NetObject),"Explosion Effect");
	Parent::initPersistFields();
}

Ingame i can see this on all objects as intended and setup a waterplane with an explosion assigned. In the scripts it is properly retreivable; however in the following code it is always NULL;

void NetObject::BallisticImpactEmitter(Point3F& position, Point3F& vector)
{
	if (!ballisticImpactEmitter)
		return;
.....
}

This code worked in TGEA and TGE, but not T3D. Any ideas why?

#1
04/18/2011 (6:51 pm)
Disregard; i fixed it. The field was not populated on the client object and had to send it via network.
#2
04/19/2011 (6:54 am)
Quick note: NetObject doesn't seem like the logical place to apply this. Consider moving it to SceneObject?
#3
04/19/2011 (4:35 pm)
Yeah; i originally had it there but started moving it around to figure out why it wasn't working; netObject already had packUpdate/unpack where as sceneObject didn't.