Multiple Inventories

By Fomar0153
Last Updated: 05 May 2012 (Version 1.1)
Download Link: http://pastebin.com/e5NiXP6y (Version 1.1, 05 May 2012)
Download Link: http://pastebin.com/raw.php?i=YLFF7q6c (Version 1.0, 24 February 2012)

Allows you to easily handle multiple inventories in game.

3
  

20 comments

  1. Hohe says:

    I tried your script and there’s a problem. The menu always shows the gold of the main inventory. If I switch inventory and change gold it keeps showing only the gold I had in the Main inventory.

    I changed line 93 for this:
    return @gold[@current_inventory]

    and now it works fine.

  2. Fomar0153 says:

    Good catch, what a silly mistake I made.

  3. Nee Millon says:

    HOw do you create a new inventory

  4. Rangetsu says:

    Script ‘Game_Interpreter’ line 1411: NameError occurred.

    undefined local variable or method ‘two’ for
    #

    Help?

    • Rangetsu says:

      For
      # Game_Interpreter:0x7ec6c90 *

    • Fomar0153 says:

      It’s possible you’ve found a bug what event command did you try and do?

      I could have missed one when testing.

      • Rangetsu says:

        Was at the beginning of my testing the script, lol.

        New Game > Talked to an NPC to get items > Clicked Z on an event that only had the script command “$game_party.change_inventory(two)” > Error listed above.

        I also did: New Game > Clicked Z on event to activate script > Same error.

        If it helps, Game Interpreter section was:
        #————————————————————————–
        # * Script
        #————————————————————————–
        def command_355
        script = @list[@index].parameters[0] + “\n”
        while next_event_code == 655
        @index += 1
        script += @list[@index].parameters[0] + “\n”
        end
        eval(script)
        end
        end

        What other types of scripts can interfere with this?

        I’ve been running a lot of Yanfly scripts along with some Victor scripts AND the XAS script (Which have been running okay together so far)

        • Fomar0153 says:

          $game_party.change_inventory(two)
          should be:
          $game_party.change_inventory(“two”)

          • Rangetsu says:

            Hmm, I tried that, but still got the error. Would you like a demo of my game? If yes, how may I contact you privately?

          • Fomar0153 says:

            Just to check, you’re not reloading any old saves are you?

          • Rangetsu says:

            Nope, lol. I figured out the mistake. It’s single quotation marks ( ‘ ), instead of double quotation marks ( ” ). It works perfectly now!! Superb script :D Thanks so much! <3

          • Fomar0153 says:

            Glad to hear everything is working as it should.

  5. Pharonix says:

    I get an error when I save using this script.

    Script multiple inventories line 93: TypeError occurred.
    can’t convert String into int.
    the problem line is:
    93: return @gold[START_INVENTORY]

    • Pharonix says:

      Solved it, When putting in a name for an inventory, any string-based, Including Starting_Inventory[] = “Main” ultimately fails because it can’t parse the string.
      by renaming the inventories with actual integer values, 1, 2, 3, .. etc. it works.

      • Fomar0153 says:

        Well they were hashes which can use strings. I don’t know what you were doing to get the original error but if it’s working for you then I guess it doesn’t matter.

  6. Rook says:

    Having read through the other comments. I have tried trouble shooting the script call $game_party.change_inventory(name) with singe quotes and double quotes. Every time I go to call the script I get the following error.

    Script ‘Game_Interpreter’ line 1409: NoMethodError occured.
    Undefined method `call’ for #

    Any Ideas on what I am doing wrong? Thanks in advance.

    • Fomar0153 says:

      Don’t put call in the script command just:
      $game_party.change_inventory(“invw”)
      for example.

  7. soulius says:

    Is there any way possible that you could make this script for RPG MAKER VX or port it to the old script system? It would be greatly appreciated