Yanfly Auto Passive States

Dcraft

Veteran
Veteran
Joined
Sep 21, 2015
Messages
41
Reaction score
2
First Language
Spanish
Primarily Uses
I am trying to make a state which increases the attack, but the state only triggers when the hero is affected by another specific state like poison, there is a skill in pokemon called guts which works exactly like this. Guts raises the ability-bearer's Attack by 50% when inflicted by a major status ailment (poison, burn, paralysis, freeze or sleep). I hope someone can help me with the javascript code to make it work
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
873
Reaction score
562
First Language
English
Primarily Uses
RMMV
You need to set a custom passive condition that will be true if the user is afflicted with any "ailment" type state. To define what states count as ailments, and for an easy way to check if any of them are applied, look at Yanfly's State Categories- if you define a custom "ailment" category, apply that category to poison, blind, etc., and then make your passive state condition check for "user.isStateCategoryAffected("ailment")" then it should work out.
 

Dcraft

Veteran
Veteran
Joined
Sep 21, 2015
Messages
41
Reaction score
2
First Language
Spanish
Primarily Uses
You need to set a custom passive condition that will be true if the user is afflicted with any "ailment" type state. To define what states count as ailments, and for an easy way to check if any of them are applied, look at Yanfly's State Categories- if you define a custom "ailment" category, apply that category to poison, blind, etc., and then make your passive state condition check for "user.isStateCategoryAffected("ailment")" then it should work out.
Well I put this in the custom state

<Custom Passive Condition>
if user.isStateCategoryAffected(ailment) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

and I got this error
SyntaxError
Unexpected Identifier

then I tried this

<Custom Passive Condition>
if (user.isStateCategoryAffected(ailment)) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

and I got this

ReferenceError
ailment is not defined

PD: I installed the BuffsState core aswell
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
873
Reaction score
562
First Language
English
Primarily Uses
RMMV
It's "ailment" not just ailment. The quotation marks are important.

Personally, I would just do
Code:
condition = user.isStateCategoryAffected("ailment");
exactly like that.
 

Dcraft

Veteran
Veteran
Joined
Sep 21, 2015
Messages
41
Reaction score
2
First Language
Spanish
Primarily Uses
Now it works, that was it thanks for your help
 

Dcraft

Veteran
Veteran
Joined
Sep 21, 2015
Messages
41
Reaction score
2
First Language
Spanish
Primarily Uses
It's "ailment" not just ailment. The quotation marks are important.

Personally, I would just do
Code:
condition = user.isStateCategoryAffected("ailment");
exactly like that.
Sorry for coming back to bother but I had a problem, when I try this for the first time I created 2 objects 1 that granted the buff status and the other granted the ailment status and everything works perfect with that, now the problem is that when the status ailment is given by a weapon or armor the buff status does not recognize it for some reason, if I remove the weapon that gives this state and apply the object that applies the ailment again it works. Another strange thing, if I apply the object first to add the ailment and then equips the weapon with the same status effect now appears twice in the same actor, its like the custom condition only triggers with status given by the program and not by the ones given by a plugin
 
Last edited:

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
873
Reaction score
562
First Language
English
Primarily Uses
RMMV
What are you talking about when you say "object"? A state? A skill effect? Are you doing other custom javascript that you haven't mentioned?
 

Dcraft

Veteran
Veteran
Joined
Sep 21, 2015
Messages
41
Reaction score
2
First Language
Spanish
Primarily Uses
What are you talking about when you say "object"? A state? A skill effect? Are you doing other custom javascript that you haven't mentioned?
Sorry I mean a consumable item that gives that state (bad english). Also i'm applying the passive state in the armor with yanfly passive state plugin
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top