MV Different weapon animation when attack misses or is parried.

Hello everyone, I'm trying to figure out a way to play a different weapon animation if the attack misses. The attack animation I'm using shows a slash that has blood spilling. It's weird that the blood still appears if the attack missed or is parried. Also I'd like this to work for when actors and enemies miss/get parried.
If you guys have an idea of plugin that I can use or how to configure, It'd be much appreciated.
You should be able to do this if you program your skills using Yanfly's Action Sequences.

In the action sequence, where you want to show the animation, you can do:
Code:
if target.result().missed
    animation x: target
else if target.result().evaded
    animation y: target
else
    action animation
end
where X and Y are the IDs of your other animations, no leading zeros.
You should be able to do this if you program your skills using Yanfly's Action Sequences.

In the action sequence, where you want to show the animation, you can do:
Code:
if target.result().missed
    animation x: target
else if target.result().evaded
    animation y: target
else
    action animation
end
where X and Y are the IDs of your other animations, no leading zeros.
Thank you so much, I'll try that and I'll report if it works!
You should be able to do this if you program your skills using Yanfly's Action Sequences.

In the action sequence, where you want to show the animation, you can do:
Code:
if target.result().missed
    animation x: target
else if target.result().evaded
    animation y: target
else
    action animation
end
where X and Y are the IDs of your other animations, no leading zeros.
I tried as a target action but it's showing the animation regardless if I hit or miss and it doesn't cause damage. As a setup action or finish action it plays the animation twice. Is there anything I'm missing here?
I tried as a target action but it's showing the animation regardless if I hit or miss and it doesn't cause damage.
Because you haven't followed the plugin instructions to code the entire skill.

If there's no action effect first, there is no hit roll and no damage executed. You can't just put in the part I gave you, you need to program the entire skill. I just gave you the portion that wouldn't be in Yanfly's instructions.

As a setup action or finish action it plays the animation twice.
Because then the default target action which plays the animation and performs the action hit is also happening in addition to the setup/finish action.
Because you haven't followed the plugin instructions to code the entire skill.

If there's no action effect first, there is no hit roll and no damage executed. You can't just put in the part I gave you, you need to program the entire skill. I just gave you the portion that wouldn't be in Yanfly's instructions.


Because then the default target action which plays the animation and performs the action hit is also happening in addition to the setup/finish action.
So I made the adjustments yet the animation still plays. From what I read on Yanfly's script:

action effect = makes the skill happen (It's working when hits)
break action ends the sequence = It's not working, also even if the targe miss or evades it still shows the normal animation.

On the attach how I set the skill.
break action ends the sequence
I don't understand why you would want to add break action there. What is the logical purpose?

As for the rest...please see what I told you last time.
If there's no action effect first, there is no hit roll and no damage executed.
You still do not have action effect occurring before you're checking whether it was a hit/miss/evade.

Just to note, there's no reason to have three different conditionals if two of them are the same. Just connect them with JavaScript's OR:
Code:
if target.result().missed || target.result().evaded
I don't understand why you would want to add break action there. What is the logical purpose?

As for the rest...please see what I told you last time.

You still do not have action effect occurring before you're checking whether it was a hit/miss/evade.

Just to note, there's no reason to have three different conditionals if two of them are the same. Just connect them with JavaScript's OR:
Code:
if target.result().missed || target.result().evaded
I thought that the break action would just finish the action since it missed or was parried.

Also I couldn't find in the Plugin where I can test if it was a hit or miss, the hit roll as you said. If you can point to me where I can do that, It would be appreciated.

If I put a action effect before the snipet you sent, it will execute the action twice.
Also the damage executed is done with the action effect by what is said on the plugin.
Also I couldn't find in the Plugin where I can test if it was a hit or miss, the hit roll as you said.
The testing is the code I gave you. Which you have typed out.

If I put a action effect before the snipet you sent, it will execute the action twice.
Only because you also have it inside of the conditionals. Why?

Also the damage executed is done with the action effect by what is said on the plugin.
Correct. action effect calculates if the attack hits, and if it does, deals damage. At that point you can check whether it was a hit or not.

Anyway, good luck with your project.
The testing is the code I gave you. Which you have typed out.


Only because you also have it inside of the conditionals. Why?


Correct. action effect calculates if the attack hits, and if it does, deals damage. At that point you can check whether it was a hit or not.

Anyway, good luck with your project.
I adjusted as you said but it is still showing the animation when missed. But thanks for the help, I'll keep trying to get this to work.
You did not correctly copy the code I gave you above.

It's missed and evaded. Looking for non-existing properties "miss" and "evade" will always return false.
You did not correctly copy the code I gave you above.

It's missed and evaded. Looking for non-existing properties "miss" and "evade" will always return false.
Ohh that was it! It worked now! Thank you so much for the help! I'll leave the working code attached for anyone who needs something similar.

The question was solved, this thread can be closed!

Original thread: https://forums.rpgmakerweb.com/threads/different-weapon-animation-when-attack-misses-or-is-parried.161489/