MV How to add a self-destruct skill to an enemy?

So the title is a little misleading, as I've already followed the steps as shown here and got results https://forums.rpgmakerweb.com/index.php?threads/how-to-suicide-sacrifice-skill.100292/

However just as the maker of that thread, I have a problem with how this does not make the enemy sprite disappear from battle after they self-destruct; it looks bad.

Any way to fix this, someone?

I also have YEP's Battle Engine Core and Action Sequence Pack 1 and 2 plugins installed in my project, and I saw another tutorial that used it, but it didn't work out for me. However there is a chance I followed it wrong. In a bit of a rush.
So the title is a little misleading, as I've already followed the steps as shown here and got results https://forums.rpgmakerweb.com/index.php?threads/how-to-suicide-sacrifice-skill.100292/

However just as the maker of that thread, I have a problem with how this does not make the enemy sprite disappear from battle after they self-destruct; it looks bad.

Any way to fix this, someone?

I also have YEP's Battle Engine Core and Action Sequence Pack 1 and 2 plugins installed in my project, and I saw another tutorial that used it, but it didn't work out for me. However there is a chance I followed it wrong. In a bit of a rush.
Try a.gainHp(-c) instead of using addState.
Try a.gainHp(-c) instead of using addState.
Thank you for the quick reply! Maybe I put the code in wrong? At first I tried

c = a.hp; a.gainHp(-c); c

But no dice, so I tried

c = a.hp; a.gainHp(-c)

Still nothing. I'm not very knowledgeable on how this works, sorry.
Thank you for the quick reply! Maybe I put the code in wrong? At first I tried

c = a.hp; a.gainHp(-c); c

But no dice, so I tried

c = a.hp; a.gainHp(-c)

Still nothing. I'm not very knowledgeable on how this works, sorry.
Should be the first one, but "no dice" unfortunately means nothing to me from this end where I can't see your game. When stating that something doesn't work, you should try to always outline what didn't happen that should, or what did happen that shouldn't, or the person trying to help you has nothing to work with. ^_^
Should be the first one, but "no dice" unfortunately means nothing to me from this end where I can't see your game. When stating that something doesn't work, you should try to always outline what didn't happen that should, or what did happen that shouldn't, or the person trying to help you has nothing to work with. ^_^
Uhm... well, the problem still is that the enemy's sprite does not disappear after they've self-destructed.
I don't believe the self-destruct has been done in an unusual way, it doesn't even cause a State. But you can judge for yourself
Uhm... well, the problem still is that the enemy's sprite does not disappear after they've self-destructed.
I don't believe the self-destruct has been done in an unusual way, it doesn't even cause a State. But you can judge for yourself
Ah, apologies; gainHp doesn't do the sprite change, it's part of the interpreter command.

Add a.performCollapse() after the gainHp call, before the "c" return value:

JavaScript:
let c = a.hp; a.gainHp(-c); a.performCollapse(); c

(added a let to c as well, because otherwise you're creating a global variable)
Ah, apologies; gainHp doesn't do the sprite change, it's part of the interpreter command.

Add a.performCollapse() after the gainHp call, before the "c" return value:

JavaScript:
let c = a.hp; a.gainHp(-c); a.performCollapse(); c

(added a let to c as well, because otherwise you're creating a global variable)
Thank you so much! Works perfectly now
Yanfly's battle plugs have collapse options, make sure they are configured as you wish, and make sure the battler is a collapsible type.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-a-self-destruct-skill-to-an-enemy.178326/