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

NoShirtstann

Villager
Member
Joined
Nov 13, 2018
Messages
24
Reaction score
6
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
600
Reaction score
167
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

Villager
Member
Joined
Nov 13, 2018
Messages
24
Reaction score
6
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,226
Reaction score
1,634
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

Villager
Member
Joined
Nov 13, 2018
Messages
24
Reaction score
6
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

Making Houses and Outside on the same map with RPG Maker MV!
Do people actually use buff/debuff function?
Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...

Forum statistics

Threads
107,708
Messages
1,031,574
Members
139,844
Latest member
nibas0001
Top