- Joined
- Aug 23, 2015
- Messages
- 112
- Reaction score
- 34
- First Language
- French
Hey everyone!
In my game, the slot position of a character is important and I need each slot position to have a certain passive state applied to the character in that slot. For example, the character in the slot position 1 needs to have state x, and the character in the slot position 4 needs to have state y. Also, the player can switch characters during battle, using Yanfly's ActorPartySwitch.
For example: if Bob is my party leader (in position 1) and has the state x, when he switches with Mike (who's currently on the bench), I need Mike to have the state x when he enters. And if Bob rejoins the fight later but is placed in the slot 4, he should have state y and not state x on him.
I thought about placing in the character's notetag a conditional passive state based on its slot ID. However, I don't know to code it.
In Yanfly's AutoPassiveStates, he allows us to create custom conditions. The example he gives is:
<Custom Passive Condition>
if (user.hp / user.mhp <= 0.25) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
So my question is: is there a way to make a custom passive condition based on slot id (the position of the character in the party)? If so, I could give each character 4 passive states (one for each of the 4 positions in the active party), and each state would only activate if the character is in the correct position (so only one state at a time would be active, and that state would follow the characters switching during battle).
I thought about using rows since I can apply a passive state to each row, however characters that are swapped in during the battle do not necessarily arrive at the same row as the one that just left.
Thank you in advance!!
Edit: I found this to figure out what actor is in what position.
$gameParty.members()[0]._actorId - will return the Id of the actor that is the first party member.
$gameParty.members()[1]._actorId - it will return the id of the actor that is the second party member.
It's not what I need, but it shows it's possible. I tried to figure out how to make a condition like "if character is in position 1", but I don't know how to code in java so I haven't been able to find something yet.
In my game, the slot position of a character is important and I need each slot position to have a certain passive state applied to the character in that slot. For example, the character in the slot position 1 needs to have state x, and the character in the slot position 4 needs to have state y. Also, the player can switch characters during battle, using Yanfly's ActorPartySwitch.
For example: if Bob is my party leader (in position 1) and has the state x, when he switches with Mike (who's currently on the bench), I need Mike to have the state x when he enters. And if Bob rejoins the fight later but is placed in the slot 4, he should have state y and not state x on him.
I thought about placing in the character's notetag a conditional passive state based on its slot ID. However, I don't know to code it.
In Yanfly's AutoPassiveStates, he allows us to create custom conditions. The example he gives is:
<Custom Passive Condition>
if (user.hp / user.mhp <= 0.25) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
So my question is: is there a way to make a custom passive condition based on slot id (the position of the character in the party)? If so, I could give each character 4 passive states (one for each of the 4 positions in the active party), and each state would only activate if the character is in the correct position (so only one state at a time would be active, and that state would follow the characters switching during battle).
I thought about using rows since I can apply a passive state to each row, however characters that are swapped in during the battle do not necessarily arrive at the same row as the one that just left.
Thank you in advance!!
Edit: I found this to figure out what actor is in what position.
$gameParty.members()[0]._actorId - will return the Id of the actor that is the first party member.
$gameParty.members()[1]._actorId - it will return the id of the actor that is the second party member.
It's not what I need, but it shows it's possible. I tried to figure out how to make a condition like "if character is in position 1", but I don't know how to code in java so I haven't been able to find something yet.
Last edited: