I'm trying to create a character that can inhale to power up their attacks, but that getting hit while inhaled causes them to be stunned. I have the ability to remove states on damage, that part's easy, but I don't know how to add a status effect after the state is removed.
How do I add an "on status removal" trigger?
RPG Maker VXAce SupportThis is an interesting topic. There are ways around it using events, but the optimal solution would be that of handling it using a script.
What can be done without using a script is using an end-of-turn event to check whether said character is affected by the inhaled state. If that is true, increase a variable to count the amount of turns the sate is active.
If the character is not affected by said state, check the variable and compare it with the state duration. If it is lower than that, the state has been forcefully removed and you have to perform all the operations you would perform on state removed, otherwise, the state has been removed normally and you do nothing.
Regardless of why it was removed, if the character is not effected by the state, you have to set the variable to 0 at the end of the branch to prepare it for next use.
Of course, this is not a perfect solution, the ideal solution would be that of having a common event perform this check and call it whenever enemy attacks are used, but for that you have to edit many skills and remember to call said common event on each o them.
What can be done without using a script is using an end-of-turn event to check whether said character is affected by the inhaled state. If that is true, increase a variable to count the amount of turns the sate is active.
If the character is not affected by said state, check the variable and compare it with the state duration. If it is lower than that, the state has been forcefully removed and you have to perform all the operations you would perform on state removed, otherwise, the state has been removed normally and you do nothing.
Regardless of why it was removed, if the character is not effected by the state, you have to set the variable to 0 at the end of the branch to prepare it for next use.
Of course, this is not a perfect solution, the ideal solution would be that of having a common event perform this check and call it whenever enemy attacks are used, but for that you have to edit many skills and remember to call said common event on each o them.
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-add-an-on-status-removal-trigger.151794/