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,282
Reaction score
1,692
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 Profile Posts

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.
Pyra and Mythra in smash ultimate are way too OP. They're basically Smash 4 Bayonetta 2.0, and not in a good way. Very toxic and unfair. At least they're hot tho.
attack on titan keep reaching a new height with each episode, aaa I can't wait another week for a new episode at this point

Forum statistics

Threads
109,197
Messages
1,042,966
Members
141,700
Latest member
skybola188
Top