I'm currently trying to create a passive where when the party is outnumbered by the enemies in a fight, a certain actor gets a power boost ( Something along the lines of boosting the attack and defense stats for example). Problem is, I'm a total noob at this and I don't understand anything about what Yanfly is talking about when he explains his how to do this in his ''Lunatic Mode'' thingy. Can someone explain to me what this means and how I can make it work like I want it to? Thanks in advance.
<Custom Passive Condition>
if (user.hp / user.mhp <= 0.25) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
( That's Yanfly's formula for a conditional passive, which I don't get )
<Custom Passive Condition> is code that will evaluate the conditions for the state to trigger. This code goes in the Notes field of the state.
Now, as to how it works, basically if the code within those notes triggers the condition variable to be true (condition = true; ) then the state will activate.
In summary, for starters, what you want to do is to modify the logic in the if statement.
So, in your particular case this is what you want:
<Custom Passive Condition>
if ($gameParty.aliveMembers().length < $gameTroop.aliveMembers().length) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
What the code above means is that if there are less party members alive than enemies alive, then activate the passive state.
Also, don't forget to set the Passive state on the actor or class or skill or weapon or armor you want this passive state to trigger on!
<Passive State: x>
Wow, thank you my friend! This all seems very complicated for someone with no experience like me, so thank you for actually doing the code I needed! Now I have to understand what those commas, $ and () mean so I can maybe do some codes myself.
One more thing : Should i put the <Passive State: X> before or after the other code? Or does i not matter?
Alright, thanks for the tips buddy! So if i wanted to change the actor's face when the passive would activate, it would also be in the ''states'' tab right?
I guess i could use a switch in certain fights that when activated changes the actor for another one for the duration of the fight, though i'd have to have both actors scale the same way somehow.
This is great though I do have a question that is very similar to this one. What I want to do is set up a skill that when learned (not activated) it gives a passive trait that allows the character to use a weapon group (like guns for an example)?
I think you could set up a passive state for that, but paired with a Custom React Effect (from Yanfly's Buffs and States Core) to change the image index of the actor's face to one that looks hurt.