Game Development Community

Destroying vehicles

by Alex Baaklini · in Torque Game Engine · 05/06/2003 (10:26 am) · 4 replies

Hi,

I need vehicles which take damage during collisions. I'm not sure if this functionality is in the Torque engine initially, but it doesn't seem to be in the modified engine I'm working on.

In updatePos() in vehicle.cc, I add an applyDamage(someDamage) function which is called for hard-collisions. The vehicle takes damage as it should, but it refuses to blow up and disappear when all it's health is gone.

Can anyone help me?

Thanks

#1
05/06/2003 (10:58 am)
Ok, got it.

I handled this in process tick and it worked. Guess it has something to do with program order.
#2
05/06/2003 (11:48 am)
The functions to handle destroyed vehicles were origionally in script.
#3
05/06/2003 (12:09 pm)
Actually works fine.. If you've replaced your player with a vehicle, then you need to look at the [vehicleclass]::onDisabled function. Otherwise, look at the [vehicleclass]::onDestroyed function. Plus, you may want to also look at [vehicleclass]::onImpact. These all appear to work just dandy once you know what is being called, and when.

- Brett
#4
05/06/2003 (12:22 pm)
Thanks guys,

In my haste and lack of sight, I was applying the damage to the client's version of the object and not the server's. It now works because I apply the damage to a server object. Guess I need to read up on these things.

The process tick thing I mentioned above worked because I was using a global variable which I guess the server's object was able to access.

Please disregard my earlier comment. I made that statement w/o fulling understanding what was going on.

Later