// Edit - I figured it out, i had to add another dying state for it.
First off sorry to be asking so many questions lately, I have had a lot of time to mess around with this stuff.
I created an alternate death animation for an enemy, and I am trying to give it a chence to happen with every kill.
I made the action
action APIGSHOTGUN 3592 5 1 1 15
and I created the ai
ai AIPIGSHOTGUN APIGSHOTGUN PIGSTOPPED faceplayer
Then I added it to the checkpighitstate section in the con file as
state checkpighitstate
spawn BLOOD
ifdead
{
ifspritepal 10 { endofgame 52 state standard_jibs killit break }
state random_wall_jibs
ifwasweapon SHRINKSPARK { }
addkills 1
ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy }
else ifwasweapon RPG { sound SQUISHED state standard_jibs state delete_enemy killit }
ai AIPIGDYING sound PIG_DYING
ifrnd 43
ai AIPIGSHOTGUN sound PIG_DYING
}
else
{
sound PIG_PAIN
state random_wall_jibs
}
ends
I know it probably isn't the normal way of doing that, but it seems to have worked where about 1 in 4 times it uses the alternate death animation, but when it does it just keeps repeating the animation indefinitely.
Page 1 of 1
Repeating death animation
#1 Posted 01 April 2020 - 03:50 PM
This post has been edited by 11bush: 01 April 2020 - 04:20 PM
#2 Posted 01 April 2020 - 04:20 PM
try changing
to
ai AIPIGDYING sound PIG_DYING ifrnd 43 ai AIPIGSHOTGUN sound PIG_DYING
to
ifrnd 43 ai AIPIGSHOTGUN sound PIG_DYING else ai AIPIGDYING sound PIG_DYING
Share this topic:
Page 1 of 1