Problem with enemies not dying....

I have an hit-all attack where I use common events to change the actor's sprite, and the change back to the default when the actor done with said attack. I've managed to get the animation stuff to work, but now the enemies won't die until another actor deals damage to them. I've tried using the collapse notetags and all that, but it doesn't work. Am I missing something and/or doing something wrong....?

Here's my code for the attack for reference (I've taken out the collapse notetag):


<Cast Animation: 0>
<RangedSkill>
<whole action>
<Action Setup>
Common Event: 1
</Action Setup>
perform start
motion standby: user
wait for movement
</whole action>

<target action>
motion standby: user
motion attack: user
wait: 10
action animation
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion swing: user
wait: 11
motion missile: user
wait for animation
action effect: enemies, existing enemies
move user: home, 20
face user: forward
break action
<Follow Action>
Common Event: 2
</Follow Action>
<Finish Action>
</Finish Action>
</target action>
If you disable all plugins, does it work correctly?

You are saying the enemy DOES die after another actor deals damage? Have you made any changes to state 1 in your database?
If you disable all plugins, does it work correctly?

You are saying the enemy DOES die after another actor deals damage? Have you made any changes to state 1 in your database?

Yes, the enemy does die after another actor deals damage, and, if you don't count changing the icon, I haven't done a thing to State 1. Also, do I just disable all plugins besides the ones needed for battle?
I am suggesting that you disable ALL plugins, then play, and see if the same thing happens. If it does, it indicates something you have set up about the battles is wrong, and that could be to do with a number of things in the database. If it doesn't happen when plugins are disabled, but it happens when they're enabled, then it's something about one or more of the plugins or the way you're calling them.
I am suggesting that you disable ALL plugins, then play, and see if the same thing happens. If it does, it indicates something you have set up about the battles is wrong, and that could be to do with a number of things in the database. If it doesn't happen when plugins are disabled, but it happens when they're enabled, then it's something about one or more of the plugins or the way you're calling them.

@Shaz Well, I don't think it's my plugins... I messed around with the attack code for a bit, and for some reason the sequence where the actor goes back to their default sprite(s) is what keeps enemies from being killed by the attack.....
I think its the common event code. Common events are done last and after checks for KO are done usually in the engine. You may need to add your own check for KO and apply KO yourself to that attack due to the common event.
I think its the common event code. Common events are done last and after checks for KO are done usually in the engine. You may need to add your own check for KO and apply KO yourself to that attack due to the common event.

How would I do that?
👋 Remove the empty <finish action> tag!

Empty tags replace the default action phase with nothing, and the default finish phase is for doing stuff like removing temporary invincibility, checking collapse, etc. 😴

Edit: also, move the </target action> tag so it is above the <Follow Action> block. Technically I don't think it'll make a difference, but these tags are not made to be nested.
Your action sequences are a mess, no offense.
  1. There is no <Action Setup> in action sequence-ese. It should be <Setup Action>
  2. <Setup Action>'s default stuff does a lot of things, and had you replaced it correctly with your own line, you're overwriting those things. Specifically:
    Code:
    Yanfly.BEC.DefaultActionSetup = [    ['CLEAR BATTLE LOG'],
    ['DISPLAY ACTION'],
    ['IMMORTAL', ['TARGETS', 'TRUE']],
    ['PERFORM START'],
    ['WAIT FOR MOVEMENT'],
    ['CAST ANIMATION'],
    ['WAIT FOR ANIMATION']
    ];
    Instead, use the first few lines of a <Whole Action> tag for any pre-attack stuff that only gets executed once unless you absolutely must overwrite the default instructions executed by <Setup Action>
  3. <Finish Action> also does some cleanup, one of which is resetting immortal flags (probably where the bulk of your issues are coming from) so...don't overwrite it unless you know what you're doing. Here's its default instructions:
    Code:
    Yanfly.BEC.DefaultActionFinish = [    ['IMMORTAL', ['TARGETS', 'FALSE']],
    ['WAIT FOR NEW LINE'],
    ['CLEAR BATTLE LOG'],
    ['PERFORM FINISH'],
    ['WAIT FOR MOVEMENT'],
    ['WAIT FOR EFFECT'],
    ['ACTION COMMON EVENT'],
    ];
    As with what I said about <Setup Action>, put any post-attack code into <Follow Action> instead of <Finish Action> unless you absolutely need to overwrite <Finish Aciton>'s instructions. I'm pretty sure <Follow Action> (which is empty by default) exists for that very reason.
  4. You have tags inside other tags. This may be fine for html, but this is not how note tags typically work with yanfly's plugins (or even mine, which have a similar <tag></tag> syntax)
  5. For action effect, you have: "enemies, existing enemies" but these are both the same thing. Just use one or the other, so: "action effect: enemies"
  6. Having "Break Action" as the last line of an action set is unnecessary. All it does is tell the code to skip any command for this particular action sequence that appears after it, but if its' the last command, there's nothing to skip.

Anyway I'm just going to go ahead and revise this for you (not testing it, that's up to you!) and hopefully it solves the problem. I'd suggest looking at how I formatted things to get a better idea of how it's supposed to look/work:

Code:
<Cast Animation: 0>
<RangedSkill>

<whole action>
Common Event: 1
perform start
motion standby: user
wait for movement
</whole action>

<target action>
motion standby: user
motion attack: user
wait: 10
action animation
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion swing: user
wait: 11
motion missile: user
wait for animation
action effect: enemies
move user: home, 20
face user: forward
</target action>

<Follow Action>
Common Event: 2
</Follow Action>
👋 Remove the empty <finish action> tag!

Empty tags replace the default action phase with nothing, and the default finish phase is for doing stuff like removing temporary invincibility, checking collapse, etc. 😴

Edit: also, move the </target action> tag so it is above the <Follow Action> block. Technically I don't think it'll make a difference, but these tags are not made to be nested.

Your action sequences are a mess, no offense.
  1. There is no <Action Setup> in action sequence-ese. It should be <Setup Action>
  2. <Setup Action>'s default stuff does a lot of things, and had you replaced it correctly with your own line, you're overwriting those things. Specifically:
    Code:
    Yanfly.BEC.DefaultActionSetup = [    ['CLEAR BATTLE LOG'],
    ['DISPLAY ACTION'],
    ['IMMORTAL', ['TARGETS', 'TRUE']],
    ['PERFORM START'],
    ['WAIT FOR MOVEMENT'],
    ['CAST ANIMATION'],
    ['WAIT FOR ANIMATION']
    ];
    Instead, use the first few lines of a <Whole Action> tag for any pre-attack stuff that only gets executed once unless you absolutely must overwrite the default instructions executed by <Setup Action>
  3. <Finish Action> also does some cleanup, one of which is resetting immortal flags (probably where the bulk of your issues are coming from) so...don't overwrite it unless you know what you're doing. Here's its default instructions:
    Code:
    Yanfly.BEC.DefaultActionFinish = [    ['IMMORTAL', ['TARGETS', 'FALSE']],
    ['WAIT FOR NEW LINE'],
    ['CLEAR BATTLE LOG'],
    ['PERFORM FINISH'],
    ['WAIT FOR MOVEMENT'],
    ['WAIT FOR EFFECT'],
    ['ACTION COMMON EVENT'],
    ];
    As with what I said about <Setup Action>, put any post-attack code into <Follow Action> instead of <Finish Action> unless you absolutely need to overwrite <Finish Aciton>'s instructions. I'm pretty sure <Follow Action> (which is empty by default) exists for that very reason.
  4. You have tags inside other tags. This may be fine for html, but this is not how note tags typically work with yanfly's plugins (or even mine, which have a similar <tag></tag> syntax)
  5. For action effect, you have: "enemies, existing enemies" but these are both the same thing. Just use one or the other, so: "action effect: enemies"
  6. Having "Break Action" as the last line of an action set is unnecessary. All it does is tell the code to skip any command for this particular action sequence that appears after it, but if its' the last command, there's nothing to skip.

Anyway I'm just going to go ahead and revise this for you (not testing it, that's up to you!) and hopefully it solves the problem. I'd suggest looking at how I formatted things to get a better idea of how it's supposed to look/work:

Code:
<Cast Animation: 0>
<RangedSkill>

<whole action>
Common Event: 1
perform start
motion standby: user
wait for movement
</whole action>

<target action>
motion standby: user
motion attack: user
wait: 10
action animation
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion attack: user
wait: 11
motion swing: user
wait: 11
motion missile: user
wait for animation
action effect: enemies
move user: home, 20
face user: forward
</target action>

<Follow Action>
Common Event: 2
</Follow Action>

@Aesica @caethyril Thanks to both of you for the help and advice. 🙂 And yeah, I figured my code was a bit sloppy. But I also had "break action" included due to me having problems with the attack repeating. Can I still use that notetag or no....?


EDIT: Never mind, I put it in a break action and it still worked just fine. So, once again, thanks for all your help!
It shouldn't be repeating unless you have something else going on. Note that of the two, <Whole Action> executes once for all targets while <Target Action> executes once for each target. So if your targeting is set to "all enemies" and you have 3 enemies in the troop, everything in the <Target Action> block is going to execute 3 times. Typically, you want AoE effects to be done through <Whole Action> instead.

Anyway glad you got it sorted out.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-enemies-not-dying.131272/