Tsukihime's Party Manager query combining parties

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I am using Tsukihime's Party Manager script found here.

I have 2 parties which have been operating completely independently from the beginning of the game.  I now wish to combine these parties.  I can see how to combine the actors, using the script calls to synchronise the parties.  What I cannot see is how to combine their separate inventories, other than create a variable for every single item they might have and then adding that variable to one party's inventory.  Huge job, and prone to error.

Does anyone know another way this might be done?

Thanks.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Unofficial. Merges members and inventories.

Script works as follows

# Merge party with id2 into party with id1merge_parties(id1, id2)eg: merge_parties(1, 2) # merges party2 into party 1Performs the following1. Merge members (default "add actor" command)

2. Merge inventories (default "change item/armor/weapon" command)

3. Sets first specified party as the active party (in case you are merging the active party into an inactive party)

4. Deletes the other party

http://himeworks.com/redirect.php?type=script&name=party_merge

Only use if inventories are stored with party (eg: actor inventory doesn't need this)

If merged items exceed max allowed, you will simply lose the extra items.

This script may need to be modified if you have other party-related scripts.

For example, if you have a script that implements instance items, you may need to check how the items are actually stored since what I've written is based on default inventory system and therefore may not transfer items properly.
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Thanks for this. I'll try it as soon as I get home.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
This merges actors and items, but unfortunately doesn't merge gold.  Will I need to set that to a variable and add it manually?
 

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
This merges actors and items, but unfortunately doesn't merge gold.  Will I need to set that to a variable and add it manually?
Try adding this line: party1.gain_gold(party2.gold)

class Game_Parties # Merges party2 into party1 def merge(id1, id2) party1 = @data[id1] party2 = @data[id2] # merge actors party2.members.each do |mem| party1.add_actor(mem.id) end # merge inventories party2.items.each {|item| party1.gain_item(item, party2.item_number(item)) } party2.weapons.each {|item| party1.gain_item(item, party2.item_number(item)) } party2.armors.each {|item| party1.gain_item(item, party2.item_number(item)) } party1.gain_gold(party2.gold) # Make first party the active party switch_party(id1) # Delete the second party, as it has been merged delete_party(id2) endendclass Game_Interpreter def merge_parties(id1, id2) $game_parties.merge(id1, id2) endendNot tested, but it should work.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
It does indeed work.  Thanks very much.
 

Sharm

Pixel Tile Artist
Veteran
Joined
Nov 15, 2012
Messages
12,760
Reaction score
10,884
First Language
English
Primarily Uses
N/A
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top