Kionea

Warper
Member
Joined
Sep 23, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Basically what I'm trying to do is, I have a variable that's meant to represent stress. As it goes up I want different thresholds to inflict a set of states I've created in order, one state at a time, i.e. the character goes from nervous to scared and the nervous state is removed. Should it go down, the scared state is removed and nervous is readded.

I'm trying to use Yanfly's auto passive states to do it, but from what I understand it only applies states, not removes them, but I'm also having some trouble understanding exactly how to use it. Is there some way I can use it remove the states as well or tie them specific ranges in the variable, say scared is tied to the stress variable being between 60-80?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,231
Reaction score
1,194
First Language
English
Primarily Uses
RMMV
from what I understand it only applies states, not removes them, but I'm also having some trouble understanding exactly how to use it.
By definition, passive states are passively attached to whatever - an actor, item, skill, etc. They are neither applied nor removed. Yanfly is really good about providing thorough documentation you can read through as well as a tutorial video for each plugin.
Is there some way I can use it remove the states as well or tie them specific ranges in the variable, say scared is tied to the stress variable being between 60-80?
So you would make one passive state for every range and put them all on the actor. Then you just do, for example:
Code:
<Custom Passive Condition>
condition = $gameVariable.value(X)>=60 && $gameVariable.value(X)<=80;
</Custom Passive Condition>
and go from there.
 

Kionea

Warper
Member
Joined
Sep 23, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
So you would make one passive state for every range and put them all on the actor. Then you just do, for example:
Code:
<Custom Passive Condition>
condition = $gameVariable.value(X)>=60 && $gameVariable.value(X)<=80;
</Custom Passive Condition>
and go from there.
I don't understand the syntax here for making the custom passive condition apply to each specific passive state.

Code:
<Passive State: 12>
<Custom Passive Condition>
condition = $gameVariable.value(1)>=20 && $gameVariable.value(1)<=40;
</Custom Passive Condition>

Clearly isn't it as the state is just present automatically during play testing, but I don't see any examples in the documentation on the yanfly wiki for what this should look like.

EDIT: Okay, figured out you put the condition statement on the state's notes and it works, but the states only activate upon entering battle or switching maps.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,231
Reaction score
1,194
First Language
English
Primarily Uses
RMMV
I don't understand the syntax here for making the custom passive condition apply to each specific passive state.
X is the ID of your variable for stress or whatever. The 60 and 80 are the range you asked for as an example. You would continue to put that in each different state with the appropriate numbers.

I don't see any examples in the documentation on the yanfly wiki for what this should look like.
docu.png
Code:
<Passive State: 12>
<Custom Passive Condition>
condition = $gameVariable.value(1)>=20 && $gameVariable.value(1)<=40;
</Custom Passive Condition>

Clearly isn't it as the state is just present automatically during play testing, but I don't see any examples in the documentation on the yanfly wiki for what this should look like.
Where are you putting all of that? The documentation says the Passive State tag is an "Actor, Class, Skills, Weapon, Armor, Enemy" notetag. The thing you want the state attached to, such as your actor, as I said in my previous post.

Then the Custom Passive Condition is the notetag you would put into state 12 to control when it turns on and off.
EDIT: Okay, figured out you put the condition statement on the state's notes and it works, but the states only activate upon entering battle or switching maps.
I'm not sure what to say, it should function - I haven't needed to do it, but a quick search shows other threads where people have used them outside of battle. Make sure you set it up as I described above, check you installed and configured the plugin properly.
 

Kionea

Warper
Member
Joined
Sep 23, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I've been reading other threads, tried a few things myself, everything is set correctly as far as I can tell. States activate when the proper thresholds are reached but only after entering battle or switching maps. If anybody can give any help with this it's much appreciated.

EDIT: Resolved. For anyone that finds this thread on google or something, if you're changing the variable from an event, run this script after the event.

Code:
for (var i = 0; i <= $gameParty.members().length; i++) {

$gameParty.members()[i].refresh();

}
 
Last edited:

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
50
Reaction score
10
First Language
br portuguese
Primarily Uses
RMMV
your timing is wrong.

if yu want to check every turn, use the <turn start> (check the plugin help file for the proper name) notetag.

you probably will need to do some slightly more complex coding.

and inside the notetag, a code like this:

//replace letters X, Y, W, Z and H with the values you need if($gameVariables.value(X) == Y){ user.addState(Z); user.removeState(W); } else if($gameVariables.value(X) == H){ user.addState(W); user.removeState(Z); }

the example above is a passive state that checks a variable and applies and removes states according to its value.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,231
Reaction score
1,194
First Language
English
Primarily Uses
RMMV
your timing is wrong.
if yu want to check every turn, use the <turn start> (check the plugin help file for the proper name) notetag.
He doesn't want to check during turns at all, this thread is about using passive states outside of combat.

Also, your conditionals are only looking at specific values, not ranges as the OP requested. See my first reply for some more concise state codes that work.
 

Latest Threads

Latest Profile Posts

you know, some days you get resentful that game dev is even considered a "fun job" and other days it's like, welp, time to roll up my sleeves and code these molotov cocktails
If you suck at playing trumpets, that is probably why.
Been sick with a stomach virus for seven days now. Not going to work tomorrow because I'm still contagious according to my doctor.
Much as I love my job, I really hate playing "office politics". It would be nice if I didn't have to pretend to be someone else all day long.
I wanna get back into showing off Battlers and other assets I create again. But i'm always haunted by the "It's not good/realistic enough" voices that keep me from doing so.

Maybe I should get back to it, I did enjoy showing off whatever I came up with!

Forum statistics

Threads
115,959
Messages
1,094,391
Members
151,226
Latest member
Mohobie
Top