Greetings! I have a question regarding Yanfly's Buffs and States Core http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/ and its use for transformation states http://yanfly.moe/2016/07/06/tips-tricks-actor-transformations-rpg-maker-mv/
Specifically, I was interested in the fact that the Custom Remove Effects do not work if the state is removed via death (State 001, the default KO or death state). I have a character who transforms and becomes more powerful through transformation states and each transformation alters her appearance. This is working fine, but if she dies, I would like for her battler image to revert to its default appearance.
Normally, her appearance does revert to its default if the state is removed via dispelling it during battle, or when battle ends. However, it seems that Custom Remove Effects do not trigger if the state is removed via the application of the death or KO state.
The only solution I could come up with is adding a Custom Apply Effect to the death state that will check if the death state is being applied to her, and if it is, change her battler image to the default. I added the following Custom Apply Effect to the KO state:
<Custom Apply Effect>
if (user.actorId() === 8) {
user.setBattlerImage('Rei');
}
</Custom Apply Effect>
This worked just fine except for one problem: as I suspected, it didn't really jive when the death state was applied to an enemy, so every time the player defeats an enemy, a console error would appear (not a crash, just a console error). I know pretty much nothing about javascript, so I'm 99% certain the problem is just syntax or something with my Custom Apply Effect. I would like for it to just check if the entity that died is the actor in question, and simply do nothing if it's not. As I said, the effect works exactly as I intended it, but I get a console error every time an enemy is defeated.
Either I need to fix the Custom Apply Effect to the death state so that the game is not attempting to carry it out on enemies, OR is there something I can do with the actual transformation state so that it's Custom Remove Effect will work if the state is removed by death?
Specifically, I was interested in the fact that the Custom Remove Effects do not work if the state is removed via death (State 001, the default KO or death state). I have a character who transforms and becomes more powerful through transformation states and each transformation alters her appearance. This is working fine, but if she dies, I would like for her battler image to revert to its default appearance.
Normally, her appearance does revert to its default if the state is removed via dispelling it during battle, or when battle ends. However, it seems that Custom Remove Effects do not trigger if the state is removed via the application of the death or KO state.
The only solution I could come up with is adding a Custom Apply Effect to the death state that will check if the death state is being applied to her, and if it is, change her battler image to the default. I added the following Custom Apply Effect to the KO state:
<Custom Apply Effect>
if (user.actorId() === 8) {
user.setBattlerImage('Rei');
}
</Custom Apply Effect>
This worked just fine except for one problem: as I suspected, it didn't really jive when the death state was applied to an enemy, so every time the player defeats an enemy, a console error would appear (not a crash, just a console error). I know pretty much nothing about javascript, so I'm 99% certain the problem is just syntax or something with my Custom Apply Effect. I would like for it to just check if the entity that died is the actor in question, and simply do nothing if it's not. As I said, the effect works exactly as I intended it, but I get a console error every time an enemy is defeated.
Either I need to fix the Custom Apply Effect to the death state so that the game is not attempting to carry it out on enemies, OR is there something I can do with the actual transformation state so that it's Custom Remove Effect will work if the state is removed by death?