MV Yanfly Action Sequences Checking for Hit, Miss, or Evade...

So I have tried a few different combinations of the following tags and I can't get them to work as intended... Other if...else... statements seem to work fine except one's related to Hit, Miss, or Evade. I've tried various things I've seen on the forums, but nothing is working as it should. Yanfly's Action Sequences allow for if... else statements in case you didn't know.


if target.result().isHit() = It should only do the attack if the target is hit right? but it will do it hit or miss

also if (target.result().hpDamage > 0) doesn't seem to help either...

if target.result().missed || target.result().evaded seems to work, but when I put an else in there for if it does hit... it starts to trigger the move even if it missed now, which it won't do if I don't put an else in there.

if !target.result().missed || !target.result().evaded I tried this as I think I remember ! means basically to check if it doesn't miss or evade. Correct me if I'm wrong on that one.

basically anything that's only suppose to happen on hit, doesn't work right. it always seems to do it if it hits or misses unless I use the one strictly for missing... but then an else statement messes that up. if anyone knows what I'm doing wrong, I'd love the assist. thanks everyone.
Nested ifs in action sequences don't work.
Since you didn't post your action sequence, it's hard to tell that's the problem here, but it sounds like it. SergeofBIBEK has a plugin to correct this. Try that and see if it helps.
I actually am using that plugin lol, I realized I needed to, to even attempt some of the stuff I was trying to do with if... else statements. but while the sequence doesn't crash or anything, it doesn't quite work as intended either. BUT, I found an odd work-around that did in fact work...


if (target.isStateAffected(x))... I used a dummy state that doesn't popup at all during the fights and is added like normal if the attack hits through MV's normal add state option. but otherwise, I can't get anything to work QUITE as I intend it to. here's one of the action sequences.


<target action>

jump user: 100%, 24

motion skill: user

wait: 12

motion attack: user

wait: 8

VOICE user: heavy

action animation: target

wait: 8

action effect



if target.result().isHit()

eval: Rumble(0.6,0.2,500)

motion spell: user

animation 162: user

wait for animation

add state 21: user, show

end

wait: 24

</target action>
I couldn't get serge's plugin working with my project so I started using switches to solve my nested if problem. Didn't think about using states but I guess it all works out.


if $gameSwitches.value(id, true)
action effect

if target.result().missed
MOTION GUARD: target

else

if $gameSwitches.value(id, true)
MOTION DAMAGE: target

end

Now I'm trying to figure out how to get 'if target.result().missed' to work with MZ since visustella action sequences are common event based now.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequences-checking-for-hit-miss-or-evade.128367/