Status
Not open for further replies.

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
246
Reaction score
306
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

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,777
Reaction score
2,127
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
246
Reaction score
306
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

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,777
Reaction score
2,127
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
246
Reaction score
306
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
8,953
Reaction score
5,862
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.

Latest Threads

Latest Profile Posts

$Syringer.png
toying with a brand new monster design
Another doodle! Green-haired girl has no name yet, so, any suggestions?
She is about the same age as Nikki, and she is the last one of her clan, known for their innate skills in manipulating both ice and fire. She is a bit stubborn, as well as having a soft spot for kids.
Mystery messages from my AI assistant. :kaojoy:
1632842960834.png
Made some updates to a previous project I was working on. Trying to mimic the 16 bit Squaresoft aesthetic.

Forum statistics

Threads
115,434
Messages
1,089,895
Members
150,204
Latest member
MrKamikazeee
Top