Party Manager

In RPG Maker, you have a “party”. A party consists of a group of actors, an inventory of items, weapons, armors, and gold, and potentially some other information related to this group.

By default, you only have one party, which is what the player will control throughout the game.

This plugin provides functionality for working with additional parties.

1. You can create new parties. Separate parties can be used to represent different characters in your game. Each character may have their own set of followers and inventories as the story progresses.

2. You can switch between parties. If your story switches from one character to another and you would like to keep their location, characters, inventories, and other party-related information, you can simply switch to a new party instead. You could even switch between parties in real-time on the same map to build additional mechanics related to multiple party control.

3. You can merge parties. By merging parties, you can have different parties come together as one large party. All of the members, inventories, and other information will be merged together.

These are the three basic functions that you can use to design your game using the Party Manager. Additional functionally will be provided over-time as they are developed.

Download

Plugin: download here (right-click, save as)

Related Plugins

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_PartyManager plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

Quick Summary

Just want to get the parties started? Read this and have something working in a few minutes.

Managing multiple parties involves

  1. Creating parties
  2. Switching parties
  3. Merging parties

To create party, you need to choose a party ID. The default party ID is 1, which you can customize in the plugin parameters, so don’t use this one. For example, if you prefer numbers, you might choose 2 as your second party ID.

Now you create the party, add some actors, and choose a location if needed.
Let’s say I wanted to create a party that I will refer to as 2, with actors 3 and 4, at location (10, 12) of map 5. Here are the script calls:

Party.create(2)
Party.addActor(2, 3)
Party.addActor(2, 4)
Party.setLocation(2, 10, 12, 5)

Once I have a party set up, I can switch between them.

Party.switch(2)

And I can switch back

Party.switch(1)

Now, if I’m done with the second party and want to merge it into party 1:

Party.merge(2, 1)

This is all you need to manage multiple parties. Please read the rest of the instructions for advanced usage beginning at “Idle Parties”.

Detailed Instructions

This plugin provides a lot of different functionality. Here is a table of contents

You can click on these link to jump to the appropriate section.

Party ID

The Party Manager uses the concept of a “party ID” to identify each and every party in the game.

A party ID is basically a name that you give your parties. It could be a number like

  • 1
  • 2
  • 3

or it could be text like

  • “sub”
  • “main”

and so on.

Party ID’s are meant to give you an easy way to manage parties throughout your game since you will be using events to manage them.

Creating Parties

Your project begins with one party by default. You can customize the ID that is assigned to it in the plugin parameters.

All additional parties will need to be created using events or plugins. To create a party, use the script call

Party.create( PARTY_ID );

For example, you can create parties like this

Party.create(2);
Party.create("sub");

Changing Party Actors

When you create a new party, it will have no actors.
You can add or remove party actors using these script calls

Party.addActor( PARTY_ID, ACTOR_ID );
 Party.removeActor( PARTY_ID, ACTOR_ID);

The ACTOR_ID is the ID of the actor in the database.
For example, to add actor 3 to party 2, you would write

Party.addActor(2, 3);

And to remove actor 3 from party “main”, you would write

Party.removeActor("main", 3);

Switching Parties

Once you have created additional parties, you can switch between them.

To switch parties, use the script call

Party.switch( PARTY_ID );

So for example, if you want to switch to party 2, you would write

Party.switch(2);

When you switch parties, active control goes to the selected party, and the other party will go “idle”. You can see the other party on the map if both
parties are on the same map. For more information, refer to the section on “Idle Parties” below.

Changing Party Locations

In this system, all parties have locations. When you switch parties, the game will change to where the party is currently located.

By default, when you create a party, it will be located where the current party is located.

You can change a party’s location during the game using the following script call:

Party.setLocation( PARTY_ID, X, Y );
Party.setLocation( PARTY_ID, X, Y, MAP_ID );

Where X and Y is the position on the map, and the MAP_ID is the ID of the map that you would like to set the party’s location.

If you omit the map ID, it is assumed to be the current map.

Merging Parties

When you want two parties to merge together, you can use the script call

Party.merge(PARTY_ID1, PARTY_ID2)

Which means “merge party ID1 into party ID2”. If the first party is the current party, then the game will automatically switch to the second party.

Party Inventory Trading

You can trade items and gold between parties. Items collectively refers to weapons, armors, and usable items.

To transfer items from one party to another, use the script call

Party.tradeItem( ID1, ID2, ITEM, COUNT )

Where ID1 is the ID of the party to take the item from, and ID2 is the ID of the party to give the item to.

The ITEM is an item object. There are many different items in the game, including items, weapons, and armors. By default, you would access themlike this:

$dataItems[2] - item 2
$dataWeapons[3] - weapon 3
$dataArmors[12] - armor 12

The COUNT is just the amount of the specified item you would like to trade. If the first party does not have enough, it would simply trade as much as it can, instead of failing.

You can also trade gold from one party to another. Use the script call

Party.tradeGold( ID1, ID2, amount )

Where you’re trading the given amount of gold from party ID1 to party ID2.
If party 1 does not have enough gold, the game will transfer as much as it can.

Idle Parties

By default, if you have multiple parties, only one party can be “active” at any time. The other parties are said to be “idle”. The active party is the
party that you currently control. When you switch parties, you are switching which party is the currently active party.

Idle parties are drawn on the map as events if they are on the same map. At this point, they are just visual indicators and do nothing. However, in the
future, you will be able to create your own events to determine how these idle parties should behave when you interact with them.

Active Party Variable

In the plugin parameters, you can choose something called an “active party variable”, which is just a game variable that keeps track of which party is currently active. This is mostly for convenience purposes in your events.

RPG Maker assumes variables are numbers, but you can store text as well. However, in your conditional branches, you will need to use script conditional branches in order to check that.

Checking Party Location

Idle parties are events on the map, but unlike map events, these events do not have a fixed ID. Instead, you would check the party’s position directly!

To check if a party is at a specific location, you can use the following script calls

Party.atLocation( PARTY_ID, X, Y );
Party.atLocation( PARTY_ID, X, Y, MAP_ID);

If the MAP_ID is not provided, it is assumed to be the current map ID. This means that you could check a party’s position across different maps.

If you wanted to know if there were *any* parties at a location, you can use this script call instead

   Party.anyAtLocation( X, Y );
  Party.anyAtLocation( X, Y, MAP_ID );

You can also check if a party is at a specific region

   Party.atRegion( PARTY_ID, REGION_ID );

And similarly, to check if any party is at a specific region:

   Party.anyAtRegion( REGION_ID );

Note that region ID checks can only be done for the current map.

Setting Max Number of Party Members

By default, there is no limit to how many members you can have in a party. This is different from the number of “battle” party members, which determines how many party members will actually participate in battle.

In the plugin parameters you can specify how many party members each party can have.

To check if the current party, or a certain party is full, you can use the script calls

   $gameParty.isPartyFull()
   Party.isPartyFull( PARTY_ID )

Which will return true or false depending on whether the party is full or not. You can use the script call

Party.setMaxPartyMembers( PARTY_ID, NUMBER )

To change this limit at anytime.

Checking if an actor is in a party

To check whether an actor is in a certain party, you can use the script call

   Party.hasActor( PARTY_ID, ACTOR_ID )

Which will return true if the specified actor is in that party.

Locking Actors to Party

To lock an actor to a party, use the script call

   $gameActors.actor( ACTOR_ID ).lockToParty(true)

To remove the lock, use

   $gameActors.actor( ACTOR_ID ).lockToParty(false)

Where the ACTOR_ID is the ID of the actor you wish to operate on.

Party locking is useful for plugins that require this information, such as the Party Switching Scene which uses this to determine whether the actor can be moved from the party.

You may also like...

72 Responses

  1. puppies and dogs are very cute, i always love to play with them during my spare time.

  2. MaximumSharpie says:

    I really like the party switching tool. We’re doing something similar to Kefka’s Tower but we’re having a serious issue where we can’t get the pool of items and equipment to transfer from party 1 to party 2 and 3. If there’s a way to disable the inventory lock and allow all parties to access the pool of items and equipment I would appreciate it. I really don’t want to cut this tool out only to have to completely rewrite the whole dungeon.

  3. Phacey says:

    is there a way to disable the stepping animation?

  4. Lammaka says:

    Thank you , Hime, this is great! However I am having an issue. When I set the location of my second party as a parallel process, the speed movement of my first party is increased.

  5. Anonymous says:

    Does this work on MZ?

  6. baimao says:

    Hello
    I try to use it but it can not work .
    i create a event,use player touch to run.
    i add this code on it
    Party.create(2)
    Party.addActor(2, 2)
    Party.removeActor(1, 2)
    Party.setLocation(2, 1, 1)
    Party.switch(2)

    • "Piyan Glupak", a.k.a. Richard Lee says:

      I am only a novice user of this plugin myself, but when I use it and want to move actors from party 1 to party 2, I remove the actor from party 1 before trying to add them to party 2, so in your case I would try:

      Party.create(2);
      Party.removeActor(1,2);
      Party.addActor(2,2);
      Party.setLocation(2,1,1);
      Party.switch(2);

  7. Overqueen Xion says:

    How can I do this on switch?

  8. Anonymous says:

    How do I change the amount of “battle” party members though?

  9. AdminCat says:

    It does’nt work. I just call a script “Party.removeActor(1,3);”. In game i get error Party.removeActor is not a function. Rpg maker MV 1,6

  10. Taylor James says:

    Hey I’m running into a problem where I switch to one of my parties (Party 3 in this example), but when I switch to Party 2 some of my items are missing (specifically a key Item I needed Party 2 to carry to progress a cutscene)

    • Taylor James says:

      sorry for the repeat but I got the same error some where else and it doesn’t seem to be related to the item, occasionally screens will black out and just not fade back in? I think it might have with the party switching or something?

      Also is it redundant to do the the (Party.addActor[#]) with the default Add Actor command in an event?

  11. Leomar Linhares says:

    Is there a way to switch parties without typing in script commands?
    Something like Party.switch(next)

  12. Anonymous says:

    How do I fix Party.create is not a function?

  13. YubelGirl says:

    Hey, is their a way that a event/monster triggers party 2 which is passiv at the moment (and maybe switch to party 2 and make it activ again?)

  14. Kitdan says:

    Not sure if anyone else has mentioned this, but I found a graphical bug. If one party is in a bush region and the other is in a non bush region, it doesn’t recognize that you’ve moved from bush to non bush, or vice versa. i.e. If the party I’m controlling is in tall grass and the other party is on a dirt path, the party on the dirt path will look partially buried when I switch to them. Moving will correct this, but then if I switch back to the party in the tall grass They’re suddenly standing on top of the grass.

    Other than that, this plugin is perfect. I could use a plugin that let’s me change bush height in game though.

  15. Lord Zonar says:

    I do not know if this has already happened to someone else, but it appears that when attempting to switch the party to any besides the default “party id 1” the actors in the new party don’t have any graphics. I have even tried changing the actor graphics after making and switching to the party, turning transparent on and off, anything that could possibly affect visibility of the actors. Please, I need whatever advice you can give.

  16. kvagram says:

    Hi. Have you put the idle party update on ice? I’d really want to have some way to interact with idle parties.
    In fact, I decided to dig a bit in your code, and see if I can rig something up myself,

    • kvagram says:

      Well, I did the digging, and I did some testing.
      I made an idle party event run common event number 10 when triggered.
      Took a while to get back into how the data structure works, and how the plugin implemented the event.
      Luckily my experience from coding events in XP could be applied. Surprisingly little has changed, considering the change in code-language.

      If anyone is interested in this hack, edit the plugin-script, replace line 405 with this:

      $.templateEvent = {"id":9999,"name":"EV015","note":"","pages":[{"conditions":{},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":0,"indent":0,"parameters":[]},{"code":117,"indent":0,"parameters":[10]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":13,"y":25}

      You probably want a different common event, so in that case, just replace the ’10’ in ‘”parameters”:[10]’ with whatever common event you want.

  17. Anonymous says:

    Thank you for this amazing plugin! I was wondering though if there is a way to switch parties without typing in script commands. I was thinking along the lines of a menu command to switch to a designated party to make it more streamlined. Sorry if that’s not possible or already been done, I am not well versed in js.

  18. Nina888 says:

    The trade with the plugin don’t work correctly …
    I will give all my inventory but if make 99 item A for have the maximum like have 15 item A in my inventory for the team 1 i have 99 and no just the amont of item A of 15.
    The money trade work perfectly for switching team .
    Can you do a update for did it (the switching inventory don’t work too with my game)

  19. HEX-VorteX says:

    Hi, I’ve been using the Party.anyAtRegion (4) function; for when I touch that region I call a common event and it causes damage to the party, my problem is doing this. ALL the regions that I have on the map hurt me, what am I doing wrong? It also happens if the same thing if I use the function Party.atRegion (1, 4) ;. I am using a conditional derivation process for the comparison in an event with parallel processing. Thank you.

  20. Maya Stringer says:

    Hello! I am trying to create a party to be called upon later, I need it to be created at the start of the game. so I placed the script: ‘Party.create(“box”);’ at the beginning of my autorun event that selects the lead player. But I get an error when the game starts up. The event ran fine before adding the script so I know its the script. But its like exactly the script you have written? Any advice? Thanks in advance! Love your work!

  21. Alby says:

    I have a question. Is there a a way to get this function to show up in the menu instead of calling up the script via talking to an NPC or using an item? It seems like it would be a really handy feature to have available on the fly at points. For example in my project, I’m using a three-member party system but I would like to have reserve party members to switch around with at points. Can this be done?

  22. Kanonelsebas says:

    Hi Hime! An Excellent Plugin, as always!
    I have a little question.

    Can you establish the position of the parties via Variables? So you can move the party you are not using to a waiting map, and then take it to the previous coordinates saved in a variable?

    Thanks for your time

    Greetings!

    • Kanonelsebas says:

      Ok, so I’ve figured it out. Just saving the X, Y and Map Id of Player to a different variables for every party is working fine. I Should figured it out sooner.

      I’m Really Sorry for bothering you.

      Anyway, this Plugin Is Awesome! (Well, all of yours plugins xD)

      Greetings!

  23. Pharonix says:

    I know this is way late.
    But how do I pull a list of all the members in a specific party?

    • Pharonix says:

      Had trouble with .members() as described below, but found that
      $gameVariables.setValue(602, Party.get(1)._actors[0]);
      works fine.

      • Pharonix says:

        So i did find out that it doesn’t update the game variable for current party properly.
        Everytime I call it, or display it, its undefined.

  24. eaed says:

    I am using this script and I am attempting to use multiple parties with this system. However, when I am making party two and three I have to put multiple people in before the first one shows up. If I cannot explain this correctly I can send you a demo. Let me know, thanks.

  25. Scott says:

    Is there an easier way for multiple parties to completely share their inventory besides using a separate trade script call for every possible item every time you switch parties?

  26. Tobias says:

    In a comment above, in reference to the issue that: “Idle parties are drawn on the map as events if they are on the same map. At this point, they are just visual indicators and do nothing.” It was mentioned that triggering a common event could be a possible solution.

    Looking at the code, I see where the template event is being created, but I am unsure how (or if) I can add the call common event there. Is it possible to call a common event, or is the idle party still stuck as an non-interact-able event?

    • kvagram says:

      Hi. I may be a year and a half late, but I found a fix for that.
      See my comment-thread above for how to do it.

      Since you clearly understand code, I’m gonna fill in the missing pieces for you:
      In the template event object, find the one page in the pages array.
      First, remove the page conditions, just leave it an empty object {}. That way, we know for sure the event page is valid.
      Next, on the list array, add a new item. The code is 117, call common event. The indent is 0. The parameter array has one item: the common event id you wish to call.
      in other words: {“code”:117,”indent”:0,”parameters”:[COMMON_EVENT_ID]}

      I don’t know why, you need to keep the empty command, but testing suggested so. May be a quirk in how the event-interpreter works.

  27. Ark Ds says:

    Hey thanks for the pluging, just a question, when i put it in the proyect (whit yanfly plugins also) when i try to load a previous game data (before use the party pluging) just play the “error/cancel sound” and not load the game, i can start a new game, but can’t use a old file… i am doing something wrong?

  28. Mitch says:

    So I’ve been trying to get this work, and I’ve followed the instructions, but whenever I try to set up another party it says “TypeError undefined is not a function”. I’ve messed with a lot of things, but there haven’t been any changes

  29. Mari says:

    Hi Hime, I was wondering about the “control inactive parties” function that you mention in the video, when are you planning on doing that? So that I can decide whether to wait or to build a workaround, like some blank map where all the unused parties are stored 😀 And also… okay, I’m dreaming: How about a function to keep inventories separate even if parties are merged? The inventory you access could e.g. always be the inventory of the first person in the formation. I’d like to use such a function for a game idea :). But it’s just a suggestion. Thanks very much for what you’ve programmed so far! Thanks to your effort, I’m able to make more interesting games and I appreciate the new possibilites your plugins offer. Best wishes, Mari

    • Hime says:

      It wouldn’t be feasible to have separate inventories when there’s only one party. When two parties are merged, they are basically one party; it’s not two separate parties traveling together. New functionality would need to be added to allow two parties to “travel together”, but not “merge”. This would also allow for the option to “unmerge” parties, which may be useful.

      I’m not sure when that will be implemented.

      For controlling inactive parties, what do you mean?

      • Mari says:

        Thanks for your thoughts on my suggestion! — As for inactive parties: You wrote that “Idle parties are drawn on the map as events if they are on the same map. At this point, they are just visual indicators and do nothing. However, in the future, you will be able to create your own events to determine how these idle parties should behave when you interact with them.”

        • Hime says:

          Oh, that feature. I still haven’t found a good way for users to manage the events. For example, if you wanted to be able to drop off a character at a random location, and then talk to that person again, you could potentially do this by setting up the idle party as an event that you can interact with.

          However, what if you wanted the idle party to respond the same way, anywhere? That’s where I’m not sure how to handle.

          • Mari says:

            Could speaking to an idle party trigger a common event? Just some dialogue like “Nice to see you” might be better than no response at all? But forgive me if this makes no sense, as I do not understand the programming behind the plugin or how the program works…

          • Hime says:

            That may work as a solution in the short-term.

          • kvagram says:

            I think I might have a clue on how, if you folks are still maintaining this.
            For talking with actor in an idle party, you could use a common event, or you could load an event from another map.
            I know this is possible from some yanfly plugins. That is, replace an event’s pages with that of another event (just to be technical).
            You could set up a set of events on a map, and have a plugin setting associating each actor with an event, running said event’s event-pages when the idle-party-member event is triggered.

            As for controlling a party, like as in a cutscene, why not require a dummy event for setting up the event commands?
            Then you could substitute all move command references to the dummy, with the idle-party’s event ID.

  30. Mari says:

    [oops, here is the MV article. Sry, I accidently posted this elsewhere too]

    The first time I tested the plugin it worked fine and I was delighted. Next time I testplayed I couldn’t load any of my old save games. It didn’t matter much, so I started a new game. Since then, however, to my disappointment, the script commands of the plugin don’t have any visible effect anymore. No other party appears nor can I switch to it. Any ideas about what went wrong, or how it can be fixed? Thanks!!! 🙂 ——– I use MV, Version 1.0, German, Win 8.1

    • Hime says:

      So you started a new game, created a party, but you are unable to switch to the other party?

      • Mari says:

        Hi, thanks for the reply 🙂 I cannot even create a new party. It’s as if the plugin commands don’t have any effect. No error message either. I tried to re-download and re-implement the plugin, and checked whether other plugins interfered with it by creating a new project with only this plugin, but still, it doesn’t work…

        • Hime says:

          These are script calls, not plugin commands.

          • Mari says:

            Ahh…. that’s what I did wrong. Never used scripts before.. ^^° Thank you so much for helping me out so quickly & with the right information! It’s working now 🙂

  31. Steffi says:

    Thanks for the great plugin, Hime!!

    Unfortunalety, I’ve got an error when using the plugin.
    I tested it in an empty project and installed the party manager as single plugin so I can be sure that it isn’t an compatibility issue. After using the script call Party.create(2), there is the first error:

    Uncaught TypeError: Cannot read property ‘trim’ of undefined
    rpg_managers.js:1722 TypeError: undefined is not a function
    at Game_Interpreter.eval (eval at

    The error is in line 354: $.defaultPartyId = $.params[“Default Party ID”].trim();

    I don’t know what I have done wrong, I excatly followed the help instructions…

    Could you please help?

    Thank you for your great work!

  32. johnseed says:

    Hello
    I try to save the id of a player of a second party in a variable.
    how to do?
    a command like:

    var subActor = $gameParty(2).members()[0];
    $gameVariables.setValue(1, subActor.actorId());

    tanks
    ps: sorry for my bad english

  33. Anonymous says:

    Can i create a party with 12 actors?

  34. Anonymous says:

    This is awesome! What if I want to have an event move toward the closet party?

    Do you know how can set this up?

  35. Blaze says:

    Is there a way to switch parties in battle? I tried, but got an error due to not having a location for the previous party. Do I have to set a location for them mid-battle? Or would that just not work with this plugin?

  36. HOY says:

    It’s very useful ! Thank you !

  37. Anonymous says:

    It’s very useful ! Thank you !

  38. Lightheaven says:

    Great plugin.
    One question, can the idle parties members params be referenced?

    • Hime says:

      Idle party members are just regular actors.
      You would access their parameters like any other actor.

      Though, I just realized there wasn’t a standard way of accessing a specific party.

      I have updated the plugin so that you can access parties like this
      var party = Party.get("My Other Party")
      var leader = party.leader();
      // leader.atk

      Using Party.get, you can retrieve a reference to a specific party.
      From there, you can check the leader(), or check the members().

      • Lightheaven says:

        i was somehow managed to get the param from other party with this:

        Game_Parties.prototype.getParam = function(id, paramid) {
        id = id.toString();
        var currentParty = $gameParty;
        $gameParty = this._parties[id];
        var getParam = $gameParty.battleMembers()[0].param(paramid);
        $gameParty = currentParty;
        return getParam;
        };

        but, since i’m a beginner in js so i don’t know if that will cause issues.

        Thanks for the update

        • Hime says:

          That wouldn’t cause any issues, but it is not necessary to perform the variable swapping.

          You can just write
          return this._parties[id].battlerMembers()[0].param(paramid)

  39. Vincent says:

    Thank you !

  40. Zephadus says:

    Thank you so much! 😀

Leave a Reply

Your email address will not be published. Required fields are marked *