Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: MarkHest on November 18, 2011, 09:29:36 pm

Title: RESOLVED [XP] - Separate Inventory Script
Post by: MarkHest on November 18, 2011, 09:29:36 pm
I've searched my butt off for the last hours trying to find a "working" separate inventory script that lets me change inventories in game using call scripts or changing a variable.

I tried Tricksers Multiple Inventory script but it requires SDK to work and i don't want SDK :/
I altso tried another one that changes inventory with a variable but as soon as you added an item with an event the script sent me an error.

So... is there a WORKING script out there that lets me change inventories so i can move in the story with separate charakters without having the same items?
Title: Re: [XP] - Separate Inventory Script
Post by: Blizzard on November 18, 2011, 09:38:47 pm
Actually I kind of made this feature work in my Easy Party Switcher script. It was intended to switch party member and parties, so it has that feature implemented as well.
Title: Re: [XP] - Separate Inventory Script
Post by: MarkHest on November 18, 2011, 09:41:04 pm
Oh realy? I guess i'll check it out then ^^
So it gives me the option to "only" change inventory?

Edit: damn, that script was complicated, i'm struggling to understand it right now :P

main problem: Edit: I can't find an option that enables me to change inventory (Or maybe i'm just blind 8) ).

Edit: Must be a way to force a party change without bringing up the party swicher even once... hm..
Title: Re: [XP] - Separate Inventory Script
Post by: Fantasist on November 19, 2011, 01:45:00 am
Item Storage (http://forum.chaos-project.com/index.php?topic=3444.0) script by G_G.

You should check the Script Database (http://www.chaos-project.com/index.php?option=com_scriptdatabase&view=scriptdatabase&Itemid=29) more often! :P
Title: Re: [XP] - Separate Inventory Script
Post by: LiTTleDRAgo on November 19, 2011, 03:49:04 am
Quote from: MarkHest on November 18, 2011, 09:29:36 pm
I tried Tricksers Multiple Inventory script but it requires SDK to work and i don't want SDK :/


as far as I know, that script can be used without SDK, just remove SDK logging part
Title: Re: [XP] - Separate Inventory Script
Post by: MarkHest on November 19, 2011, 04:16:35 am
Quote from: Fantasist on November 19, 2011, 01:45:00 am
Item Storage (http://forum.chaos-project.com/index.php?topic=3444.0) script by G_G.

You should check the Script Database (http://www.chaos-project.com/index.php?option=com_scriptdatabase&view=scriptdatabase&Itemid=29) more often! :P


that looks like some kind of bank script  :huh:

Not what i'm looking for :P
Title: Re: [XP] - Separate Inventory Script
Post by: Fantasist on November 19, 2011, 05:16:45 am
Oops :shy:
Then I don't understand exactly what you want.

Quote from: LiTTleDRAgo on November 19, 2011, 03:49:04 am
as far as I know, that script can be used without SDK, just remove SDK logging part

@MarkHest: This may work. Post the script here and I'll see if I can de-SDKfy it.
Title: Re: [XP] - Separate Inventory Script
Post by: LiTTleDRAgo on November 19, 2011, 07:20:08 am
Spoiler: ShowHide
=begin
==============================================================================
●● Multiple Inventories
------------------------------------------------------------------------------
Trickster (tricksterguy@hotmail.com)
Version 2.0
Date 7/20/07
Goto RMXP.org for updates/bug reports/comments
------------------------------------------------------------------------------
This script allows you to easily have multiple inventories and gold
and be able to switch between them in game.
==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
#SDK.log('Multiple Inventories', 'Trickster', 2.0, '7.20.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
#SDK.check_requirements(2.2, [1])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
#if SDK.enabled?('Multiple Inventories')
 
class Game_Party
  #--------------------------------------------------------------------------
  # * Number of Inventories (Value must be > 1)
  #--------------------------------------------------------------------------
  Inventories = 2
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :inventories
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias_method :trick_inventories_party_initialize, :initialize
  def initialize
    # The Usual
    trick_inventories_party_initialize
    # Setup inventories
    @inventories = [[@items, @weapons, @armors, @gold]]
    # Push Hashes
    @inventories.push(*Array.new(Inventories - 1) {[{}, {}, {}, 0]})
    # Setup Old Inventory id
    @inventory = 0
  end
  #--------------------------------------------------------------------------
  # * Switch Inventory
  #--------------------------------------------------------------------------
  def switch_inventory(id)
    # Do Nothing if same
    return if @inventory == id
    # Get Inventory Stuff
    new_inventory = @inventories[id]
    # Save old inventory
    @inventories[@inventory] = [@items, @weapons, @armors, @gold]
    # Set Variables
    @items = new_inventory[0]
    @weapons = new_inventory[1]
    @armors = new_inventory[2]
    @gold = new_inventory[3]
    # Set Inventory
    @inventory = id
  end
  #--------------------------------------------------------------------------
  # * Combine Inventory
  #--------------------------------------------------------------------------
  def combine_inventory(base_id, merge_id, overflow = false)
    # Set to Current if nil was sent
    base_id = @inventory if base_id == nil
    base, merge = @inventories[base_id], @inventories[merge_id]
    # Get Inventory stuff
    base_items, base_weapons, base_armors, base_gold = base
    items, weapons, armors, gold = merge
    # Merge Items Weapons Armors and Gold
    items.each do |item_id, amount|
      number = base_items[item_id].to_i + amount
      # If Overflow set to reminder else 0
      items[item_id] = overflow && number > 99 ? number - 99 : 0
      # If Overflow set to 99 else number
      base_items[item_id] = overflow && number > 99 ? 99 : number
    end
    weapons.each do |weapon_id, amount|
      number = base_weapons[weapon_id].to_i + amount
      # If Overflow set to reminder else 0
      weapons[weapon_id] = overflow && number > 99 ? number - 99 : 0
      # If Overflow set to 99 else number
      base_weapons[weapon_id] = overflow && number > 99 ? 99 : number
    end
    armors.each do |armor_id, amount|
      number = base_armors[armor_id].to_i + amount
      # If Overflow set to reminder else 0
      armors[armor_id] = overflow && number > 99 ? number - 99 : 0
      # If Overflow set to 99 else number
      base_armors[armor_id] = overflow && number > 99 ? 99 : number
    end
    number = base_gold + gold
    # If Overflowed set to 9999999 else number
    base[3] = overflow && number > 9999999 ? 9999999 : number
    # If Overflowed set to reminder else 0
    merge[3] = overflow && number > 9999999 ? number - 9999999 : 0
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
#end


already unSDK-ed --~
Title: Re: [XP] - Separate Inventory Script
Post by: Fantasist on November 19, 2011, 08:44:34 am
Nice.
Title: Re: [XP] - Separate Inventory Script
Post by: MarkHest on November 19, 2011, 10:36:00 am
It does not work for me. When i use the CallScript to change inventory i get an error :(

Edit: No, nevermind. I just had to make a new safefile for it.
It corrupts old savefiles.

Thank you LittleDrago for the fix, i realy appriciate it ^^
Altso thanks to everyone who tried to help!

Level ++