Multiple Party Merger

This script allows you to merge two parties together. A merge involves  transferring all of the members, inventories, and gold from one party to another. The original party will be deleted, resulting in one combined party.

Download

Script: download here
Required: Party Manager

Installation

Install this script below Party Manager and above Main

Usage

Assuming two parties already exist, use the script call

merge_parties(id1, id2)

Where id1 and id2 are the ID’s of the parties that you want to merge. The second party will be merged into the first.

The first party will be set as the active party, and the second will be deleted.

Example

To merge party 5 into party 3, use the script call

merge_parties(3, 5)

Compatibility Notes

This script assumes that only members, inventory, and gold need to be merged.

It also assumes the default implementation of party members, inventory, and gold are used. If you have scripts that add new properties to parties, you may need to add logic to merge those as well.

You can add new logic to the Game_Party#merge method as needed.

You may also like...

32 Responses

  1. Nando says:

    I’m a big fan of your scripts. I’m still fairly new to this, I’d really like to complete this project so I can start tinkering with MV. I’ve been pulling my hair out with lost hours trying to figure out how I can make a script call that will take an item gained from the active party and automatically transfer it to the reserve party. I thought I had the scripting right, but it keeps returning one of methods as undefined when I’ve defined it (or so I thought). I’m at the end of my scripting knowledge.

    • Hime says:

      Let me add a script call that will allow you to transfer items from one inventory to another.

      • Nando says:

        Omg, that’s the quickest response ever. I’ll be sure to donate, also please send me an e-mail about your commission fees. I may need some things in the future.

      • Nando says:

        Any luck on the script call? I’m willing to pay for it. I’d really like to finish this project. Happy Holidays.

        • Hime says:

          I couldn’t find a way that will allow you to automatically grab the last item received without actually going into the gain_item method and changing it, but you probably wouldn’t want to do that because then it will affect all item gaining logi.

          • Nando says:

            It doesn’t necessarily have to be the last item received. It’s only one specific item. What I’m looking for is something like:

            when game_party(1) gain_item (ID, amount)

            then
            game_party(5) gain_item(ID, amount)
            game_party(1) remove_item(ID,amount)

            Doesn’t the Party Manager script store party information like item/ quantities? Could it be a similar script call to the party merger, but instead of the entire inventory, just one item. I think I have an event that constantly checks the current parties inventory for said item and stores it as a variable. If that can help.

            What if I create a separate a Control Variable for Party A,B,C,D, based on the qty of the item and then a script call that will add the total to the inventory of Party E or D, but the only thing I can’t figure out is how to reset the control variable’s for A,B,C,D. Unless I Event it in reverse? Remove_Item based on variables A,B,C,D?

          • Hime says:

            You can get a reference to a particular party, and then add/remove items

            $game_parties[PARTY_ID1].lose_item($data_items[ITEM_ID, amount)
            $game_parties[PARTY_ID2].gain_item($data_items[ITEM_ID, amount)

            You might use the item_number($data_items[ITEM_ID]) call to check how much you have, and use that as the amount.

          • Nando says:

            Item ID can be a constant.

          • Nando says:

            In that example: item_number($data_items[ITEM_ID])

            would item_number be the variable amount and [ITEM_ID] a constant?

          • Hime says:

            Anything that evaluates to a number. You can reference a variable, or a constant number, and so on.

          • Nando says:

            come to think of it, this script call will work just fine.

            $game_parties[PARTY_ID2].gain_item($data_items[ITEM_ID, amount)

            I can just event using this script call in order to add a specific item/amount to an inactive party correct?

            For example if I’m in Party 1 (Active Party) and use the script call

            $game_parties[PARTY_ID2].gain_item($data_items[104, 2) with an event like a quest reward.

            That will place x2 Item #104 in Party 2’s (Inactive Party) Inventory?

          • Hime says:

            Yes.

          • Nando says:

            I’m sorry to be a bother and I’m sorry I’m so bad at scripting, but I’m trying to figure out how to use a script call to check the variable.

            $game_parties[PARTY_ID2].gain_item($data_items[ITEM_ID, amount)
            $game_parties[5].gain_item($data_items[100, game_variables[148])

            I’m trying to return a variable for the amount, but I don’t know how to script it exactly.

          • Nando says:

            Nevermind, I got it all worked out. Thank you for the help.

        • Nando says:

          Man, I thought I had it…

          This is what you gave me:
          $game_parties[PARTY_ID2].gain_item($data_items[ITEM_ID, amount)

          I’m tried these:
          $game_parties[5].gain_item($data_items[100, 10)
          $game_parties[5].gain_item($data_items[100, 10])

          Not sure what I’m doing wrong, but to confirm. If I’m using this script call in Party 1, then this will add x10 item #100 to Party 5?

          • Nando says:

            Ok, I got it to work. I used

            $game_parties[PARTY_ID].gain_item($data_items[ITEM_ID],
            amount)

            I guess it was just a typo on what you gave me. Sorry to clog you’re board. I’ll donate as soon as I find my paypal password.

          • Hime says:

            Oops, ya it was a typo. Sorry!

  2. Deebs says:

    Oh geeze, nevermind, I didn’t see the new comments were at the top and not the bottom. Thank you for looking into that! I could of swore I had the newest versions because I just downloaded them a few days ago. I’m not sure where I got out of date scripts from.

    Thanks again!

    • Hime says:

      Does updating the scripts solve the problem?

      • Deebs says:

        It seems to, yeah! I figured out how I got old scripts- I had pulled them out of the demos you had available rather than downloading the actual scripts.

        The only issue I can spot is (and this is from the clean project), is that the the idle events don’t always erase, particularly when you switch the parties around. However, it doesn’t seem to be an issue in my -actual- game project, so I don’t know what’s going on there, and frankly I can’t complain if it’s working in my ‘real’ project.

        I want to thank you again for having taken the time to look into this, even though the end result is that it was a mistake on my part. I’m a huge fan of your work, as well. I love the fact you have so many scripts based upon gameplay elements. Thank you!

  3. Anonymous says:

    I sent you the project but I’m unsure if it got through or not. Hopefully it did. If not I’ll resend for you. Thank you.

  4. Deebs says:

    Here is the file on dropbox- https://dl.dropboxusercontent.com/u/61306925/Party%20Test.exe

    Thank you for taking the time to look at this.

    • Hime says:

      I looked at the scripts and they are using older versions. Update the Party Manager and the Idle Party Events.
      I’ve also updated Party Merger so that idle events are not leftover after merging.

      See if that will solve the problem.

  5. Deebs says:

    I’m sorry to bother you here but I’ve been trying all day to get this working right and I feel like pulling my hair out. I’ve tried several different things to get it working. At one point I even thought it was a script compatibility error, but even after putting it in a fresh, new project with only Party Management scripts and it’s add-ons, it still throws out an error and crashes the moment the event reads the script call with ‘merge_parties(1, 2)’. This is the error it throws:

    *> Script ‘Game_Interpreter’ line 1411: NoMethodError occured. undefined

    method ‘character_name’ for nil:NilClass*

    I don’t understand what I could possibly be doing wrong. As I mention, I’ve tried to work around this issue multiple times. I’ve tried seeing if synchronizing the parties first helped, I’ve tried seeing if removing actors from the other parties and adding them into the first party first helped… But no matter what, if I do the merge script call it crashes. I have the fresh project that I could give to you to show you the issue, if you’d like.
    To reitterate, I’m only using the Party Management scripts you’ve shared, but the only ones I’m actively using in that clean project are the main Party Management script, Idle Party Events, and the attempted use of Multiple Party Merger script.

    • Hime says:

      Send me the fresh project. This may be related to a compatibility issue between merging and idle party events, though when I tried merging parties with idle parties on the map, the crash didn’t occur.

      So I’m not sure what could be causing it.

Leave a Reply

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