alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
280
Reaction score
170
First Language
English
Primarily Uses
RMMV
Can someone tell me how to get the skill type id of a current action. Similar to how I use this line for elements: if (this.item().damage.elementId === 2) {

I'm trying to get a certain animation to not play if the user is using a certain skill type. The line below is the application:
<Custom Confirm Effect>
if (target.result().isHit()) {
if (this.isPhysical()) {
target.startAnimation(61);
}
}
</Custom Confirm Effect>
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,475
Reaction score
1,867
First Language
EN
Primarily Uses
RMMZ
In a Game_Action context:
Code:
this.item().stypeId
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,475
Reaction score
1,867
First Language
EN
Primarily Uses
RMMZ
Sorry for the late reply but could you give me a quick example on how to use that line?
Sure! Let's say you want the animation to play for all skill types except type #1 (you can check which type is which number on the Types tab in the database). Then try this:
Code:
<Custom Confirm Effect>
if (target.result().isHit()) {
  if (this.isPhysical()) {
    if (this.item().stypeId !== 1) {
      target.startAnimation(61);
    }
  }
}
</Custom Confirm Effect>
The new if statement says "is the skill type not equal to 1?", i.e. animation #61 should now play only with physical hits from skills not of type 1. :kaojoy:

As an aside, you can write things more compactly here if you want by using the logical "and" operator:
Code:
<Custom Confirm Effect>
if (target.result().isHit() && this.isPhysical() && this.item().stypeId !== 1) {
  target.startAnimation(61);
}
</Custom Confirm Effect>
It's mostly a style thing, the two should be functionally equivalent~
 

alcreator440

Veteran
Veteran
Joined
Mar 26, 2014
Messages
280
Reaction score
170
First Language
English
Primarily Uses
RMMV
Sure! Let's say you want the animation to play for all skill types except type #1 (you can check which type is which number on the Types tab in the database). Then try this:
Code:
<Custom Confirm Effect>
if (target.result().isHit()) {
  if (this.isPhysical()) {
    if (this.item().stypeId !== 1) {
      target.startAnimation(61);
    }
  }
}
</Custom Confirm Effect>
The new if statement says "is the skill type not equal to 1?", i.e. animation #61 should now play only with physical hits from skills not of type 1. :kaojoy:

As an aside, you can write things more compactly here if you want by using the logical "and" operator:
Code:
<Custom Confirm Effect>
if (target.result().isHit() && this.isPhysical() && this.item().stypeId !== 1) {
  target.startAnimation(61);
}
</Custom Confirm Effect>
It's mostly a style thing, the two should be functionally equivalent~
Thank you! It works perfectly.
 

Latest Threads

Latest Profile Posts

Quite the versatile cast so far :p

chars.PNG

Edit: Sprites are made by Alexdraws and TheMightyPalm. I just edited them.
Degica Games Turn Komodo | RPG Maker News #77

Well, rats. Was really looking forward to trying out FPS Creator, but trying to install and set it up was pretty much impossible for my tiny brain to comprehend. So much for that, then.
Ah, home once more! I think I can safely work on my games now.

Forum statistics

Threads
112,421
Messages
1,068,174
Members
146,076
Latest member
flowermuncher77
Top