deathmoverz24 2 Report post Posted January 19, 2012 i want to make a separate inventory for 2 actors actually bcoz theres a part in my game where you will control another guy but the inventory must not be the same. Share this post Link to post Share on other sites
0 Bigace360 38 Report post Posted January 19, 2012 (edited) I found this in my old folders It's by RPG Advocate http://www.mediafire...61iibjo5atsjtiz Edited January 19, 2012 by bigace Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 20, 2012 ok so this is what ive done after that, ive copy the "red lines" on the script you gave me and i ignored the rest then i paste it on their classes. I am correct right? but uhh what bothers me is how's this one work? how do i start erasing all items and sending them on a list or something? Share this post Link to post Share on other sites
0 kare3 0 Report post Posted January 20, 2012 I don't really think it is necessary to use a script for this. I believe it can be evented instead. Let me try, and if I succeed, you can have the event system. Share this post Link to post Share on other sites
0 kare3 0 Report post Posted January 20, 2012 Download the stuff from these links: http://www.mediafire.com/?364wwyds81d6499 http://www.mediafire.com/?12h35dlk3u80ltu http://www.mediafire.com/?318n360h2d25cyn Share this post Link to post Share on other sites
0 Kange 0 Report post Posted January 20, 2012 really chick, is there anythign you cant do -.- Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 20, 2012 kare3, there's only 3 files? i cant open it. its says "This project is from an old version of Rpg Maker and cannot be loaded?" Share this post Link to post Share on other sites
0 kare3 0 Report post Posted January 20, 2012 You have the RMXP rtp, right? The demo was made entirely with RTP graphics.. But now that I think of it, my RMXP is pretty old.. Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 20, 2012 yes, ive copy pasted the entire rtp folders needed. i wonder whats wrong? so uhmm anyway you made one for me? thanks in advance. Share this post Link to post Share on other sites
0 kare3 0 Report post Posted January 20, 2012 I tried, and I succeeded. Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 20, 2012 would you mind if you tell me here now how you did it please? Share this post Link to post Share on other sites
0 kare3 0 Report post Posted January 20, 2012 Eventing. Share this post Link to post Share on other sites
0 Kange 0 Report post Posted January 20, 2012 i think he menas step by step so he can recreate is since he cant load it :P and ya, she can evernt anything, and usually in 5 minutes...She is a Kange Approved Eventor*stamps my seal on her forehead* Share this post Link to post Share on other sites
0 Bigace360 38 Report post Posted January 20, 2012 (edited) There's no need for an event, sorry I was busy. # Seperate Item Lists for Multiple Parties # by RPG Advocate #============================================================================== # ** Game_ItemBag #------------------------------------------------------------------------------ # This class handles the item bags. It includes item list creation, merging & # other functions. Refer to "$game_itembag" for the instance of this class. #============================================================================== class Game_ItemBag #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @itembags = [] @itembags[0] = [] for j in 1..10 @itembags[j] = [] end @itembags[0][0] = -1 for j in 1..10 @itembags[j][0] = -1 end end #-------------------------------------------------------------------------- # * Item List Creation # id : id of item bag #-------------------------------------------------------------------------- def create(id) @itembags[id][0] = $game_party.gold for weapon in $data_weapons number = weapon.id @itembags[id][number] = $game_party.weapon_number(number) end for armor in $data_armors number = armor.id @itembags[id][number + 1000] = $game_party.armor_number(number) end for item in $data_items number = item.id @itembags[id][number + 2000] = $game_party.item_number(number) end $game_party.lose_gold(9999999) for weapon in 1..$data_weapons.size - 1 $game_party.lose_weapon(weapon, 99) end for armor in 1..$data_armors.size - 1 $game_party.lose_armor(armor, 99) end for item in 1..$data_items.size - 1 $game_party.lose_item(item, 99) end end #-------------------------------------------------------------------------- # * Item List Replace # id : id of item bag # delete_bag : flag if deleting source bag #-------------------------------------------------------------------------- def replace(id, delete_bag = true) if @itembags[id][0] == -1 print("Warning: This item bag does not exist.") return end $game_party.lose_gold(9999999) $game_party.gain_gold(@itembags[id][0]) for weapon in 1..$data_weapons.size - 1 $game_party.lose_weapon(weapon, 99) end for armor in 1..$data_armors.size - 1 $game_party.lose_armor(armor, 99) end for item in 1..$data_items.size - 1 $game_party.lose_item(item, 99) end for weapon in 1..$data_weapons.size - 1 $game_party.gain_weapon(weapon, @itembags[id][weapon]) end for armor in 1..$data_armors.size - 1 $game_party.gain_armor(armor, @itembags[id][armor + 1000]) end for item in 1..$data_items.size - 1 $game_party.gain_item(item, @itembags[id][item + 2000]) end if delete_bag delete(id) end end #-------------------------------------------------------------------------- # * Item List Merge # id1 : id of item bag #1 # id2 : id of item bag #2 #-------------------------------------------------------------------------- def merge(id1, id2) if id2 != -1 && @itembags[id1][0] == -1 && @itembags[id2][0] == -1 print("Warning: Neither item bag to be merged exists.") return end if @itembags[id1][0] == -1 print("Warning: The first item bag to be merged does not exist") return end if id2 != -1 if @itembags[id2][0] == -1 print("Warning: The second item bag to be merged does not exist") return end end if id2 == -1 $game_party.gain_gold(@itembags[id1][0]) for weapon in 1..$data_weapons.size - 1 $game_party.gain_weapon(weapon, @itembags[id1][weapon]) end for armor in 1..$data_armors.size - 1 $game_party.gain_armor(armor, @itembags[id1][armor + 1000]) end for item in 1..$data_items.size - 1 $game_party.gain_item(item, @itembags[id1][item + 2000]) end delete(id1) end if id2 != -1 @itembags[id1][0] += @itembags[id2][0] for weapon in 1..$data_weapons.size - 1 @itembags[id1][weapon] += @itembags[id2][weapon] end for armor in 1..$data_armors.size - 1 @itembags[id1][armor + 1000] += @itembags[id2][armor + 1000] end for item in 1..$data_items.size - 1 @itembags[id1][item + 2000] += @itembags[id2][item + 2000] end delete(id2) end end #-------------------------------------------------------------------------- # * Merge all bags # mode : mode of merging (1 = to party inventory / 2 = to all bags) #-------------------------------------------------------------------------- def merge_all(mode) if mode != 1 && mode != 2 print("Merge All: Invalid mode.") return end flag = true for j in 1..10 if @itembags[j][0] != -1 flag = false end end if flag print("Warning: No item bags to merge.") return end if mode == 1 for j in 1..10 print(j.to_s) if @itembags[j][0] == -1 next end $game_party.gain_gold(@itembags[j][0]) for weapon in 1..$data_weapons.size - 1 $game_party.gain_weapon(weapon, @itembags[j][weapon]) end for armor in 1..$data_armors.size - 1 $game_party.gain_armor(armor, @itembags[j][armor + 1000]) end for item in 1..$data_items.size - 1 $game_party.gain_item(item, @itembags[j][item + 2000]) end delete(j) end end if mode == 2 if @itembags[1][0] == -1 @itembags[1][0] = 0 end for j in 2..10 if @itembags[j][0] == -1 next end @itembags[id1][0] += @itembags[id2][0] for weapon in 1..$data_weapons.size - 1 @itembags[1][weapon] += @itembags[j][weapon] end for armor in 1..$data_armors.size - 1 @itembags[1][armor + 1000] += @itembags[j][armor + 1000] end for item in 1..$data_items.size - 1 @itembags[1][item + 2000] += @itembags[j][item + 2000] end delete(j) end end end #-------------------------------------------------------------------------- # * Item List Copy # source_id : id of source item bag # destination_id : id of destination item bag #-------------------------------------------------------------------------- def copy(source_id, destination_id) @itembags[destination_id][0] = @itembags[source_id][0] for j in 0..2999 @itembags[destination_id][j] = @itembags[source_id][j] end end #-------------------------------------------------------------------------- # * Item List Deletion # id : id of item bag #-------------------------------------------------------------------------- def delete(id) for j in 0..2999 @itembags[id][j] = 0 end @itembags[id][0] = -1 end end #============================================================================== # ** Scene_Title #------------------------------------------------------------------------------ # This class performs title screen processing. #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- alias silmp_cng command_new_game def command_new_game # Perform the original call silmp_cng # Create the game bag $game_itembag = Game_ItemBag.new end end #============================================================================== # ** Scene_Save #------------------------------------------------------------------------------ # This class performs save screen processing. #============================================================================== class Scene_Save < Scene_File #-------------------------------------------------------------------------- # * Write Save Data # file : write file object (opened) #-------------------------------------------------------------------------- alias silmp_wsd write_save_data def write_save_data(file) # Perform the original call silmp_wsd(file) # Save the game bag data Marshal.dump($game_itembag, file) end end #============================================================================== # ** Scene_Load #------------------------------------------------------------------------------ # This class performs load screen processing. #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- alias silmp_rsd read_save_data def read_save_data(file) # Perform the original call silmp_rsd(file) # Load the game bag data $game_itembag = Marshal.load(file) # Refresh party members $game_party.refresh end end This is his script without having to change anything. All you have to do is assign your current bag to itembag1: $game_itembag.create(1) And then everything that isn't equip will be stored in there. To wipe everything the player has and replace it with whats in the Itembag 1 array. $game_itembag.replace(1) And to take the items in Itembag 1 array and return them to the player: $game_itembag.merge(1, -1) You can do the same for multiple bags, hope this helps. I'll make a small demo later if you still don't get it. Edited January 20, 2012 by bigace Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 23, 2012 yeah create a demo please. Share this post Link to post Share on other sites
0 Bigace360 38 Report post Posted January 23, 2012 (edited) Here you go http://www.mediafire.com/?nfclncaonff08av Edited January 23, 2012 by bigace Share this post Link to post Share on other sites
0 deathmoverz24 2 Report post Posted January 24, 2012 thank you so much dude.. i still haven't done with this but i will trust this script. Share this post Link to post Share on other sites
0 gshuford 0 Report post Posted July 14, 2018 I tried, and I succeeded. I know this is a bit of a necro thread, but I can't access that image. I know that this CAN be done with eventing, but I was wondering if kare3 found a way to do it without having to set a variable for every single item. I'm fairly convinced there's no way to do this through eventing without it being long, convoluted, and ugly, but if there is a way, I'd love to see it! Share this post Link to post Share on other sites
0 Polraudio 122 Report post Posted July 16, 2018 Post #14 he explains how to do it with an already made script. In post #16 he has a demo link. EDIT: With eventing you would have to have a separate variable to keep track of every item. Share this post Link to post Share on other sites
0 gshuford 0 Report post Posted July 18, 2018 Thanks for the response. I decided to start learning ruby, anyway, so hopefully I will be able to write my own bank script before long. I know there's some excellent ones out there, but I want to do my own work. Share this post Link to post Share on other sites
i want to make a separate inventory for 2 actors actually bcoz theres a part in my game where you will control another guy but the inventory must not be the same.
Share this post
Link to post
Share on other sites