Limiting Party Size

● ARCHIVED · READ-ONLY
Started by Ben Mariner 6 posts View original ↗
  1. Hi Everyone,

    I'm making a kind of horror/puzzle game and I want to restrict the number of party members to 3. However, I can't figure out how to do that. I've looked in the forums and can't find any solid answers. I feel like there has to be an easy way to do this without a plugin, but I can't find it.

    Any help is greatly appreciated!
  2. If you mean 3 in total, all you do is have only 3 actors in your database. Make sure they occupy the first 3 slots. Though in fact, only actors that you "Add to the party" via an event command will be in the party, so you could have more in the database, but I assume you would have no reason to do that.

    Or do you mean that you will have more actors, but only 3 can be in the active party?
  3. Kes said:
    If you mean 3 in total, all you do is have only 3 actors in your database. Make sure they occupy the first 3 slots. Though in fact, only actors that you "Add to the party" via an event command will be in the party, so you could have more in the database, but I assume you would have no reason to do that.

    Or do you mean that you will have more actors, but only 3 can be in the active party?

    Yes, I'll have more than 3 actors, but only 3 in the party at once. They'll be able to switch in and out, but I don't want to have more than 3 active party members at a time.
  4. Each time you add an actor, add a conditional branch -> script -> $gameParty.members().length < 3
    If it's true, that means there are less than 3 actors in the party, which would allow the player to add the actor.
    If it's false, that means there are 3 or more actors in the party, which wouldn't allow the player to add the actor.
  5. MushroomCake28 said:
    Each time you add an actor, add a conditional branch -> script -> $gameParty.members().length < 3
    If it's true, that means there are less than 3 actors in the party, which would allow the player to add the actor.
    If it's false, that means there are 3 or more actors in the party, which wouldn't allow the player to add the actor.

    Awesome. I'll try that!

    Can I do something similar to swap party members? Say there's 3 members in the party so I want to replace one based on player choice. Is there a script to say remove party member X, so that the new actor can be put in?
  6. Ben Mariner said:
    Awesome. I'll try that!

    Can I do something similar to swap party members? Say there's 3 members in the party so I want to replace one based on player choice. Is there a script to say remove party member X, so that the new actor can be put in?

    Figured it out. Simple line of code, in case anyone is curious:

    Code:
    $gameParty.removeActor($gameParty.members()[n]._actorId);

    Thanks everyone! Very helpful!