Author Topic: onDeath on AIPlayer?  (Read 667 times)


It doesn't. That's a stupid way to do it when you set a bot's client to itself.

Use an AIConnection.

How would I do it when I want it to check whether its mounted on a horse and if it is, it should kill the horse.

Armor::onDisabled
%obj.getObjectMount()

Armor::onDisabled
%obj.getObjectMount()

%obj.getObjectMount().kill(); ? It doesnt work.


Code: [Select]
package KillHorseOnDeath
{
function AIConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %unknownA)
{
if(%client.getobjectmount().getclassname() $= "AiPlayer")
{
%client.getobjectmount().kill();
}

parent::onDeath(%client, %player, %killer, %damageType, %unknownA);
}
};
activatePackage(KillHorseOnDeath);
« Last Edit: September 13, 2009, 11:12:35 AM by Jaydee »

Does your bot actually have an AIConnection?

Ooops, AIConnection I mean.



Did you create an AIConnection object for it? If you haven't specifically done so then your code will be useless.

Did you create an AIConnection object for it? If you haven't specifically done so then your code will be useless.

I just use Rot's zombie system.

That's probably a no, then.