Dusk
05-02-2008 20:30:59
Hi everybody, this is my first post 
I'm working on a worms-inspired 3d game using NxOgre - thankyou betajen!
Many things are working well, but now I'm not sure of how to implement the damage system.
Example:
I have a grenade body and many bodies for each member of the teams.
At each turn you select a member of your team, move it and shoot.
(When you select your player, the body is swapped with a Character and swapped back when you stop and shoot...)
Each member has a "life" that should be decreased by collisions and forces...
for example if he falls down somewhere, or is hit by the bomb (directly before it explodes, and by a force from the center of the BOOM), or if the explosion makes a breakable object fall above it.
What's the best way to implement it? Can someone point me in the right direction?
I was thinking about some kind of handler/callback when a force is applied to a body. I don't know if it can be done. I considered characterHitReport, but I'd have to change all members from bodies to characters and it wouldn't work either with forces from explosions, when there's not a direct collision. Of course I could't handle them separately...
If this can be the solution, is there any way to make the Characters react like Bodies? I hope I haven't to do all the math by myself in CharacterHitReport...
Sorry for my poor english, and greetings from Italy!

I'm working on a worms-inspired 3d game using NxOgre - thankyou betajen!
Many things are working well, but now I'm not sure of how to implement the damage system.
Example:
I have a grenade body and many bodies for each member of the teams.
At each turn you select a member of your team, move it and shoot.
(When you select your player, the body is swapped with a Character and swapped back when you stop and shoot...)
Each member has a "life" that should be decreased by collisions and forces...
for example if he falls down somewhere, or is hit by the bomb (directly before it explodes, and by a force from the center of the BOOM), or if the explosion makes a breakable object fall above it.
What's the best way to implement it? Can someone point me in the right direction?
I was thinking about some kind of handler/callback when a force is applied to a body. I don't know if it can be done. I considered characterHitReport, but I'd have to change all members from bodies to characters and it wouldn't work either with forces from explosions, when there's not a direct collision. Of course I could't handle them separately...
If this can be the solution, is there any way to make the Characters react like Bodies? I hope I haven't to do all the math by myself in CharacterHitReport...
Sorry for my poor english, and greetings from Italy!