Game Development Community

Melee System not calling code in script

by Caleb · in Torque Game Engine · 12/29/2006 (12:59 pm) · 2 replies

After following the Server Side Melee System, I thought I was done with all this. After testing and testing, I found that the UpdateImageRaycastDamage() function was being called, but the onImageIntersect was not.

I put this at the start of the UpdateImageRaycastDamage code:
Con::errorf(ConsoleLogEntry::General, "UpdateImageRaycastDamage has been called");
As you might expect, this prints "UpdateImageRaycastDamage has been called" hundreds of times in the console. After that I also put this in the start of onImageIntersect:
echo("WeaponImage::onImageIntersect has been called");
However, this does nothing. If anyone has any thoughts on this matter, Pleeeeease post.

#1
12/29/2006 (4:53 pm)
One reason that I can think of is that the damageStart and damageEnd nodes are missing on your weapon model, or they have the wrong position (damageEnd should be close to the handle, damageEnd close to the tip of the weapon, if I remember correctly).
You also might want to have a look at
void ShapeBase::UpdateImageRaycastDamage( F32 dt,U32 imageSlot)
and put some Con:errorf/breakpoints in there to see were the problem is.
#2
12/29/2006 (5:41 pm)
Well, my sword was setup OK, but I think that I didn't set one of my points to export as a node.
Its being called now.

Thanks Stefan.