Game Development Community

Vehicle damage application problem

by Kimberly Unger · in Torque Game Engine · 03/08/2004 (5:45 pm) · 2 replies

Hi;

We are having a problem with inflicting damage on a vehicle that is also our player. When ever a projectile hits the vehicle (onCollision) we call the damage() function and get the error message in the log.

if (%col.getType() & $TypeMasks::ShapeBaseObjectType)
   {
       %col.damage(%obj,%col, %pos,%this.directDamage, "Missile");
   }

P51/server/scripts/rocketLauncher.cs (760): Unknown command damage.
Object (1580) FlyingVehicle -> Vehicle -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject


Can anyone tell me what the error message is trying to tell me and how to fix it?

Thanks
Beau (Kim's Programmer)

#1
03/09/2004 (2:49 pm)
Basically that means that torque cannot find any function named CLASS::damage(), where class is one of the object classes that the error lists. what you need is to name your damage function; vehicle::damage() (Of course if you need different damage functionality between different vehicle classes you could name it FlyingVehicle::damage() or HoverVehicle::damage(), or any other classname for an object thats a member of the vehicle class)

Conversely, if you have a function named Vehicle::Damage() ensure that the file containing it does not have a syntax error in it, thus keeping the function from actually loading.
#2
03/09/2004 (3:35 pm)
Thanks a million. That information I needed.

Beau