RMMV YEP ActSeqPack: Check if character has a specific weapon type.

NoShirtstann

Veteran
Veteran
Joined
Nov 13, 2018
Messages
35
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hey folks,

So I've run across a small problem.

I've developed an animation using the ActionSequencePack for the the standard attack, but I don't want that sequence to be used if the actor has a bow or missle type weapon.

Just want to use the standard animation for now.

Is there a way to have the plugin check if the actor has a specific weapon ID and change the animation sequence based on that?

Any and all help would be awesome!
 
Last edited:

Grunwave

Veteran
Veteran
Joined
Feb 4, 2017
Messages
610
Reaction score
174
First Language
English
Here is a snippet from one of my action that should help:



if user.attackMotion() !== 'missile'

move user: targets, front, 20

else

perform start

end


Pretty sure the opposite of "!==" is "===" , if you want to word it that way.
 

Pots Talos

Veteran
Veteran
Joined
Jun 28, 2012
Messages
123
Reaction score
103
First Language
English
Primarily Uses
RMMV
You could add a conditional to check if using a missile attack with something like:

Code:
if user.attackMotion() !== 'missile'
 

NoShirtstann

Veteran
Veteran
Joined
Nov 13, 2018
Messages
35
Reaction score
8
First Language
English
Primarily Uses
RMMV
Here is a snippet from one of my action that should help:



if user.attackMotion() !== 'missile'

move user: targets, front, 20

else

perform start

end


Pretty sure the opposite of "!==" is "===" , if you want to word it that way.


That worked amazing thank you!

Had to modify the coding a bit, but it worked out.

Here is what I ended up with.

Code:
<target action>

immortal: targets true

if user.attackMotion() !== "missile"

    move user: target, front base, 30

    wait for movement

    perform action

    action animation: target

    wait for animation

    action effect

    wait for effect

    perform finish

else

    perform action

    action animation: target

    wait for animation

    action effect

    wait for effect

    perform finish

end

</target action>

Also !== is the opposite of ==.

!== : does not equal

== : equals exactly
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,274
Reaction score
1,682
First Language
EN
Primarily Uses
RMMZ
Also !== is the opposite of ==.

!== : does not equal

== : equals exactly
Not quite:
  • != is the logical inverse of == (loose equality);
  • !== is the logical inverse of === (strict equality).
Basically, A === B cannot be true if A and B are of different types, e.g. string vs number, whereas A == B might be true depending on the exact values. More details:
 

NoShirtstann

Veteran
Veteran
Joined
Nov 13, 2018
Messages
35
Reaction score
8
First Language
English
Primarily Uses
RMMV
That worked amazing thank you!

Had to modify the coding a bit, but it worked out.

Here is what I ended up with.

Code:
<target action>

immortal: targets true

if user.attackMotion() !== "missile"

    move user: target, front base, 30

    wait for movement

    perform action

    action animation: target

    wait for animation

    action effect

    wait for effect

    perform finish

else

    perform action

    action animation: target

    wait for animation

    action effect

    wait for effect

    perform finish

end

</target action>
Not quite:
  • != is the logical inverse of == (loose equality);
  • !== is the logical inverse of === (strict equality).
Basically, A === B cannot be true if A and B are of different types, e.g. string vs number, whereas A == B might be true depending on the exact values. More details:

My mistake. Thank you for correcting me. I wasn't aware that there was two separate types of operator comparison.

Learn something new everyday =D
 

Latest Threads

Latest Posts

Latest Profile Posts

Added a modern day fridge sprite to my thread. Empty, full, and rotten versions :) enjoy
I'm on YouTube moderating for an America's Funniest Home Videos livestream. They love having me there and I know spam when I see it. Tonight I had to put 3 different people in time out due to them spamming random letters. Nobody else could chat with their messages in the way!
Mist_new.png
Some WIP of Mist's newest sprites! Tutorials are awesome and very useful!

Forum statistics

Threads
109,120
Messages
1,042,270
Members
141,615
Latest member
Bamionic
Top