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,293
Reaction score
1,240
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,293
Reaction score
1,240
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,293
Reaction score
1,240
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

I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e
I added a little squish effect when characters change direction to try and make things a bit more lively. Though it's a bit hard to see on the fast moving guys.
2f4fiuy.gif

Forum statistics

Threads
116,123
Messages
1,095,957
Members
151,534
Latest member
clique
Top