Tazzyneo

Villager
Member
Joined
Mar 1, 2020
Messages
15
Reaction score
3
First Language
French
Primarily Uses
RMMV
Hello!
I'm new to JS and I'm trying during the "Custom Confirm Effect" of a passive state to make the game check if the character affected by that state is using a certain Skill (in that case, it's Skill 318).

So here's what I tried:
if (this.Skillid() === 318) {
}
////
if (this.action.skillId() === 318) {
}
////
And after searching on google I still can't find the right code
Thanks for any upcoming help!! ^^
 
Last edited:

ThreeSixNine

Veteran
Veteran
Joined
Jan 22, 2019
Messages
522
Reaction score
431
First Language
English
Primarily Uses
RMMV
Are you using a plugin?
 

Tazzyneo

Villager
Member
Joined
Mar 1, 2020
Messages
15
Reaction score
3
First Language
French
Primarily Uses
RMMV
Yes!
in that case Yanfly's Buffs&StateCore.
(And they all work fine, the issue has to come from my code)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,485
Reaction score
3,514
First Language
EN
Primarily Uses
RMMZ
A bit late (maybe you've already found the answer), but try this:
JavaScript:
if (this.isSkill() && this.item().id === 318) {
  // stuff
}
I.e. "if this action is a skill and its ID is 318, then do stuff". It's item because skills and usable items are treated mostly the same when used. :)

(Also, note that the this keyword changes meaning depending on where it's used: Yanfly's Custom Confirm Effects are evaluated in a Game_Action context...basically that means that this conveniently returns the current action.)
 

Tazzyneo

Villager
Member
Joined
Mar 1, 2020
Messages
15
Reaction score
3
First Language
French
Primarily Uses
RMMV
Hey! This looks great! Thanks :D
And also thanks for the little tutoriel!
I've found another, way longer solution.
So, knowing this will save me a lot of time if I try to do something similar!

Do you know if i can trigger common events with Yanfly's Custom Confirm Effects?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,485
Reaction score
3,514
First Language
EN
Primarily Uses
RMMZ
Great! For common events you could try this:
JavaScript:
$gameTemp.reserveCommonEvent(123);
Just replace 123 with the ID of the event you want to start. :)
 

Latest Threads

Latest Posts

Latest Profile Posts

9 days left for Harold Jam... hope it's not too late to start gam mak
i think this girl has to be my favorite though :)
62702017_JJKXazrs2LInoZh.png
Wouldn't you know it? Every woman that is interested in me on FB is a bot. Maybe I should respond with 000100100011. If u r willing to date women on FB something has definitely went wrong with your life.
Hello world !! I've created a logo design for my game, I'm calling it "Soup Quest" (It was honestly the best I could come up with <:]) !!
[IMG]https://media.discordapp.net/attachments/866542330286178344/1076307540528332830/Soup_Quest_Game_Logo.png?width=473&height=473[/IMG]
P.S. ty to the person who told me about the "purple text not mixing well with dark mode". I'll be careful on using colored text in the future !!

Forum statistics

Threads
129,747
Messages
1,204,799
Members
170,835
Latest member
KathleenL42
Top