I'm trying to create a common event that allows players to cycle through their party with the press of a button.
I've done this successfully using EliMZ's ButtonCommonEvents plugin in conjunction with this script call (which I found in Kay_Erthisia's post from 2021) in my common event:
if ($gameParty.members().length == 3) {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(2, 1);
}
else if ($gameParty.members().length == 2) {
$gameParty.swapOrder(0, 1);
}
It works great if I have two party members or three party members. My problem is, I'm struggling to figure out how to have a condition for the fourth party member.
I have the script for a four-person party:
if ($gameParty.members().length == 4) {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(2, 1)
$gameParty.swapOrder(3, 1);
}
This also works well on its own, but how can I script this to change within the same common event depending on if you have 2, 3, OR 4 party members? I tried working in a label below the four-person call, skipping down to the three-person conditional script, but that didn't work and I'm not sure how to structure nesting branches (which is a chore in and of itself) in a script window.
I've done this successfully using EliMZ's ButtonCommonEvents plugin in conjunction with this script call (which I found in Kay_Erthisia's post from 2021) in my common event:
if ($gameParty.members().length == 3) {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(2, 1);
}
else if ($gameParty.members().length == 2) {
$gameParty.swapOrder(0, 1);
}
It works great if I have two party members or three party members. My problem is, I'm struggling to figure out how to have a condition for the fourth party member.
I have the script for a four-person party:
if ($gameParty.members().length == 4) {
$gameParty.swapOrder(0, 1)
$gameParty.swapOrder(2, 1)
$gameParty.swapOrder(3, 1);
}
This also works well on its own, but how can I script this to change within the same common event depending on if you have 2, 3, OR 4 party members? I tried working in a label below the four-person call, skipping down to the three-person conditional script, but that didn't work and I'm not sure how to structure nesting branches (which is a chore in and of itself) in a script window.