Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
Hello,

I am trying to check to see if battler is using a certain skill so that a certain condition triggers. I thought the script call was user.currentAction().item(0.id === x, with x being the skill ID. However whenever I use this i get the error code saying "item is undefined. "

for more clarification here is an example of what I mean.

<Custom Confirm Effect>
if (this.isSkill() && user.currentAction().item().id === 1) {
user.gainHp(500);
}
</Custom Confirm Effect>
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
747
Reaction score
256
First Language
Vietnamese
Primarily Uses
RMMV
I have been using this to make it work:
Code:
var skills = [];
skills.push(a,b,c,b); //change a b c d to your skill ID, or just use one of them
if (this.isSkill() && skills.contains(this.item().id)){
//do something
}
 

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
Thanks for the reply,

I tried the code and although I do not get an error, doesn't seem as if the the statement is being applied don't see anything occuring.
 

Latest Threads

Latest Profile Posts

Another day, another patch. Praise be to the game make!
Okay... I'm injured and stuck in bed with a bad knee. And I'm only 24! I shouldn't be limping this badly, but my leg refuses to fully straighten and it hurts if I try to push it.
At least I have my games to work on.
RianQuenlin wrote on Iron_Brew's profile.
To elaborate on "safety" since bgillisp locked the thread, some lunatics will take reports personally and decide to harass people who file reports or otherwise complain about them. Me, I don't care but others seeing that might nope right out of discussion. Being a former mod back in the mid-2000s for some gaming forums in by BYOND days I can tell you some people go crazy.
Excitement: I've spent the last week making a little update package for VE Fog & Overlay, and finally got it working in my test environment!

Dread: Sigma fullscreen and Zeus's map effects are screaming at me when I add them into the mix.
ScreenShot_8_7_2022_0_23_50.png
Unleash the hype beam...

Forum statistics

Threads
124,330
Messages
1,162,814
Members
163,123
Latest member
Introvertebrate
Top