RMMV Quick question about Yanfly's Auto Passive States

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
371
Reaction score
406
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
763
Reaction score
416
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
236
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
371
Reaction score
406
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
913
Reaction score
576
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
763
Reaction score
416
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
236
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
913
Reaction score
576
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
371
Reaction score
406
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
913
Reaction score
576
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

1618970067646.png
Feedback would be appreciated. To me it feels like the Dad does look a bit too normal and boring.
I think he's missing some features that make him more unique. Opinions?
recovering from surgery that covid caused me to have, im back trying to work on the newer engine on my game. We will see how this goes. I have no idea what to do about conversions
The wings got worse than I expected ... but for now it looks like this:
index.php
Doing RPG Maker News #16 | Orchestral Tileset, Don Miguel Interview, Visual Choices, Retro Console Icons
I realized I kinda have a habit of making threads and sometimes not thinking them through. I should work on this.

Forum statistics

Threads
110,585
Messages
1,054,433
Members
143,712
Latest member
Neareyn
Top