Author Topic: dropping item after position is dead  (Read 976 times)

So basically using bot hole i have to drop a static item after the bot dies

I'm using the holeBotDamage function, and i have the set the transform of the item to where the bot died, but if its dead I can't get its position

any help?

Package armor::damage(%data, %player, %attacker, %pos, %damage, %type) and get the position before parenting. Don't forget to make sure that it's your bot that's dying. Pretty sure that %pos is the position where they were damaged(like where the projectile hit them).
« Last Edit: January 07, 2014, 07:22:56 PM by jes00 »

Package armor::damage(%data, %player, %attacker, %pos, %damage, %type) and get the position before parenting. Don't forget to make sure that it's your bot that's dying. Pretty sure that %pos is the position where they were damaged(like where the projectile hit them).
so don't use the holebotDamage function?

so don't use the holebotDamage function?
No, that's called after the bot is has been damaged. You need to package the function were the bot gets damaged and then get it's position before parenting so that it's before it dies. If you get the position after you parent it, the bot will already be dead.

This is a default event already?

Use Armor::OnDisabled(%this,%object). Try something like:

package yourPack
{
   function Armor::OnDisabled(%this,%object)
   {
      %pos = %object.getPosition();
      //Code here
      Parent::OnDisabled(%this,%object); //Package it after the code so that the object exists
   }
};
activatePackage(yourPack);

Use Armor::OnDisabled(%this,%object). Try something like:

package yourPack
{
   function Armor::OnDisabled(%this,%object)
   {
      %pos = %object.getPosition();
      //Code here
      Parent::OnDisabled(%this,%object); //Package it after the code so that the object exists
   }
};
activatePackage(yourPack);

Be sure to add a check to make sure that what is dying, is a bot.