Author Topic: Death Animations  (Read 1111 times)

So, I finished my other problem, and the playertypes are going pretty well, except for one problem.  When they play the death animation when they die, it works, except for when they are walking.  If it's playing another animation and they die, it glitches up and shows the two animations at once.  If you know how to solve this problem, please reply.

Edit: Also, do you know how to make a script so that when the playertype dies, it commands in to play the animation "Death"?
I tried this, but it didn't work:
Code: [Select]
package fixanim
{
   function GameConnection::onDeath(%this, %obj, %sourceObject, %sourceClient, %damageType, %damLoc)
    {
Parent::onDeath(%this, %obj, %sourceObject, %sourceClient, %damageType, %damLoc);

      %this.playthread(2, root);
}
};
activatepackage(fixanim);
« Last Edit: August 15, 2010, 05:16:40 PM by Chao »

Make the 2 a 0.

Code: [Select]
%this.playthread(2, root);to
Code: [Select]
%this.playthread(0, root);

It said it couldn't find the function "playThread".

%this.player.playThread(0,root);

I used this:
Code: [Select]
package fixanim
{
   function GameConnection::onDeath(%this, %obj, %sourceObject, %sourceClient, %damageType, %damLoc)
    {
Parent::onDeath(%this, %obj, %sourceObject, %sourceClient, %damageType, %damLoc);

      %this.player.playthread(0, root);
}
};
activatepackage(fixanim);
And got this in console:
Code: [Select]
Add-Ons/Player_MapleStoryMobs/server.cs (0): Unable to find object: '0' attempting to call function 'playThread'
BackTrace: ->serverCmdSelf Delete->Player::kill->ShapeBase::Damage->Armor::Damage->[fixanim]GameConnection::onDeath

use YourDatablockNameHere::onDisabled(%data, %obj, %enabled) instead, so it works on bots using your datablock and not just players. (It would also probably solve your problem.)

Ok Amade, I did what you said, but It just did the same thing as when I started.
This is the code I used this time:
Code: [Select]
package fixanim
{
   function OrangeMushroomArmor::onDisabled(%data, %obj, %enabled)
    {
Parent::onDisabled(%data, %obj, %enabled);

      %obj.playthread(0, root);
}
};
activatepackage(fixanim);
I also tried replacing
Code: [Select]
%obj.playthread(0, root);with
Code: [Select]
%obj.playthread(0, death1);But it still just played both the running and death thread when I died when I was running.

Try using %obj.setVelocity("0 0 0");

Set the death animation so it doesn't blend with others, perhaps. It's an option in the DTS exporter usually.

I'm using this, but it's not working:
Code: [Select]
package fixanim
{
   function OrangeMushroomArmor::onDisabled(%data, %obj, %enabled)
    {
Parent::onDisabled(%data, %obj, %enabled);

      %obj.playthread(0, root);
      %obj.setVelocity("0 0 0");
}
};
activatepackage(fixanim);

Also, Space Guy, there is a blend option, but I turned it off.

Oh!  I just went back to my Milkshape DTSplus exporter and told it that when the animation blends, use keyframe 1.  And it's not glitchy anymore!  The only thing is that when it's on the ground, it keeps playing the running animation.