RMMV Quick question about Yanfly's Auto Passive States

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
349
Reaction score
387
First Language
English
Primarily Uses
RMMV
I know you can set up a custom passive condition with the plugin, but can you make a condition that requires the actor to have a specific skill learned?

I imagine you probably can, but I'm not sure how to write it. The plugin in question is linked to below.

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
670
Reaction score
354
First Language
English
Primarily Uses
RMMV
How do you mean? Do you require the actor to have a specific skill in order to have the state applied? Get the state but require a skill in order to apply its effects? Always have the state once you've learned a skill?

The answer is yes, but how you'll do it depends on what you mean.
 

ThreeSixNine

Veteran
Veteran
Joined
Jan 22, 2019
Messages
276
Reaction score
235
First Language
English
Primarily Uses
RMMV
I know you can set up a custom passive condition with the plugin, but can you make a condition that requires the actor to have a specific skill learned?

I imagine you probably can, but I'm not sure how to write it. The plugin in question is linked to below.

Try:
Code:
<Custom Passive Condition>
user.isSkillLearned(X)
</Custom Passive Condition>
Replace X with the Id of the skill you wish to check.
Also make sure to add this state to the actor's note box.
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
349
Reaction score
387
First Language
English
Primarily Uses
RMMV
How do you mean? Do you require the actor to have a specific skill in order to have the state applied? Get the state but require a skill in order to apply its effects? Always have the state once you've learned a skill?

The answer is yes, but how you'll do it depends on what you mean.
The third option is what I'm looking for. I want to give every actor a state, but in order for the state to apply, they need to know a particular skill.

@xDRAGOONx
Didn't work, unfortunately. Actor has the state, and that code is in the state's notebox, but it still takes effect without having the skill.
 
Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
900
Reaction score
569
First Language
English
Primarily Uses
RMMV
Try this instead.
Code:
<custom passive condition>
if (user.isLearnedSkill(x)){
condition = true
} else {
condition = false
}
</custom passive condition>
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
670
Reaction score
354
First Language
English
Primarily Uses
RMMV
@xDRAGOONx - per the Lunatic Mode documentation, a straight boolean won't work. Yanfly has a little internal variable called called "condition" that needs to be used, or the custom condition won't do anything. That allows for more complex rules than you could get with a one-operation conditional.
 

ThreeSixNine

Veteran
Veteran
Joined
Jan 22, 2019
Messages
276
Reaction score
235
First Language
English
Primarily Uses
RMMV
@xDRAGOONx - per the Lunatic Mode documentation, a straight boolean won't work. Yanfly has a little internal variable called called "condition" that needs to be used, or the custom condition won't do anything. That allows for more complex rules than you could get with a one-operation conditional.
Yes, thank you for correcting me. I even copied the notetag setup from one of my existing states and still missed this...so thank you again. Also, @ramza thank you for providing the correct code, and for your amazing plugins!
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
900
Reaction score
569
First Language
English
Primarily Uses
RMMV
Np. The function being named backwards has caught me a couple of times when I'm not paying attention. I don't know why isLearnedSkill is used instead of isSkillLearned :/
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
349
Reaction score
387
First Language
English
Primarily Uses
RMMV
@ramza So, your solution works. . .as long as I actually learn the skill, and not just gaining it via "Add Skill". Jeez, why is that trait so finicky?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
900
Reaction score
569
First Language
English
Primarily Uses
RMMV
@ramza So, your solution works. . .as long as I actually learn the skill, and not just gaining it via "Add Skill". Jeez, why is that trait so finicky?
In that case, you can use user.skills().includes($dataSkills[x]), which combines all skills learned with all skills gained via traits. Replace x with the id of the skill, of course.
 

Latest Threads

Latest Posts

Latest Profile Posts

not me baking a pie because i was inspired by celeste
Doing RPG Maker News for 10th April, 2021. :LZScheeze: (Improving on the thumbnails, by using assets from the day's news.)
Just discovering the forum.
Since Final Fantasy VII has been trending today, decided to make a series of my favorite bars in the OG game! Check it out:

At 2021, we are now farther from the 1980's than they were from the 1950's. Consider that the next time you long for a 1980's song, when you thought your grandpa's taste for 1950's music was "outdated".

Forum statistics

Threads
110,296
Messages
1,052,054
Members
143,325
Latest member
Blaze163
Top