Author Topic: function GameConnection::OnDeath help  (Read 1937 times)

I am currently working on something that seems that it could use a level script.

I've recently found this function that is used a lot for this kind of stuff.

function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)

I was wondering what I could do with %killerPlayer, %killer, %damageType, and %damageLoc.
I don't understand what %damageLoc means though...   Though I just want to know how I could use this function for when I do make my level script.
« Last Edit: July 03, 2012, 02:12:52 AM by tkepahama »

%client; the client that died
%killerPlayer; the player object (if any) of the client that caused the death.
%killer; the client (if any) that caused the death.
%damageType; the type of damage as an index in the damage type array.
%damageLoc; should be location of damage, but Badspot configured the player model incorrectly so it's just always "body".

%client; the client that died
%killerPlayer; the player object (if any) of the client that caused the death.
%killer; the client (if any) that caused the death.
%damageType; the type of damage as an index in the damage type array.
%damageLoc; should be location of damage, but Badspot configured the player model incorrectly so it's just always "body".
This helped, thanks.

I have a feeling %killerPlayer is in fact the source object and could be a projectile, brick or player object, depending on the type of death. But I could be thinking of the wrong function (at least one of the death functions is like that).

I have a feeling %killerPlayer is in fact the source object and could be a projectile, brick or player object, depending on the type of death. But I could be thinking of the wrong function (at least one of the death functions is like that).
If I had to guess, I don't think it's this one. Because the class is gameconnection, I'm assuming this is what controls sending of kill messages and CI's.

These are the arguments that I use with ::onDeath:
Code: [Select]
function GameConnection::onDeath(%this,%obj,%killer,%type,%area)
I believe %obj is whatever object caused them to die.

But I could be thinking of the wrong function (at least one of the death functions is like that).

It could be player/armor::damage.