Party Manager

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

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.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

39 Responses

  1. 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.

  2. 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?

  3. 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?

  4. 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?

  5. 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

  6. 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.

  7. 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 🙂

  8. 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!

  9. 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

  10. Anonymous says:

    Can i create a party with 12 actors?

  11. 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?

  12. 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?

  13. HOY says:

    It’s very useful ! Thank you !

  14. Anonymous says:

    It’s very useful ! Thank you !

  15. 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)

  16. Vincent says:

    Thank you !

  17. Zephadus says:

    Thank you so much! 😀

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax