Game Development Community

Car Damage Ermitters

by CodingChris · in Torque Game Engine · 01/01/2007 (6:08 am) · 11 replies

Hi,
1. how to add damage ermitters to a car, that ever when the car crashed particles from the FXPack1 appear? I know there's a resource on this subject, but it does not work in my game.

2. Ever when the car crashed, is there more damage add to the car?

3. How to find out if there was a crash?

4. How to find out how big/heavy the crash was?

Hope for help.

#1
01/01/2007 (10:21 am)
Look at the onCollision callback.
#2
01/01/2007 (10:29 am)
I now have this one:
function WheeledVehicleData::onCollision(%this,%obj,%col,%vec,%speed)
{
   // Collision with other objects, including items
echo("Vehicle IS HIT");
  %obj.applyDamage(%speed/10);
}
This is not a really good sample, is there a better one?
#4
01/02/2007 (7:23 am)
Only this one:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3257
I try to use the FXPack1, but it doesn't work and my onCollision is not realistic I think.
#5
01/02/2007 (9:41 am)
Heres another that might also work for making the explosion or debris happen on impact. but as far as realistc collsions I think you would have to look into some physics code.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2884
#6
01/02/2007 (10:14 am)
Is it possible to do this resource as decal? Or better is a decalData possible in a vehicle datablock?
#7
01/02/2007 (12:16 pm)
Best thing to do is what they said in your other thread about the 'hide mesh resource'. You could use one of the resources above to throw out some debris, smoke, dust, dirt whatever, and then when needed switch out the models to show damage using hitboxes to determine which models get switched. You could also create mountPoints to mount even more debris to the car if you wanted, like a dragging tailpipe.. just a thought.
#8
01/02/2007 (12:17 pm)
Is there no decal possible?
#9
01/02/2007 (1:26 pm)
If you are wanting to apply a decal to a 3d object... I've seen a lot of threads with people trying to do that but the problem is when its applied it needs to conform to the 3d object, and the default decals in torque dont do that. If they do then correct me, but from what I've seen and read they dont. So I think you would have to change the engine code to do that and in my opinion it doesnt look realistic. To show damage I would change out the models and use particles, debris, explosions and damage emitters. Looks good, and is probably easier to code... seeing how theres already resources and people here who have already implemented it.
#10
01/02/2007 (8:39 pm)
Okay, then which tutorials would you use for Torque 1.5? I remember I did something and it all does not work .
#11
01/02/2007 (10:04 pm)
How to add that some particles are shown when the car heavy hits something? I thought about onCollision for doing this, but then when the car heavy crashs the terrain I could not get if the car hit anything. I want to do something like this(www.dark-wind.com/movies/DarkwindGameplayMovieNov2006_low.wmv). Could you say me how to do this.