get damage inflicted
by N.K. · in Torque Game Engine · 03/28/2009 (5:49 am) · 3 replies
Hi,
If I were creating a game in which each player scores points for the amount of damage it inflicts on the opponent, how would I get the damage on the other player after one player fires the crossbow.
I thought of casting a ray just before firing the crossbow but the projectile takes time to reach the destination and the rays reach immediately. The opponent can have moved out of the way by the time the projectile reaches him.
Cheers,
N
If I were creating a game in which each player scores points for the amount of damage it inflicts on the opponent, how would I get the damage on the other player after one player fires the crossbow.
I thought of casting a ray just before firing the crossbow but the projectile takes time to reach the destination and the rays reach immediately. The opponent can have moved out of the way by the time the projectile reaches him.
Cheers,
N
About the author
#2
[bad_psuedo-code]
if(%obj = "player1")
{%this.sendScore = "player2")};
[bad_psuedo-code/]
If you want to trace who fired the projectile I believe that will require code changes in the engine (which requires paying for a license).
03/28/2009 (2:11 pm)
I've a "feeling" that projectiles get deleted before any chance of tracing who fired them, so if there are more than 2 players there might be a problem. (with just 2 players you can "sendScore" to the other player).[bad_psuedo-code]
if(%obj = "player1")
{%this.sendScore = "player2")};
[bad_psuedo-code/]
If you want to trace who fired the projectile I believe that will require code changes in the engine (which requires paying for a license).
#3
Oh, and what Michael said :P.
03/28/2009 (11:50 pm)
Scoring is dealt with already in stock TGE - Projectile objects have a 'source client' and this information is passed through the whole damage chain, right up to onDeath. So if you really wanted, it's probably possible to track detailed stats for each player - amount of damage done per weapon per enemy, etc.Oh, and what Michael said :P.
Associate Michael Hall
Distracted...