MV Help with "if" condition when attack is missed

I'm relatively new to RPG Maker and I wanted to have some unique attacks that backfire on the player if they miss, like "if you hit, the enemy loses all accuracy for 3 turns, but if you miss, then you get frozen for 2 turns".
I've been using Yanflys Plugins like BattleEngineCore, ActionSequencePack1 and SkillCore to try and include this effect. But everything I do doesn't seem to work and after reading through every thread I could find I've still not found anything that actually works.
I was hoping I could find some help here. I've figured that putting "a.addState(13)" in the notes makes the effect happen, I just can't figure out how to make that effect happen if the attack misses.

I've tried a bunch of different scripts but here's the one I assume should be working


<Post-Damage Eval>
if (result.missed || result.evaded){
a.addState(13)
}
</Post-Damage Eval>



I've tried several variations of this but none seem to work, I'd really appreciate some help on this.
I'm relatively new to RPG Maker and I wanted to have some unique attacks that backfire on the player if they miss, like "if you hit, the enemy loses all accuracy for 3 turns, but if you miss, then you get frozen for 2 turns".
I've been using Yanflys Plugins like BattleEngineCore, ActionSequencePack1 and SkillCore to try and include this effect. But everything I do doesn't seem to work and after reading through every thread I could find I've still not found anything that actually works.
I was hoping I could find some help here. I've figured that putting "a.addState(13)" in the notes makes the effect happen, I just can't figure out how to make that effect happen if the attack misses.

I've tried a bunch of different scripts but here's the one I assume should be working


<Post-Damage Eval>
if (result.missed || result.evaded){
a.addState(13)
}
</Post-Damage Eval>



I've tried several variations of this but none seem to work, I'd really appreciate some help on this.
Post-Damage Eval only happens if damage was dealt. What doesn't happen if the attack misses or is evaded? 😉 Also is "result" definitely an identifier that's exposed via the notetag?
Post-Damage Eval only happens if damage was dealt. What doesn't happen if the attack misses or is evaded? 😉 Also is "result" definitely an identifier that's exposed via the notetag?
yeah the entire time doing this I was wondering if the Post Damage Eval was actually working if the attack missed, that's just what I saw other people doing so assumed that's what I had to do! I'm guessing I'm wrong lol. And yeah same with the "result", I just saw other people doing that and thought that's what I had to do. I don't suppose you know what else I should use in the notetag?
I'm busy clearing up for D&D at the moment but if nobody's answered when the session's over I'll look it up for you. 🙂
I'm busy clearing up for D&D at the moment but if nobody's answered when the session's over I'll look it up for you. 🙂
Ay thanks pal I'd really appreciate that! I'll do some looking around myself as well to see if I can figure anything out, but if not, thanks in advance!
Ay thanks pal I'd really appreciate that! I'll do some looking around myself as well to see if I can figure anything out, but if not, thanks in advance!
its as Trihan said. post damage evals only run if damage was dealt, but after evals run regardless. you could try something along these lines

Code:
<After Eval>
if (target.result().missed || target.result().evaded)
  user.addState(13);
</After Eval>
its as Trihan said. post damage evals only run if damage was dealt, but after evals run regardless. you could try something along these lines

Code:
<After Eval>
if (target.result().missed || target.result().evaded)
  user.addState(13);
</After Eval>

Just tried it out and it worked! Thanks I really appreciate it!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-if-condition-when-attack-is-missed.165649/