Game Development Community

Ai Death Message help....

by Donnie Hutson Jr · in Torque Game Engine · 06/02/2010 (11:06 am) · 2 replies

Hey all, I was wondering if anyone could help me figure out how to display a message when the bot dies, like for example;
Enemy=name of my bots
Highground=name of player

message to player would be like this;

Enemy was killed by Highground with a M4a1 at 400 meters.


M4a1 would or could be any weapon that was used by the player to kill the bot and would also like to give the player the distance at which the player shot the bot. Thanks in advance for any help or advice....

I've been trying everything to get this going and I know it has to do with the ondeath and bot damage functions, but I just can't get it. I cant even get my bot to echo a comment out to console when it dies....Any help would be great. Thanks in advance.

About the author

Army at 17, proud papa and husband of the most amazing woman I have ever met!! Electrical Engineer by trade, Computer geek by night. Still learning and loving every minute.


#1
06/03/2010 (11:26 am)
You can also work with dynamic fields on the server.

Your projectile has a onCollision-Callback. This way you can decrease the health of the bot.

Maybe:

%bot.health -= %theProjectile.damageValue;

if (%bot.health <= 0)
{
   %projectileOwner = %theProjectile.owner;
   %message = %bot.playerName @ " was killed by " @ %projectileOwner.getName();
   // send %message to all the connected clients (if MP)
}

Something like that.
#2
06/03/2010 (1:08 pm)
Cool, will try......Thanx Thomas