Hi!
I'm currently working a project that has events that are limited by party size. I'm using Yanfly's Party System and have 10 party members which can be freely switched out. The party system counts reserve members as party members. Therefore, the default variable in MV does not work if I want an event only to occur with 3 members. I also don't want to tie people down with specific actors, I'd like any 3 to be able to start the event, but any more (or less) do not trigger. I noticed: $gameActors.actor(n).isBattleMember(), however it refers to actors, not party size. Any tips?
Something like this?
$gameVariables.setValue(1, $gameParty.members().length);
(switch the 1 with the variable ID you want to use)
Edit: i may have misread a bit... sorry.
what you could do in case you want to check if they're battle members:
$gameVariables.setValue(1, 0);
for (var i=1; i < 100; i++){
if($gameActors.actor(i).isBattleMember() == true){
$gameVariables.setValue(1, $gameVariables.value(1)+1);
}
};
^- change 100 to the amount of actors in your game
and 1 at both setValues for the variable id you want to use
(if im not mistaken..) i hope it helped ^^'
Great, thanks for that! I'll try and be a bit more clear - I have 10 total party members that can be switched out with a maximum battle party size of 10 members. However, I have some boss fights that are only suitable for 3 or 5 members, with the others sitting in reserve. With the default 'Party Size 'Control Variable' (under Game Data), it counts the reserve members when I would only like to count the current battle members.
Um.. I'm a bit new at this. I make the above into a plugin and turn it on (changing the variables)?
Hi, then, first of all set a Variable for the Battle-Member Size, once done add this as a script-event (page 3 -> bottom right -> "script")
to the event of the "bossfight"
Insert the following:
$gameVariables.setValue(?, 0);
for(var i = 0; i < 10; i++){
if ($gameParty._battleMembers !== 0){
$gameVariables.setValue(?, $gameVariables.value(?)+1);
}
};
but replace each "?" (there are 3 ? to replace for you) with the Variable ID you've set.
this sets the variable to the current amount of Battle-Members you have
you can then make a conditional branch and check if this variable is exactly or smaller than the amount of people allowed to fight
if yes you could ask the player if he wants to fight or just start the fight
ELSE
if its over the amount allowed, tell the player that he has too many people in the battle-party to fight this boss (or however you want to let them know)
This doesn't need to be added as a plugin, the script can be added with the Script-Event on page 3 in the bottom right the second one upwards
i hope this will help you :3 in case my explanation isn't clear, sorry, but just ask in case you do not understand something.
(and i hope i did it correctly)
Ahh, thanks soo much! It works beautifully!