[SOLVED] Yanfly's Action Sequence "if" condition when attack is missed

Status
Not open for further replies.

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
238
Reaction score
272
First Language
Indonesian
Primarily Uses
RMMV
Hi everyone.

I want to make certain animation that will be played only if an attack is hitting the enemy. Otherwise the animation shouldn't be played at all.

Can you tell me how to make it using "if" condition to check if an attack is hit or miss?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
:kaohi: Try something like this, seems to work for me~
Code:
action effect: target
if !target.result().missed && !target.result().evaded
  action animation: target
end
The if has to be after action effect. This example says "check hit chance, process the damage formula on hit; if the skill did not miss and the target did not evade, show the assigned animation on the target".
 

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
238
Reaction score
272
First Language
Indonesian
Primarily Uses
RMMV
Wow, great. It worked for me.
Because without those method it will be weird seeing sword or spear animation and sound, but the attack is missed.

Thank you very much for your help.

Edited:

By the way, when the attack is missed, my character is not finishing his attack motion. If the attack motion has 3 frames, he only do 1 or 2 frames than back to his standby motion. It doesn't happen if the attack hits the enemy.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
By the way, when the attack is missed, my character is not finishing his attack motion. If the attack motion has 3 frames, he only do 1 or 2 frames than back to his standby motion. It doesn't happen if the attack hits the enemy.
Oh, maybe try adding some wait time in there, e.g. after the if part:
Code:
perform action
action effect: target
if !target.result().missed && !target.result().evaded
  action animation: target
else
  wait: 12
end
I imagine it works OK with the animation because there's a wait for animation action somewhere, either in the same action phase or a subsequent one.
 

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
238
Reaction score
272
First Language
Indonesian
Primarily Uses
RMMV
Thank you very much for your helps.
It works charmly.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,829
Reaction score
5,221
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top