MV How to check if an attack will land, before the attack does the damage pop up.

Hey all, been racking my brain trying to figure this out but spent too long on it at this point with no real results so hoping someone knows more then me.

I'm using Yanfly's action sequence, (And Irina's action Impact, for projectiles) to add more flare to character skills, and a part of the sequences I've made is different animations for when the character misses. For example there is this clown who throws a pie projectile, and I've made two sequences one for misses and one for hits.

Thinking I could use a simple "if target.result().isHit()" "else" to dictate which sequence route to go down, however I forgot that these only apply after the 'action effect' part of a sequence, which I cant have earlier as the damage number pops up before the projectile lands on screen, and kinda spoils the animation as I've made them to look simular up to a point so you think it's going to land until the last second.

Anyways, heres the action sequence script
1736133440432.png

I've tried a few work around trying to utilise the yanfly buffs and state core's react effect but I cant figure anything out.

If anyone has any way of figuring out if your going to actually hit the target during the setup? or maybe a faux/delayed 'action effect' type thing which gives all the information to the if statement but doesnt show the damage numbers until the sequence is finished.

I'm also interested if we can do the same thing for critical's if possible, having another sequence that looks noticeably stronger would be cool.

Thanks for any help, if any one knows anything on this.
If anyone has any way of figuring out if your going to actually hit the target during the setup?
never tried it, but this might work:

if you use yanfly's hit accuracy plugin you could adjust your hit formula so that on top of whatever it is, if some property on the action itself is explicitly true or false itll always hit or miss.
Code:
this._forceHit===true ? 1 : this._forceHit===false ? 0: (DEFAULT HIT FORMULA)

then within your action sequence, you could use the result a random roll against action.itemHit(target) to write said property before you call the action effect.
Code:
eval: action._forceHit = action.itemHit(target) < Math.random();

thatll create a way to project if the skill hit, you could do action sequence stuff ahead of time based on that property, and when the action effect goes off itll use the predetermined property for the hit check instead of calculating it at the time
I couldn't get your solution working, however installing and reading through the hit accuacy plugin gave me an idea which ended up working out.

I essentially simulated my own chance of hitting putting the users hit rate against the targets evasion rate and using a random Interger from 1-100 simulating the random chance to hit.

If the random chance ends up higher then the hit chance, ei typically 90%; the user is given a state that forces them to miss, if not they will get a state that forces a hit!

And the rest is just the sequence checking for those states.

1736192290686.png


So thank you for recommending the hit accuracy plugin!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-an-attack-will-land-before-the-attack-does-the-damage-pop-up.174459/