Question about force action

Is there a way to make the enemy do a forced action without first doing a regular attack first. I want to make an enemy Bee when he has 50% or less health attack with stinger which hits all players, than I want the Bee to die. I put Battle Event condition on the troops page to Enemy HP (1) <= 50%.


Than I put force action for the Bee to do the stinger move than I change his state to Knockout. For some reason he attacks and then does stinger. Also I want him to do the forced action right away and not at some random time which he seems to be doing.
I'd suggest you just make it so it attacks normal, just with a high priority when hp is low.


Because else the player got no change to stop it.


But there is always  http://yanfly.moe/2015/10/30/yep-22-instant-cast-2/
do not use troop events and force actions for this - that is what the attack patterns are used for.


Just add the stinger skill to the attack pattern of the bee, with a condition based on HP values and a high attack rating to guarantee that skill is used when the condition is fulfilled.


The skill execution order can be changed by incrasing the skill speed  the more speed you add, the earlier the skill is used in the turn.
Alright that worked fine, thank you.


I have one more problem. I want the bee to die after he does the Stinger move. I have tried putting this in the attack formula a.addState(1); with 1 being Knockout . I have also tried a.die(); as well. It kills the bee but the bee doesn't disappear. Is there any way to fix this.
the code to override the effects in the damage formula might get outside the regular updates, that's why it might not register with the display that the enemy is already dead.


Depending on the battleplugin you used you might need a different command sequence - I can't tell you that.
Thanks for the answer. I guess I'm going to keep trying to find a way to make the enemy die after using the stinger attack.


when I used the troop Battle event to do it I was able to use change enemy state in the event commands to make the enemy disappear by applying the knockout state there. I wonder if there is a way around this. I guess I'll keep experimenting.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-force-action.69456/