The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: modern algebra on April 02, 2008, 05:24:37 AM

Title: Multiple Parties
Post by: modern algebra on April 02, 2008, 05:24:37 AM
Multiple Parties
Version: 1.0b
Author: modern algebra
Date: April 2, 2008

Description


This script allows you to maintain multiple parties (separate item lists, step count, everything) and allows you to merge them at will. Primarily useful for a game where parties split up or a game where you can have separate parties

Features


Screenshots

N/A for this script

Instructions

FROM SCRIPT:
Place this script below all of the default scripts in the Script Editor.
There are several codes to keep in mind:

   $game_parties[id]                                :accesses the party located in that index creates it if it does not yet exist.
   $game_parties[id] = X                          :Sets the party to X. It MUST be a Game_Party object
   party = $game_parties.merge(id1,id2) :merges two parties and saves them in party
   $game_parties.merge! (id1, id2)          :merges two parties and saves them in $game_parties[id1] and deletes $game_parties[id2]
   $game_parties.delete (id)                    :Deletes $game_parties[id]

In order to switch the current party, just do this:

   $game_party = $game_parties[id]
   $game_player.refresh

By default, the original party is saved in $game_parties[0], so you may want to avoid overwriting $game_parties[0] and just work with 1,2,...

Also, be very careful when dealing with parties. Always remember what parties exist and where they are in $game_parties or else you may make a stupid error occur.

    *EXAMPLE EVENT*

      @>Change Items: [Potion], + 1
      @>Change Gold: + 50
      @>Script: p = $game_parties[1]
       :      : $game_party = p
       :      : $game_player.refresh
      @>Change Party Member: Add [Oscar], Initialize
      @>Change Weapons: [Bastard Sword], +1
      @>Change Gold: + 100

This event just switched your party to the party with index 1, and, assuming that $game_parties[1] did not previously exist, if you looked at your menu you would see that Oscar is in the party, you have 100 Gold, and a Bastard Sword. The potion and the other 50 Gold went to the initial party

Now, let's say Oscar later meets up with his party and rejoins. Then this event would do the trick:

   @>Script: $game_parties.merge! (0, 1)
     :      : $game_party = $game_parties[0]
     :      : $game_player.refresh

And there, the two parties have been merged and everything that Oscar had obtained goes to the party.

Script


Code: [Select]
#==============================================================================
#  Multiple Parties
#  Version: 1.0b
#  Author: modern algebra (rmrk.net)
#  Date: April 2, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#    This script allows you to maintain multiple parties (separate item lists, steps,
#    everything) and allows you to merge them at will. Primarily useful for a
#    game where parties split up or a game where you can have separate parties
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Place this script under ? Materials in the Script Editor.
#    There are several codes to keep in mind:
#
#      $game_parties[id]                :accesses the party located in that index.
#                                       :creates it if it does not yet exist.
#      $game_parties[id] = X            :Sets the party to X. It MUST be a  
#                                       :Game_Party object
#      p = $game_parties.merge(id1,id2) :merges two parties and saves them in p
#      $game_parties.merge! (id1, id2)  :merges two parties and saves them in
#                                       :$game_parties[id1] and deletes $game_parties[id2]
#      $game_parties.delete (id)        :Deletes $game_parties[id]
#
#    In order to switch the current party, just do this:
#
#      $game_party = $game_parties[id]
#      $game_player.refresh
#
#    By default, the original party is saved in $game_parties[0], so you may
#    want to avoid overwriting $game_parties[0] and just work with 1,2,...
#
#    Also, be very careful when dealing with parties. Always remember what
#    parties exist and where they are in $game_parties or else you may make a
#    stupid error occur.
#
#        *EXAMPLE EVENT*
#
#      @>Change Items: [Potion], + 1
#      @>Change Gold: + 50
#      @>Script: p = $game_parties[1]
#       :      : $game_party = p
#       :      : $game_player.refresh
#      @>Change Party Member: Add [Oscar], Initialize
#      @>Change Weapons: [Bastard Sword], +1
#      @>Change Gold: + 100
#
#    Assuming that $game_parties[1] did not previously exist, this event just
#    switched your party to the party with index 1, and if you looked at your
#    menu you would see that Oscar is in the party, you have 100 Gold, and a
#    Bastard Sword. The potion and the other 50 Gold went to the initial party
#
#    Now, let's say Oscar later meets up with his party and rejoins. Then this
#    event would do the trick:
#
#      @>Script: $game_parties.merge! (0, 1)
#       :      : $game_party = $game_parties[0]
#       :      : $game_player.refresh
#
#    And there, the two parties have been merged and everything that Oscar had
#    obtained goes to the party.
#==============================================================================

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  Summary of Changes:
#    new method - add_multiple_steps
#==============================================================================

class Game_Party < Game_Unit
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Multiple Steps
  #    amount : the amount of steps to add
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_multiple_steps (amount)
    @steps += amount
  end
end

#==============================================================================
# ** Game_Parties
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This class handles Parties. It's a wrapper for the built-in class "Array."
#  It is accessed by $game_parties
#==============================================================================

class Game_Parties
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    @data = [$game_party]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Retrieve Party
  #    id : the ID of the party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def [] (id)
    @data[id] = Game_Party.new if @data[id] == nil
    return @data[id]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def []= (id, party)
    # Does nothing unless it is a party object
    return unless party.class == Game_Party
    @data[id] = party
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Merge
  #    id_1 : the ID of the first party
  #    id_2 : the ID of the second party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def merge (id_1, id_2)
    new_party = Game_Party.new
    # Get old parties
    op1 = self[id_1]
    op2 = self[id_2]
    # Gold
    new_party.gain_gold (op1.gold + op2.gold)
    # Members
    (op1.members | op2.members).each { |actor| new_party.add_actor (actor.id) }
    # Items, Weapons, and Armor
    (op1.items | op2.items).each { |item|
      new_party.gain_item (item, op1.item_number (item) +  op2.item_number (item))
    }
    # Steps
    new_party.add_multiple_steps (op1.steps + op2.steps)
    # Last Item
    new_party.last_item_id = op1.last_item_id
    # Last Actor
    new_party.last_actor_index = op1.last_actor_index
    # Last Target
    new_party.last_target_index = op1.last_target_index
    # Quests (if game includes my Quest Log)
    begin
      (op1.quests.list | op2.quests.list).each { |quest|
        new_quest = new_party.quests[quest.id]
        # Reveal Objectives
        quest.revealed_objectives.each { |i| new_quest.reveal_objective (i) }
        # Complete Objectives
        quest.complete_objectives.each { |i| new_quest.complete_objective (i) }
        # Fail Objectives
        quest.failed_objectives.each { |i| new_quest.fail_objective (i) }
        # Concealed?
        new_quest.concealed = quest.concealed
        # Reward Given?
        new_quest.reward_given = quest.reward_given
      }
    rescue
    end
    return new_party
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Merge!
  #    id_1 : the ID of the first party to which the second party is merged
  #    id_2 : the ID of the second party that is deleted
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def merge! (id_1, id_2)
    @data[id_1] = merge (id_1, id_2)
    delete (id_2)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Delete
  #     id : the ID of the quest to be deleted
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def delete (id)
    @data[id] = nil
    # If this was the last in the array
    if id == @data.size - 1
      # Delete any nil elements that exist between this party and its successor
      id -= 1
      while @data[id] == nil
        @data.delete (id)
        id -= 1
      end
    end
  end
end

#==============================================================================
# ** Scene_Title
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - create_game_objects
#==============================================================================

class Scene_Title < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Game Objects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_multiparty_crt_gme_objcs_5som create_game_objects
  def create_game_objects
    modalg_multiparty_crt_gme_objcs_5som
    $game_parties      = Game_Parties.new
  end
end

#==============================================================================
# ** Scene_File
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - read_save_data, write_save_data
#==============================================================================

class Scene_File
  
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Write Save Data
  #     file : write file object (opened)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_multiparty_wrt_sv_dta_6hye write_save_data
  def write_save_data(file)
    modalg_multiparty_wrt_sv_dta_6hye (file)
    Marshal.dump($game_parties,        file)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Read Save Data
  #     file : file object for reading (opened)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_multiparty_rd_sv_dat_2gte read_save_data
  def read_save_data(file)
    modalg_multiparty_rd_sv_dat_2gte (file)
    $game_parties        = Marshal.load(file)
  end
end

Credit



Support


Just post here for support

Known Compatibility Issues

If you are using the Quest Journal, please copy the script above, rather than out of the demo, as the demo has an error that may cause the game to incorrectly merge the quests of the two parties.

Author's Notes


Just a script I need to have for my own game that I wanted to share

Demo


See attached.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
Title: Re: Multiple Parties
Post by: Demonic Blade on April 03, 2008, 05:35:05 PM
Nice, a pretty good idea actually, though I don't really get it. I might (just might) use it...
Title: Re: Multiple Parties
Post by: Leventhan on April 04, 2008, 06:33:34 AM
Can you perhaps make a demo?
If you have time for it...
Title: Re: Multiple Parties
Post by: modern algebra on April 04, 2008, 09:00:43 PM
Alright, demo is up. It probably looks complicated, but it's the eventing that is complicated, not the scripting.

Also, VX is annoying and doesn't give you the option of not fading when you transfer player, so you'll see some stupidness when you play the demo. I will write a script that allows you not to fade when you teleport perhaps.
Title: Re: Multiple Parties
Post by: Zeldrak on April 04, 2008, 09:09:20 PM
MA, would this work on XP?

if not, is there something smilar out there?
Title: Re: Multiple Parties
Post by: modern algebra on April 04, 2008, 09:27:21 PM
No, it wouldn't work in XP as is. As for something similar - there's a script on phylomortis that allows for many item bags. It's not an entire party, but it might suit your purposes: And I would link but apparently phylomortis expired on March 29 :(



Alright, I found it on my computer, but there are no credits anywhere :(

Anyway, I attached it to this post.
Title: Re: Multiple Parties
Post by: Zeldrak on April 04, 2008, 09:47:10 PM
although that's helpful, i was looking more on the lines of the multiple parties per se.

having about 3 groups in the same area, when you pressed a button, you changed from a party to another, and the other parties kept the same positions after changing to the other.

if you don't understand, try checking kefka's tower from ff3(6)
Title: Re: Multiple Parties
Post by: modern algebra on April 04, 2008, 10:14:07 PM
That sounds like my demo actually :P

Anyway, I can probably make one of these for RMXP - it'd be short. But it still takes some eventing to make it work. The primary purpose of the script is to not share inventory and gold with other parties. If that is necessary for your puzzle then I will translate the script. Otherwise, a script is not necessary.
Title: Re: Multiple Parties
Post by: Leventhan on April 05, 2008, 12:12:00 AM
Tried the demo.
Using this kind of script actually opens up the way to many more puzzle possibilities, definitely practical and usable.
Title: Re: Multiple Parties
Post by: modern algebra on April 19, 2008, 04:04:51 AM
:(

I made a mistake. I've fixed the script now, so don't worry about it if you're new to the script, but anybody who already has the script will need to recopy the script and replace the one they have right now. Though, you've probably noticed it if you've tried to save  :'(
Title: Re: Multiple Parties
Post by: brutebasher9 on May 04, 2008, 12:24:38 AM
While using this command (picture) to switch parties, my characters lose all of their items when toggling parties. May you please tell me what is wrong? :?
Title: Re: Multiple Parties
Post by: modern algebra on May 04, 2008, 12:32:18 AM
What picture?
Title: Re: Multiple Parties
Post by: ahref on May 04, 2008, 09:46:19 AM
looks great. you could like split parties to go two different ways in some woods or something and then thed meet back in the middle with new items. Think scooby doo where they all come together with new clues but not as lame :D.

btw theres a typo in the description section "and arrows you to merge"
Title: Re: Multiple Parties
Post by: Demonic Blade on May 04, 2008, 02:09:57 PM
but not as lame

That's a great way to use the script, but why can't things be lame and hilarious...? :'( ;)
Title: Re: Multiple Parties
Post by: brutebasher9 on May 04, 2008, 07:49:50 PM
pardon..here's the picture, sorry!
Something else I tried that didn't work was the text command \n[\v[17]] that resulted in a Window_Message error at line 218. It probably happened because the two commands were never supposed to merge like that..ironic, huh?
Title: Re: Multiple Parties
Post by: modern algebra on May 28, 2008, 09:32:36 PM
Sorry, I missed your post. Just so that I understand the problem, are you saying that items are not saved? (I.E. if one party collects items and then you switch to another party and then switch back, the first party no longer has those items?) Or are you saying that the second party does not have the items the first party collected? If the latter, that is part of the purpose of the script. Also, you should not get any error from \n[\v[17]], unless \v[17] has a value larger than the number of actors you have set in the database


EDIT:

That being said, I sort of discovered that I had overlooked something because I am an idiot. Anyway, the script has been updated and fixed.
Title: Re: Multiple Parties
Post by: gabiot on June 08, 2008, 07:59:37 AM
I'm actually having that odd problem too.  Mines really complex:

At the beginning of my game, I add 3 potions of two types, and a journal.  Now I can play through the game, and earn items, (for example on this test run I just earned 1 more of each type of potion, and some other new items).  Now it works just fine, but later on I switch to a new party and play with that party.  Works fine, the items don't show up for it, as the script intends.  Then I also switch to a 3rd party for a short custscene battle.  But when I switch back to my original party, and get ready to play with them again, here's the inventory:  3 potions of each type, and a journal!  So it didn't pick up the items I obtained while playing with them...

Is this an error you could pinpoint?

Edit:  Also I just noticed you updated your script.  Did this update fix this problem?
Title: Re: Multiple Parties
Post by: modern algebra on June 08, 2008, 01:38:19 PM
No, it did not. But are you re-initializing the party?

I am assuming your initial party is $game_parties[0], but are you switching back to that party or are you recreating it? You should not recreate it.

I think that's the problem. As far as I can tell, it is not an error in the script, as the demo does not have that problem. But, if you can't figure it out, then you can either upload your project to sendspace and PM it to me to take a look at, or, if you don't feel comfortable sharing your project at this stage you can try to recreate the problem in a new project and send that to me.

Your problem is weird though, since you add those items to your party at the start of the game., so it can't be that the party has been recreated. So, maybe: do you change to another party shortly after the beginning of the gamer - remember the array counts from 0, 1, 2 ..., not 1, 2, 3... So I am thinking maybe you made the error of believing that your second party has ID 2 instead of ID 1, so when you switch back to the initial party, you actually switch to a new party... Anyway, I won't know what the actual problem is unless I can see the project.
Title: Re: Multiple Parties
Post by: moejoeman on August 22, 2008, 02:56:29 AM
Thanx mate heaps of help   ;D
Title: Re: Multiple Parties
Post by: Grandhoug on August 31, 2008, 03:00:55 AM
I was wondering if you could maybe make a little tutorial of this for the eventing, only because it really does seem complicated.
if you did may you post the link, if I just didn't overlook it 
Title: Re: Multiple Parties
Post by: moejoeman on August 31, 2008, 04:45:08 AM
.... mate.... that's why there is the demo....
Title: Re: Multiple Parties
Post by: Grandhoug on August 31, 2008, 10:40:30 AM
I understand that, but I asking for a less compilcated event example for n00b evnters like me
Title: Re: Multiple Parties
Post by: modern algebra on August 31, 2008, 10:56:23 AM
Well, the instructions and the demo seem pretty clear to me:

#      @>Script: p = $game_parties[1]
#       :      : $game_party = p
#       :      : $game_player.refresh

That's the script command that changes to a new party, and then if you want to add actors and things all you need to do is use regular event commands. Once an actor is in a party, you will not have to add him again every time though. So, if you run this event below:

#        *EXAMPLE EVENT*
#
#      @>Change Items: [Potion], + 1
#      @>Change Gold: + 50
#      @>Script: p = $game_parties[1]
#       :      : $game_party = p
#       :      : $game_player.refresh
#      @>Change Party Member: Add [Oscar], Initialize
#      @>Change Weapons: [Bastard Sword], +1
#      @>Change Gold: + 100

Then your second party has Oscar, a Bastard Sword, and 100 G. If you then run this code:

#      @>Script: p = $game_parties[0]
#       :      : $game_party = p
#       :      : $game_player.refresh

It will switch back to your first party, and if you then run this code:


#      @>Script: p = $game_parties[1]
#       :      : $game_party = p
#       :      : $game_player.refresh

It will change back to the second party, which would still have Oscar, a Bastard Sword, and 100G.

Merging is even easier:  $game_parties.merge (id_1, id_2).

Here though:

Code: [Select]
#==============================================================================
# ** Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - change_party
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Change Party
  #    party_id : The ID of the party to change to
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def change_party (party_id = 0)
    $game_party = $game_parties[party_id]
    $game_player.refresh
  end
end

If you add this into the game, then you can use this command to change parties:

@>Script: change_party (new_party_id)
Title: Re: Multiple Parties
Post by: Grandhoug on September 02, 2008, 01:25:02 AM
thanks for makin it a simpler
Title: Re: Multiple Parties
Post by: brutebasher9 on October 04, 2008, 11:36:13 PM
Awkward considering it's months later, but still..Thanks Modern for updating your script.
Title: Re: Multiple Parties
Post by: Snufflekins on March 03, 2009, 03:55:32 PM
Gah, I feel like I'm necroposting but I have a question to this script.

Alright, I am trying to use this script but it will not let me load any saved games. I continuously get the same error every time.

This is the error I receive:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi255.photobucket.com%2Falbums%2Fhh145%2FKragnos%2Fmultiplepartiesloaderror.jpg&hash=393c7ddcb5a855a3c3c8313f2ab648b56b7dd91d)


I have left party 0 normal, with it not being bound to an object at all, and I have also tried this script:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi255.photobucket.com%2Falbums%2Fhh145%2FKragnos%2Fmultiplepartiesloaderror2.jpg&hash=3f4893795d806d43ac349e0d5770e8e6cf7df318)

hoping that giving it a game party object would allow the load to work and maybe that was it's issue, but it still doesn't work.

what can i do? :\
Title: Re: Multiple Parties
Post by: modern algebra on March 03, 2009, 05:06:34 PM
Well, that is not an error I receive when testing the demo. Does the same problem exist when you test the demo? If not, it may be a compatibility error ~ in fact, that would be my assumption. My first guess is that you are using a script that modifies Scene_Title, maybe a special picture scene or even just a title skip or something, and that is causing the issue. If that is the case, try placing this script below the other in the script editor and see if that makes any difference; report the results.

Also, $game_party is preserved, so there is no need to do that little code that you do.
Title: Re: Multiple Parties
Post by: tSwitch on March 03, 2009, 05:06:59 PM
are they savegames you had before putting the script in?

can you post the script for reference?
Title: Re: Multiple Parties
Post by: Snufflekins on March 03, 2009, 06:16:03 PM
Well, your scripts are always at the very bottom of my materials section, with no other scripts below it. The only thing I can really think of doing is just allowing you to look at the problem yourself because I'm afraid I can't see any other reason for why it would do this and I'm terrible at finding compatibility errors in scripting. If you'd like to see the problem I am having:

http://www.mediafire.com/?umaynen2mwm

otherwise, For changing a save menu, I'm using BigEd781's FF9 Save Menu and Menu systems, but their script is above yours.
Title: Re: Multiple Parties
Post by: modern algebra on March 03, 2009, 07:59:16 PM
Hmm... is there a specific point where this error occurs?

I liked your battle system, though it was a little too easy to tell what the enemy was going to do. Anyway, I was able to save in the tavern and load without any problems. It might be a problem, as NAM said, if the save game you are trying to load is old, ie before you added this script, then there would be problems.

I looked at the scripts and the way you have them arranged I don't see a reason for this problem to occur. NAM's suggestion is the only thing that comes to mind... sorry. If that is not the case, then I will try to fix it, but I am so far unable to reproduce the error.
Title: Re: Multiple Parties
Post by: Snufflekins on March 04, 2009, 03:50:03 AM
xD it WAS the case. -doh!- well i appreciate your help in the issue and look forward to using the script :P
Title: Re: Multiple Parties
Post by: dbzmaster444 on January 02, 2010, 06:21:02 AM
Hey, I'm having a problem.
For example, lets say the First Party completes a Quest.
Then I add two new characters as a different party
who complete a another Quest.
When I try to merge the two parties, the Quest completed by
the second party isn't merged.
Here's an example of my problem:
http://www.mediafire.com/?0qy5vdxldzz
Title: Re: Multiple Parties
Post by: modern algebra on January 02, 2010, 04:49:13 PM
OK, I didn't look into fixing the caterpillar, aside from maybe using Zeriab's Caterpillar, but there was an error in my Multiple Parties script which was causing the quest updating problem. To fix it, go to line 137 which starts with:
Code: [Select]
    # Quests (if game includes my Quest Log)
    begin
and ends at line 156 with:
Code: [Select]
    rescue
    end

Replace that whole section with:

Code: [Select]
    # Quests (if game includes my Quest Log)
    begin
      (op1.quests.list + op2.quests.list).each { |quest|
        new_quest = new_party.quests[quest.id]
        # Reveal Objectives
        quest.revealed_objectives.each { |i| new_quest.reveal_objective (i) }
        # Complete Objectives
        quest.complete_objectives.each { |i| new_quest.complete_objective (i) }
        # Fail Objectives
        quest.failed_objectives.each { |i| new_quest.fail_objective (i) }
        # Concealed?
        new_quest.concealed = quest.concealed
        # Reward Given?
        new_quest.reward_given = quest.reward_given
      }
    rescue
    end

Hopefully, that will resolve the problem. Thanks for taking the time to make that demo - I appreciate that effort as it makes it a lot easier to debug. So, thanks for pointing it out and thanks for being so helpful in its resolution.
Title: Re: Multiple Parties
Post by: dbzmaster444 on January 03, 2010, 02:31:44 AM
Thank you very much, it works ;D
Title: Re: Multiple Parties
Post by: ShortStar on May 08, 2010, 10:33:23 PM
Sorry to necro post, but this is another great script from you MOD. :-) If only it could work with previously saved games.

Like take the current party in the save file and make it

$game_parties[0] = $game_party

I am also having trouble merging thee parties. What I mean is this:

$game_parties.merge! (1,2)
$game_party=$game_parties[1]
$game_parties.merge! (0,1)
$game_party=$game_parties[0]
$game_player.refresh

Party 0 seems to become party 1 instead of a merge of them both. It merges the items, but deletes everyone from party 0 and merges to party 1
Title: Re: Multiple Parties
Post by: willee02 on August 20, 2010, 04:46:25 PM
Is it possible that instead of calling this script on the menu it'll be called in an event instead. Example, the player needs to talk to a journal sprite or a party organizer sprite who will organize the party.

I also found this script incompatible with Yui's Mog Menu. I hope this information is useful.
Title: Re: Multiple Parties
Post by: modern algebra on August 20, 2010, 05:52:49 PM
This script only works through event commands. It has no menu option. I don't know why it would be incompatible with any menu.
Title: Re: Multiple Parties
Post by: willee02 on August 20, 2010, 06:25:42 PM
awwww wrong thread... >__<
sorry :(
Title: Re: Multiple Parties
Post by: Adrien on January 06, 2011, 01:10:07 AM
So this is where I guess you ask questions:

How do I say who is in what party?
How do I make it so - Party A can only switch to party B at location X and no where else in the game. If they want to switch from B to A they must go back to said location OR meet at another location such as say Inns through out the game or Pubs where as the game goes on there are more and more parties
Title: Re: Multiple Parties
Post by: modern algebra on January 06, 2011, 02:43:38 AM
Old script, but if I recall correctly, you just use the regular Change Party Member event command. It is added to the active party. So, if you want an actor in a particular party, change that to the active party and add the actor.

The second one is just an eventing issue. The only way to switch parties is through an event, so only put those events in the specific locations and you'll only be able to do them there.
Title: Re: Multiple Parties
Post by: Adrien on January 06, 2011, 02:44:55 AM
Ok I think I got it. ill leave the script out for now and fiddle with it. Thanks.
Title: Re: Multiple Parties
Post by: rainith on May 04, 2011, 05:37:35 PM
I am making a rpg on VX. It has 20 heroes to chose from and you can only pick 2. I want to control each hero independently like a tactics game. Is there kinda like a blanket event command/script I could use to switch parties, or do i need to set up events for each combination of characters?
Title: Re: Multiple Parties
Post by: gerkrt on July 14, 2011, 06:23:41 PM
I ported this script to Xp, i think well, check here:
http://rmrk.net/index.php/topic,43193.0.html
Title: Re: Multiple Parties
Post by: modern algebra on July 14, 2011, 07:14:11 PM
Thanks. It looks good from what I can see. I had received some reports of bugs that I never found the time to fix, so that might be a problem in the future - I will notify you when I find out what the problem is so you can fix it in the XP version.
Title: Re: Multiple Parties
Post by: gerkrt on July 14, 2011, 07:37:58 PM
Thanks. It looks good from what I can see. I had received some reports of bugs that I never found the time to fix, so that might be a problem in the future - I will notify you when I find out what the problem is so you can fix it in the XP version.

I will be looking for that then.
Title: Re: Multiple Parties
Post by: Foxhounder on April 19, 2014, 10:21:56 AM
Sorry for necroposting here, but I am curious if there is a way to change this script to allow for a shared inventory and gold between parties. Something similar to Final Fantasy 6.