Memorize equipment for an abduction scene?

Lars Ulrika

I punch Therefore I am Harvest the land Taking the
Veteran
Joined
Nov 7, 2012
Messages
1,363
Reaction score
405
First Language
French
Primarily Uses
N/A
Hi, I would like to know if you can memorize player's actual equipment without having to make one variable for one and every weapon, armour and item you might get so far in the game which would be really a hassle to do? 
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Consider using a script that allows you to swap and merge inventories.


If you get abducted, simply remove all equips and then swap in a new inventory.


Afterwards when you retrieve your stuff, you can either merge or swap in the original inventory.


I don't know if such a script exists however.
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
I have written a small script to make this process easier, you can try it out:

Code:
#===============================================================================# ** Memorize Inventory **# # Author:     Evgenij# Date:       19.08.2014# Version:    1.0#===============================================================================# # Description:# #   This script provides scriptcalls to save the current party inventory and #   add all saved items back at a later point.##===============================================================================## Scriptcalls:## $game_party.unequip_and_memorize_items  - unequip items and memorize inventory# $game_party.memorize_items        - Memorize all current items in inventory# $game_party.clear_party_equip     - Removes all equipped items to inventory# $game_party.delete_inventory      - Clears the party inventory## $game_party.add_mem_weapons       - adds all memorized weapons to inventory# $game_party.add_mem_armors        - adds all memorized armors to inventory# $game_party.add_mem_items         - adds all memorized items to inventory# $game_party.add_all_mem_items     - adds memorized items, weapons, armors back## $game_party.clear_memorized_items - clears the memorized items##===============================================================================  class Game_Party  #-----------------------------------------------------------------------------  alias :evg_gp_initialize_memeq      :initialize  #-----------------------------------------------------------------------------  def initialize    evg_gp_initialize_memeq    clear_memorized_items  end  #-----------------------------------------------------------------------------  def clear_memorized_items    @mem_weapons = {}    @mem_armors = {}    @mem_items = {}  end  #-----------------------------------------------------------------------------  def clear_party_equip    $game_party.all_members.each(&:clear_equipments)  end  #-----------------------------------------------------------------------------  def unequip_and_memorize_items    clear_party_equip    memorize_items  end  #-----------------------------------------------------------------------------  def memorize_items    @mem_items = @items    @mem_weapons = @weapons    @mem_armors = @armors  end  #-----------------------------------------------------------------------------  def add_mem_items    @mem_items.each do |id, amount|      gain_item($data_items[id], amount)    end  end  #-----------------------------------------------------------------------------  def add_mem_weapons    @mem_weapons.each do |id, amount|      gain_item($data_weapons[id], amount)    end  end  #-----------------------------------------------------------------------------  def add_mem_armors    @mem_armors.each do |id, amount|      gain_item($data_armors[id], amount)    end  end  #-----------------------------------------------------------------------------  def add_all_mem_items    add_mem_items    add_mem_weapons    add_mem_armors  end  #-----------------------------------------------------------------------------  def delete_inventory    @items = {}    @weapons = {}    @armors = {}  end  #-----------------------------------------------------------------------------end#===============================================================================# SNIPPED END#===============================================================================
 

Lars Ulrika

I punch Therefore I am Harvest the land Taking the
Veteran
Joined
Nov 7, 2012
Messages
1,363
Reaction score
405
First Language
French
Primarily Uses
N/A
Oh thanks very much! I'll test it asap :)
 

Perversewolf

Villager
Member
Joined
Jul 18, 2014
Messages
40
Reaction score
8
First Language
English
Primarily Uses
I have written a small script to make this process easier, you can try it out:

#===============================================================================# ** Memorize Inventory **# # Author: Evgenij# Date: 19.08.2014# Version: 1.0#===============================================================================# # Description:# # This script provides scriptcalls to save the current party inventory and # add all saved items back at a later point.##===============================================================================## Scriptcalls:## $game_party.unequip_and_memorize_items - unequip items and memorize inventory# $game_party.memorize_items - Memorize all current items in inventory# $game_party.clear_party_equip - Removes all equipped items to inventory# $game_party.delete_inventory - Clears the party inventory## $game_party.add_mem_weapons - adds all memorized weapons to inventory# $game_party.add_mem_armors - adds all memorized armors to inventory# $game_party.add_mem_items - adds all memorized items to inventory# $game_party.add_all_mem_items - adds memorized items, weapons, armors back## $game_party.clear_memorized_items - clears the memorized items##=============================================================================== class Game_Party #----------------------------------------------------------------------------- alias :evg_gp_initialize_memeq :initialize #----------------------------------------------------------------------------- def initialize evg_gp_initialize_memeq clear_memorized_items end #----------------------------------------------------------------------------- def clear_memorized_items @mem_weapons = {} @mem_armors = {} @mem_items = {} end #----------------------------------------------------------------------------- def clear_party_equip $game_party.all_members.each(&:clear_equipments) end #----------------------------------------------------------------------------- def unequip_and_memorize_items clear_party_equip memorize_items end #----------------------------------------------------------------------------- def memorize_items @mem_items = @items @mem_weapons = @weapons @mem_armors = @armors end #----------------------------------------------------------------------------- def add_mem_items @mem_items.each do |id, amount| gain_item($data_items[id], amount) end end #----------------------------------------------------------------------------- def add_mem_weapons @mem_weapons.each do |id, amount| gain_item($data_weapons[id], amount) end end #----------------------------------------------------------------------------- def add_mem_armors @mem_armors.each do |id, amount| gain_item($data_armors[id], amount) end end #----------------------------------------------------------------------------- def add_all_mem_items add_mem_items add_mem_weapons add_mem_armors end #----------------------------------------------------------------------------- def delete_inventory @items = {} @weapons = {} @armors = {} end #-----------------------------------------------------------------------------end#===============================================================================# SNIPPED END#===============================================================================
Where On The Internet Has This Beauty Been Hiding?
 

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

Latest Threads

Latest Posts

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top