Ah i see why this could be, all the item weights are stored in Game_Temp, so when you load and save, its reset to like the game was started over again.
i think that all that needs to be done to correct this is change it from game temp, to game system. OR you could make a new class for the weights and make it a global and add it into the Scene_File script.
[edit]
I didn't edit the script that was posted, but i did edit the script that i have, and i seem to have fixed the problem.
################################################################################
# Item Weight V 1.0 #
# by Tidloc #
################################################################################
# V 1.6 #
# by Mr Wiggles - Drop to map. #
################################################################################
# This script allows the player to carry only a limited ammount of weight. #
# To define the weight of an item, weapon or armor simply enter \w<*VALUE*> #
# in the description box of that item. If left out the weight will be 0! #
################################################################################
# Definition of the constants: if a switch is 0, it's not used #
#-------------------------------------------------------------------------------
# TIDLOC_GROUPWEIGHT_MAX ................. limit of weight, where the #
# player will be slowed down. #
TIDLOC_GROUPWEIGHT_MAX = 10 # Set by players Skill
#-------------------------------------------------------------------------------
# TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX ...... maximum weight, if exceeding #
# this limit, no more items can be #
# picked up. #
TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX = 1000000000
#-------------------------------------------------------------------------------
# TIDLOC_GROUPWEIGHT_MAT_POWER ........... Number of decimal algarisms. #
TIDLOC_GROUPWEIGHT_MAT_POWER = 2
#-------------------------------------------------------------------------------
# TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH .... the number of the global switch #
# which shall be turned true if #
# the max-limit is exceeded. #
TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH = 20
#-------------------------------------------------------------------------------
# TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH ... the number of the global switch #
# which shall be turned true if #
# you cannot carry any more. #
TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH = 3
################################################################################
# To alter this limits in game use the following script-commads: #
# $game_weight.pweight(*VALUE*) for GROUPWEIGHT_MAX #
# $game_weight.pmax(*VALUE*) for CARRY_OVER_MAX #
# You may leave Value empty to reset to the constants. #
################################################################################
# You are free to use this script in what ever game you want, but please #
# credit me for this hell of work ^_^ #
# Credits also to Albertfish for his help when it was needed! #
################################################################################
# Mr Wiggles: #
# #
# This version will store recently droped items, which then can be picked #
# up through an event that calls a chest in Game_Guy's Item Storage Script. #
# #
# Use $game_weight.recentdrop for the chest that will house the recently #
# droped items from Tidloc's Weighted Items Script. #
################################################################################
module CHEST_DROP # Mr Wiggles
# Switch that when false erases items that where droped (like for a map change)
DROPED_ITEM_SW = 5
# This switch is Turned on when player drops new items
RELOCATE_ITEM = 9
# Button to drop item
DROP_ITEM = Keys::D
# Button to use item
USE_ITEM = Input::C # Space, Enter, "C"
# Chest that will store items
DROP_CHEST_ID = 1
end # Mr Wiggles
#-------------------------------------------------------------------------------
# * Window_Weight
#-------------------------------------------------------------------------------
class Window_Weight < Window_Base
def initialize
super(0, 0, 640, 480) # 140, 80
self.z = 200
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
def refresh
self.contents.font.name = "Times New Roman"
self.contents.font.size = 20
self.contents.clear
self.contents.font.color = system_color
a = 1
for i in 0...TIDLOC_GROUPWEIGHT_MAT_POWER
a*=10.0
end
# Draw Weight in Maxed out color if over max
if $game_weight.groupweight/a > $game_weight.groupweight_max/a
self.contents.font.color = knockout_color
weight = ($game_weight.groupweight/a).to_s
max_weight = ($game_weight.groupweight_max/a).to_s
self.contents.draw_text(5, 9, 160, 32,weight+" / "+max_weight, 0)
# Draw Weight in Warning color if close to max
elsif $game_weight.groupweight/a >= $game_weight.groupweight_max/a - 15
self.contents.font.color = crisis_color
weight = ($game_weight.groupweight/a).to_s
max_weight = ($game_weight.groupweight_max/a).to_s
self.contents.draw_text(5, 9, 160, 32,weight+" / "+max_weight, 0)
else
# Draw Weight in normal color if under max
self.contents.font.color = normal_color
weight = ($game_weight.groupweight/a).to_s
max_weight = ($game_weight.groupweight_max/a).to_s
self.contents.draw_text(5, 9, 160, 32,weight+" / "+max_weight, 0)
end
# Draw Weight Total:
self.contents.draw_text(0,-9, 120, 32, "Weight Total:\n")
self.contents.font.color = normal_color
# Draw Weight help
self.contents.font.color = normal_color
self.contents.draw_text(280, -9, 200, 32, "Use items with Space,")
self.contents.draw_text(280, 9, 200, 32, "Drop items with \"D\".")
end
end
#==============================================================================
# * Window_Item
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
if self.item != nil
help = self.item.description.to_s
$game_weight.item_description_lentgh = help.length
end
end
end
#-------------------------------------------------------------------------------
# * Game_Weight
#-------------------------------------------------------------------------------
class Game_Weight
attr_accessor :itemweight
attr_accessor :weaponweight
attr_accessor :armorweight
attr_accessor :groupweight
attr_accessor :groupweight_max
attr_accessor :groupweight_carry_over_max
attr_accessor :iweight_slow
attr_accessor :item_description_lentgh
attr_accessor :clear_item_bag
alias wo_weight_initialize initialize
def initialize
@itemweight = []
@weaponweight = []
@armorweight = []
@groupweight = 0
@groupweight_max = TIDLOC_GROUPWEIGHT_MAX
@groupweight_carry_over_max = TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX
@iweight_slow = false
@item_description_lentgh = 0
@clear_item_bag = false
@data_items = load_data("Data/Items.rxdata")
@data_weapons = load_data("Data/Weapons.rxdata")
@data_armors = load_data("Data/Armors.rxdata")
for i in 1...@data_items.size
if @data_items[i].description[0] != nil
text = @data_items[i].description
text2 = ""
text.gsub!(/\\w<([0-9]+)>/) {"\1[#{$1}]"}
while ((c = text.slice!(/./m)) != nil)
if c != "\1"
text2 += c
else
text.sub!(/\[([_A-Za-z0-9-]+)\]/, "")
@itemweight[i]=$1.to_i
end
end
@data_items[i].description = text2
end
@itemweight[i] = 0 if @itemweight[i].nil?
end
for i in 1...@data_weapons.size
if @data_weapons[i].description[0] != nil
text = @data_weapons[i].description
text2 = ""
text.gsub!(/\\w<([0-9]+)>/) {"\1[#{$1}]"}
while ((c = text.slice!(/./m)) != nil)
if c != "\1"
text2 += c
else
text.sub!(/\[([_A-Za-z0-9-]+)\]/, "")
@weaponweight[i]=$1.to_i
end
end
@data_weapons[i].description = text2
end
@weaponweight[i] = 0 if @weaponweight[i].nil?
end
for i in 1...@data_armors.size
if @data_armors[i].description[0] != nil
text = @data_armors[i].description
text2 = ""
text.gsub!(/\\w<([0-9]+)>/) {"\1[#{$1}]"}
while ((c = text.slice!(/./m)) != nil)
if c == "\1"
text.sub!(/\[([_A-Za-z0-9-]+)\]/, "")
@armorweight[i]=$1.to_i
else
text2 += c
end
end
@data_armors[i].description = text2
end
@armorweight[i] = 0 if @armorweight[i].nil?
end
wo_weight_initialize
end
def pweight(new_weight=TIDLOC_GROUPWEIGHT_MAX)
@groupweight_max = new_weight
end
def pmax(new_max=TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX)
@groupweight_carry_over_max = new_max
end
end
$game_weight = Game_Weight.new
#-------------------------------------------------------------------------------
# Saves weight to save game file
#-------------------------------------------------------------------------------
class Scene_Save
alias game_weight_write_save_data write_save_data
def write_save_data(file)
game_weight_write_save_data(file)
Marshal.dump($game_weight, file)
end
end
#-------------------------------------------------------------------------------
# Loads weight from save game file
#-------------------------------------------------------------------------------
class Scene_Load
alias game_weight_read_save_data read_save_data
def read_save_data(file)
game_weight_read_save_data(file)
$game_weight = Marshal.load(file)
end
end
#-------------------------------------------------------------------------------
# * Game_Party
#-------------------------------------------------------------------------------
class Game_Party
def tidloc_slowing(slow=true)
if slow
$game_player.tidloc_alt_speed -1
else
$game_player.tidloc_alt_speed 1
end
end
#----------------------
# Gain Item
#----------------------
alias tidloc_iweight_item gain_item
def gain_item(item_id, n)
# Add Wieght
if item_id > 0
$game_weight.groupweight += $game_weight.itemweight[item_id] * n #([[item_number(item_id) + n, 0].max, 999].min - item_number(item_id))
end
# check if over weight
if $game_weight.groupweight > $game_weight.groupweight_carry_over_max
$game_switches.[]=(TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH != -1
if !$game_weight.iweight_slow
$game_weight.iweight_slow = true
tidloc_slowing
end
elsif ($game_weight.groupweight > $game_weight.groupweight_max && !$game_weight.iweight_slow)
$game_weight.iweight_slow = true
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing
tidloc_iweight_item(item_id, n)
elsif ($game_weight.groupweight <= $game_weight.groupweight_max && $game_weight.iweight_slow)
$game_weight.iweight_slow = false
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, false) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing false
tidloc_iweight_item(item_id, n)
else
tidloc_iweight_item(item_id, n)
end
end
#----------------------
# Gain Weapon
#----------------------
alias tidloc_iweight_weap gain_weapon
def gain_weapon(weapon_id, n)
if weapon_id > 0
$game_weight.groupweight += $game_weight.weaponweight[weapon_id] * n #([[weapon_number(weapon_id) + n, 0].max, 99].min - weapon_number(weapon_id))
end
if $game_weight.groupweight > $game_weight.groupweight_carry_over_max
$game_switches.[]=(TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH != -1
if !$game_weight.iweight_slow
$game_weight.iweight_slow = true
tidloc_slowing
end
elsif $game_weight.groupweight > $game_weight.groupweight_max && !$game_weight.iweight_slow
$game_weight.iweight_slow = true
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing
tidloc_iweight_weap(weapon_id, n) if TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX
$game_switches.[]=(TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH, true) if !TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX
elsif $game_weight.groupweight <= $game_weight.groupweight_max && $game_weight.iweight_slow
$game_weight.iweight_slow = false
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, false) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing false
tidloc_iweight_weap(weapon_id, n)
else
tidloc_iweight_weap(weapon_id, n)
end
end
#----------------------
# Gain Armor
#----------------------
alias tidloc_iweight_arm gain_armor
def gain_armor(armor_id, n)
if armor_id > 0
$game_weight.groupweight += $game_weight.armorweight[armor_id] * n #([[armor_number(armor_id) + n, 0].max, 99].min - armor_number(armor_id))
end
if $game_weight.groupweight > $game_weight.groupweight_carry_over_max
$game_switches.[]=(TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH != -1
if !$game_weight.iweight_slow
$game_weight.iweight_slow = true
tidloc_slowing
end
elsif $game_weight.groupweight > $game_weight.groupweight_max && !$game_weight.iweight_slow
$game_weight.iweight_slow = true
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, true) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing
tidloc_iweight_arm(armor_id, n) if TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX
$game_switches.[]=(TIDLOC_GROUPWEIGHT_OVERWEIGHT_SWITCH, true) if !TIDLOC_GROUPWEIGHT_CARRY_OVER_MAX
elsif $game_weight.groupweight <= $game_weight.groupweight_max && $game_weight.iweight_slow
$game_weight.iweight_slow = false
$game_switches.[]=(TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH, false) if TIDLOC_GROUPWEIGHT_MAXWEIGHT_SWITCH != -1
tidloc_slowing false
tidloc_iweight_arm(armor_id, n)
else
tidloc_iweight_arm(armor_id, n)
end
end
end
#-------------------------------------------------------------------------------
# * Game_Player : Slows player when over weight
#-------------------------------------------------------------------------------
class Game_Player
def tidloc_set_speed(speed=4)
@move_speed = speed
end
def tidloc_alt_speed(speed=0)
@move_speed += speed
end
end
#-------------------------------------------------------------------------------
# * Scene_Item
#-------------------------------------------------------------------------------
class Scene_Item
alias iweight_main main
def main
@weight_window = Window_Weight.new
@weight_window.x = 0
@weight_window.y = 0
iweight_main
@weight_window.dispose
end
alias iweight_update update
def update
@weight_window.update
iweight_update
@weight_window.refresh
end
#-------------------------------------------------------------------------------
alias iweight_item update_item
def update_item
@item = @item_window.item
#------------------
if Input.trigger?(CHEST_DROP::USE_ITEM)
# If not an item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = (@item_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end # if scope == 4
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play($data_system.decision_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end # if consumable
$scene = Scene_Map.new
return
end # if common event
end # if item scope >= 3
@item_window.refresh
@weight_window.refresh
return
end # if Input::C
#------------------
if Input.trigger?(CHEST_DROP::DROP_ITEM) # Drop Item
# move item bag
$game_switches[CHEST_DROP::RELOCATE_ITEM] = true
# define $chest
if $game_weight.clear_item_bag == true
$chest = Game_Chest.new(GameGuy::ChestMaxItems)
$game_weight.clear_item_bag = false
else
$chest = $game_system.chests[CHEST_DROP::DROP_CHEST_ID]
end
# if it is an Item
if @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
$game_party.gain_item(@item.id,-1)
# add items into drop bag
$chest.add_item(@item.id, 1)
$game_switches[CHEST_DROP::DROPED_ITEM_SW] = true
# if it is a Weapon
elsif @item.is_a?(RPG::Weapon)
$game_system.se_play($data_system.buzzer_se)
$game_party.gain_weapon(@item.id,-1)
# add items into drop bag
$chest.add_weapon(@item.id, 1)
$game_switches[CHEST_DROP::DROPED_ITEM_SW] = true
# if it is an Armor
elsif @item.is_a?(RPG::Armor)
$game_system.se_play($data_system.buzzer_se)
$game_party.gain_armor(@item.id,-1)
# add items into drop bag
$chest.add_armor(@item.id, 1)
$game_switches[CHEST_DROP::DROPED_ITEM_SW] = true
end # item type
$game_map.refresh
@item_window.refresh
@weight_window.refresh
# update droped items
$game_system.add_chest(CHEST_DROP::DROP_CHEST_ID)
$game_map.game_chest_size(CHEST_DROP::DROP_CHEST_ID)
chest_size = $number_of_droped_items
return
end # Input Drop button
#------------------
iweight_item
end # def
end # class
#-------------------------------------------------------------------------------
# * Scene_Shop : Dis-allows buying past paty weight limit
#-------------------------------------------------------------------------------
class Scene_Shop
alias iweight_buy update_buy
def update_buy
iweight_buy
if Input.trigger?(Input::C)
@item = @buy_window.item
if @item == nil or @item.price > $game_party.gold
$game_system.se_play($data_system.buzzer_se)
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
max2 = $game_weight.itemweight[@item.id]
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
max2 = $game_weight.weaponweight[@item.id]
when RPG::Armor
number = $game_party.armor_number(@item.id)
max2 = $game_weight.armorweight[@item.id]
end
if number == 999
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
max = @item.price == 0 ? 999 : $game_party.gold / @item.price
return if max2 == 0
max2 = ($game_weight.groupweight_max - $game_weight.groupweight) / max2
max = [max, 999 - number, max2].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
end
#-------------------------------------------------------------------------------
# Scene Map : Updates players strength skill
#-------------------------------------------------------------------------------
class Scene_Map
alias wieght_init initialize
def initialize
wieght_init
@carry_max = 0
@old_skill = 0
@chest_size = 0
end
alias wieght_update update
def update
wieght_update
# Limits how oftin weight updates
if $game_party.skills($game_party.actors[0].name, "Strength") != @old_skill
@old_skill = $game_party.skills($game_party.actors[0].name, "Strength")
# Update carry max with Strength skill
@carry_max = $game_party.skills($game_party.actors[0].name, "Strength") * 5
# Add Strengths acording to Character Name
@carry_max += 15 if $game_party.actors[0].name == "James"
@carry_max += 25 if $game_party.actors[0].name == "Vic"
@carry_max += 10 if $game_party.actors[0].name == "Lisa"
@carry_max = @carry_max * 100
@old_carry_max = @carry_max
# Update Weight
$game_weight.pweight(@carry_max)
end
# Limits how oftin Item bag updates
if $number_of_droped_items != @chest_size
# Erase items that where droped if DROPED_ITEM_SW switch is off or if
# there are no droped items to pick up
if $game_system.chests[CHEST_DROP::DROP_CHEST_ID] != nil
$game_map.game_chest_size(CHEST_DROP::DROP_CHEST_ID)
end
# Create droped item bag
if $game_switches[CHEST_DROP::DROPED_ITEM_SW] == true and
$game_switches[CHEST_DROP::RELOCATE_ITEM] == true
$game_switches[CHEST_DROP::RELOCATE_ITEM] = false
$game_player.shoot(19) if $arcade_mode == nil or $arcade_mode == false
end
# check if bag is empty
@chest_size = $number_of_droped_items
if @chest_size == 0 and $game_switches[CHEST_DROP::DROPED_ITEM_SW] == true
$game_switches[CHEST_DROP::DROPED_ITEM_SW] = false
@droped_bag = false
end
end
# if bag is empty clear bag and prep for next drop
if $game_switches[CHEST_DROP::DROPED_ITEM_SW] == false
$number_of_droped_items = 0
unless $game_switches[CHEST_DROP::RELOCATE_ITEM] == true
$game_switches[CHEST_DROP::RELOCATE_ITEM] = true
end
$game_weight.clear_item_bag = true
end
end
end