I found this "Diablo Item Inventory" script. It is soposed to make your item invintory for each of your charactrs look like this:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg88.imageshack.us%2Fimg88%2F1739%2Fscreenvv5thgq1.jpg&hash=26c113d32d4a3113ec2588377b122d7f34ba35a5) (http://imageshack.us)
But When I use it, the game crashes. I think it has something to do with my cms, or my level informer scripts. (don't give me credit for any of the 3 scripts)
[spoiler=level informer]#==============================================================================
# Easy LvlUp Notifier by Blizzard
# Version: 1.21b
# Date: 27.8.2006
# Date v1.2b: 3.11.2006
#
#
# Compatibility:
#
# 96% chance of compatibility with everything. May cause slight problems with
# following systems and would need therefore slight recalibration:
# - exotic CBS-es
# - exotic skill systems (e.g. Soul Rage System)
# - exotic stat systems (additional stats like Wisdom, Luck etc.)
# - WILL corrupt old savegames
#
#
# Features:
#
# - shows increased stats and learned skills at level up
# - animated
# - shows EXP gain for each actor (!) only after gaining EXP after a battle
# - more simple and less laggy than other Level Up Notifiers
# - you can set up any sound to be played when a higher level is reached or a
# new skill is learned (LVLUP_SE and LEARN_SE further below)
# - uses the Window_Help class to show new learned skills instead of making an
# entire new Window class for that
#
# v1.2b:
#
# - better window movement
# - higher compatibility
# - fixed a few "eventual" bugs
#
# v1.21b:
#
# - fixed a bug
#
#
# Instructions:
#
# - Explanation:
#
# This script will notify you when any character is leveled up after a battle.
# It will show any stats that were increased and any skills, that were learned.
# The windows are animated, the code is less complex than any other so far and
# it is most efficient as well as highly optimized and detailed worked out.
#
# - Configuration:
#
# Change LVLUP_SE = "087-Action02" and LEARN_SE = "106-Heal02" to any sound you
# want to be played when a new level is reached / a new skill was learned.
#
# - For scripters:
#
# 1) Modify following line (284) to make this script compatible with exotic
# skill systems:
#
# @skills.push(id) if not @old_skills.include?(id)
#
# Just add more "if"s to exclude any additional skills. i.e. for the Soul Rage
# System (version 2.0 or lower) this line should be:
#
# if not $data_skills[id].element_set.include?($sr_element)
# @skills.push(id) if not @old_skills.include?(id)
# end
#
# 2) To make this script working for additional character stats like Wisdom,
# Luck etc. you only need to modify slighty Window_LevelUp\initialize and
# Window_LevelUp\refresh. In the refresh method, just increase the loop
# incrementor (for i in 0...7) and add any stat just like the normal stats
# are added in the script.
#
# 3) To enable the EXP data in the normal window remove the entire
# Window_BattleResult class from this script
#
# 4) To disable the display of gained EXP for each character even if no new
# level was reached find Window_LevelUp\test_lvlup and change any @exp to
# @level and any @actor.all_exp to @actor.level (CTRL+H).
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr/
# or send me an e-mail:
# boris_blizzard@yahoo.de
#
#==============================================================================
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
LVLUP_SE = "087-Action02"
LEARN_SE = "106-Heal02"
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
def all_exp
return @exp
end
def all_exp=(exp)
@exp = exp
end
end
#==============================================================================
# Window_BattleResult
#==============================================================================
class Window_BattleResult < Window_Base
def refresh
self.contents.clear
x = 4
self.contents.font.color = system_color
cx = contents.text_size("Gained").width
self.contents.draw_text(x, 0, cx, 32, "Gained")
x += cx + 4
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end
#==============================================================================
# Window_SkillLearn
#==============================================================================
class Window_SkillLearn < Window_Help
def initialize
super
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
end
def set_text(text)
self.width = self.contents.text_size(text).width + 48
self.x = 320 - self.width/2
self.visible = true
Audio.se_play("Audio/SE/" + LEARN_SE, 80, 100)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
super(text, 1)
end
end
#==============================================================================
# Window_LevelUp
#==============================================================================
class Window_LevelUp < Window_Base
attr_accessor :limit
attr_reader :skills
def initialize(actor, skill_window)
super(0, 0, 160, 32)
@skill_window = skill_window
@skill_window.visible = false
self.x = actor.index * 160
self.visible = false
self.z = 100
@actor = actor
@exp = @actor.all_exp
@level = @actor.level
@maxhp = @actor.maxhp
@maxsp = @actor.maxsp
@str = @actor.str
@dex = @actor.dex
@agi = @actor.agi
@int = @actor.int
@old_skills = @actor.skills.clone
@skills = []
@limit = 480
end
def refresh
count = 0
count += 1 if @level != @actor.level
count += 1 if @maxhp != @actor.maxhp
count += 1 if @maxsp != @actor.maxsp
count += 1 if @str != @actor.str
count += 1 if @dex != @actor.dex
count += 1 if @agi != @actor.agi
count += 1 if @int != @actor.int
self.height = count * 24 + 64
@limit = 320 - self.height
self.y = 160 + @limit + (self.height/64+1)*64
self.contents = Bitmap.new(self.width - 32, self.height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 20
@skill_window.visible = false
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 128, 32, "Gained " + (@actor.all_exp - @exp).to_s + " EXP")
j = 1
for i in 0...7
case i
when 0
text1 = "Level:"
text2 = @level.to_s
text3 = @actor.level.to_s
next if @level == @actor.level
when 1
text1 = $data_system.words.hp
text2 = @maxhp.to_s
text3 = @actor.maxhp.to_s
next if @maxhp == @actor.maxhp
when 2
text1 = $data_system.words.sp
text2 = @maxsp.to_s
text3 = @actor.maxsp.to_s
next if @maxsp == @actor.maxsp
when 3
text1 = $data_system.words.str[0,3]
text2 = @str.to_s
text3 = @actor.str.to_s
next if @str == @actor.str
when 4
text1 = $data_system.words.dex[0,3]
text2 = @dex.to_s
text3 = @actor.dex.to_s
next if @dex == @actor.dex
when 5
text1 = $data_system.words.agi[0,3]
text2 = @agi.to_s
text3 = @actor.agi.to_s
next if @agi == @actor.agi
when 6
text1 = $data_system.words.int[0,3]
text2 = @int.to_s
text3 = @actor.int.to_s
next if @int == @actor.int
else
text1 = ""
text2 = ""
text3 = ""
end
self.contents.font.color = system_color
self.contents.draw_text(0, j*24, 128, 32, text1)
self.contents.font.color = normal_color
self.contents.draw_text(0, j*24, 76, 32, text2, 2)
self.contents.font.color = system_color
self.contents.draw_text(80, j*24, 32, 32, "ยป")
self.contents.font.color = Color.new(0, 255, 64, 255)
self.contents.font.color = Color.new(255, 64, 0, 255) if text2.to_i > text3.to_i
self.contents.draw_text(0, j*24, 128, 32, text3, 2)
j += 1
end
end
def test_lvlup
if @exp != @actor.all_exp
Audio.se_play("Audio/SE/" + LVLUP_SE, 80, 100)
check_skills
refresh
@exp = @actor.all_exp
self.visible = true
return true
end
@skill_window.visible = false
return false
end
def test_lvlup(flag = false)
if flag
if @exp != @actor.all_exp and @level == @actor.level
refresh
@exp = @actor.all_exp
self.visible = true
return true
else
return false
end
end
if @level != @actor.level
Audio.se_play("Audio/SE/" + LVLUP_SE, 80, 100)
check_skills
refresh
@exp = @actor.all_exp
@level = @actor.level
self.visible = true
return true
end
@skill_window.visible = false
return false
end
def check_skills
for id in @actor.skills
@skills.push(id) if not @old_skills.include?(id)
end
end
def set_next_skill
text = @actor.name + " learned " + $data_skills[@skills.shift].name + "!"
@skill_window.set_text(text)
self.visible = true
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias main_lvlup_later main
def main
@lvlup_windows = []
@skilllearn_window = Window_SkillLearn.new
for i in 0...$game_party.actors.size
@lvlup_windows.push(Window_LevelUp.new($game_party.actors[i], @skilllearn_window))
end
main_lvlup_later
for win in @lvlup_windows
win.dispose if win != nil
end
@skilllearn_window.dispose
end
alias start_phase5_lvlup_later start_phase5
def start_phase5
for actor in $game_party.actors
actor.remove_states_battle
end
@lvlup_index = 0
@flags = []
start_phase5_lvlup_later
end
def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0
@result_window.visible = true
$game_temp.battle_main_phase = false
@status_window.refresh
end
return
end
if @flags == []
@flags = [false]
for i in 0...$game_party.actors.size
@flags.push(i) if @lvlup_windows[i].test_lvlup(true)
end
@flags = [true] if @flags.size == 1
end
if @flags[0] == true
if @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 64
@lvlup_windows[@lvlup_index].y -= 64
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 32
@lvlup_windows[@lvlup_index].y -= 32
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 16
@lvlup_windows[@lvlup_index].y -= 16
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 8
@lvlup_windows[@lvlup_index].y -= 8
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 4
@lvlup_windows[@lvlup_index].y -= 4
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 2
@lvlup_windows[@lvlup_index].y -= 2
elsif @lvlup_windows[@lvlup_index].y > @lvlup_windows[@lvlup_index].limit + 1
@lvlup_windows[@lvlup_index].y -= 1
end
else
for i in 1...@flags.size
if @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 64
@lvlup_windows[@flags[i]].y -= 64
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 32
@lvlup_windows[@flags[i]].y -= 32
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 16
@lvlup_windows[@flags[i]].y -= 16
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 8
@lvlup_windows[@flags[i]].y -= 8
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 4
@lvlup_windows[@flags[i]].y -= 4
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 2
@lvlup_windows[@flags[i]].y -= 2
elsif @lvlup_windows[@flags[i]].y > @lvlup_windows[@flags[i]].limit + 1
@lvlup_windows[@flags[i]].y -= 1
end
end
end
if Input.trigger?(Input::C)
if @check
@check = false
return if not @flags[0]
end
@flags[0] = true
for i in 0...$game_party.actors.size
@lvlup_index += 1 if @flags.include?(@lvlup_index)
end
@result_window.visible = false if @result_window.visible != false
loop do
Graphics.update
if @lvlup_windows[@lvlup_index] == nil
battle_end(0)
return
end
check = @lvlup_windows[@lvlup_index].test_lvlup
if @lvlup_windows[@lvlup_index].skills.size == 0
return if check
if @lvlup_index == ($game_party.actors.size - 1)
battle_end(1) if @escaped
battle_end(0)
return
end
@lvlup_index += 1
else
@lvlup_windows[@lvlup_index].set_next_skill
return
end
end
end
end
end
[/spoiler]
[spoiler=cms]#==============================================================================
# ? Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 140, 80)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, -5, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(-15, 15, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 140, 54)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(-20, -5, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(104-cx, -5, cx, 32, $data_system.words.gold, 2)
end
end
#Displays Real Time
class Window_RealTime < Window_Base
#Object Initialization
def initialize
super(0, 0, 140, 80)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#Refresh
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(10, -5, 120, 32, "Real Time")
@time_string = Time.now
text = @time_string.strftime("%A %H:%M:%S")
self.contents.font.color = normal_color
self.contents.draw_text(-3, 20, 110, 32, text, 2)
end
#Time changes in menu
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
# Displays Location in Menu
class Window_Location < Window_Base
def initialize
super(0, 0, 500, 50)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
$data_location = load_data("Data/MapInfos.rxdata")
self.contents.draw_text(200, -9, 124, 32, $data_location[$game_map.map_id].name, 2)
self.contents.font.color = system_color
self.contents.draw_text(0, -9, 120, 32, "Location")
end
end
# Displays Game Name
class Window_GameName < Window_Base
def initialize
super(0, 0, 500, 50)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(100, -9, 120, 32, "Light's Shadow")
end
end
# Displays the Word "Menu"
class Window_MenuWord < Window_Base
def initialize
super(0, 0, 140, 50)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = crisis_color
self.contents.draw_text(10, -10, 120, 32, "Menu")
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 500, 400)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
def draw_actor_battler(actor, x, y, opacity = 255)
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
x = i * 120
y = 180
self.contents.blt(x, y, bitmap, src_rect, opacity)
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = i * 118
y = 0
actor = $game_party.actors[i]
draw_actor_battler(actor, x, y - 10)
self.contents.font.color = knockout_color
self.contents.draw_text(x, -10, 45, 32, actor.name, 2)
self.contents.font.color = normal_color
draw_actor_class(actor, x, 15)
draw_actor_state(actor, x, 40)
draw_actor_level(actor, x, 110)
# draw exp
self.contents.font.color = system_color
self.contents.draw_text(x, 130, 80, 32, "Exp")
self.contents.draw_text(x, 150, 80, 32, "Next Level")
self.contents.font.color = normal_color
self.contents.draw_text(x + 20, 130, 84, 32, actor.exp_s, 2)
self.contents.draw_text(x + 20, 150, 84, 32, actor.next_rest_exp_s, 2)
# draw hp
self.contents.font.color = system_color
self.contents.draw_text(x, 65, 32, 32, "HP")
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x + 10, 65, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + 60, 65, 12, 32, "/", 1)
self.contents.draw_text(x + 75, 65, 48, 32, actor.maxhp.to_s)
#draw sp
self.contents.font.color = system_color
self.contents.draw_text(x, 85, 32, 32, "SP")
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x + 10, 85, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + 60, 85, 12, 32, "/", 1)
self.contents.draw_text(x + 75, 85, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(@index * 118, 0, 118, 400)
end
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# ????????????
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "Exit"
@command_window = Window_Command.new(140, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
# If # Party Members = 0
if $game_party.actors.size == 0
# Disable Items, Skills, Equipment, and Status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If Save is Forbidden
if $game_system.save_disabled
# Disable Save
@command_window.disable_item(4)
end
# Displays Play Time
@playtime_window = Window_PlayTime.new
@playtime_window.x = 500
@playtime_window.y = 50
# Displays the "Word Menu" Window
@wordmenu_window = Window_MenuWord.new
@wordmenu_window.x = 500
@wordmenu_window.y = 0
# Displays the Gold Window
@gold_window = Window_Gold.new
@gold_window.x = 500
@gold_window.y = 426
# The Menu Status Screen
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 0
# Game Name Window
@gamename_window = Window_GameName.new
@gamename_window.x = 0
@gamename_window.y = 400
# Location Window
@map_window = Window_Location.new
@map_window.x = 0
@map_window.y = 440
# Real Time Window
@realtime_window = Window_RealTime.new
@realtime_window.x = 500
@realtime_window.y = 130
# Execute Transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@wordmenu_window.dispose
@map_window.dispose
@realtime_window.dispose
@gamename_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
@map_window.update
@realtime_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 5 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end[/spoiler]
[spoiler=Diablo Item Inventory] [code]#==============================================================================
# Item System Diablo Style
#------------------------------------------------------------------------------
# By DarkSchneider
# www.rpg2s.net
#------------------------------------------------------------------------------
# Credit to Schwarz for draw_line
#==============================================================================
class Scene_Item2
def initialize(actor_index = 0)
@actor_index = actor_index
end
def main
# Make help window, item window
s1 = "Use"
s2 = "Move"
s3 = "Drop"
@command_window = Window_Command.new(193, [s1, s2 , s3])
@command_window.y = 64
@help_window = Window_Help.new
@grid = Window_Grid.new(@actor_index)
@grid.active = false
# Associate help window
@grid.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
@window_pc = Window_Base.new(0,192,193,287)
@window_pc.contents = Bitmap.new(161,255)
@window_pc.draw_actor_name($game_party.actors[@actor_index], 10, 0)
@window_pc.draw_actor_picture($game_party.actors[@actor_index], 80, 250)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@cursor_icon.dispose if @cursor_icon != nil
# Dispose of windows
@command_window.dispose
@help_window.dispose
#@item_window.dispose
@target_window.dispose
@grid.dispose
@window_pc.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@help_window.update
@target_window.update
@grid.update
if @command_window.active
update_command
return
end
# If item window is active: call update_item
if @grid.active
case @grid.mode
when 0
update_usa
when 1
@cursor_icon = Cursor_Icon.new if @cursor_icon == nil
@cursor_icon.visible = false
update_muovi
when 2
update_lascia
when 3
@cursor_icon.update
update_muovi2
end
return
end
# If target window is active: call update_target
if @target_window.active
update_target
return
end
end
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
return
end
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # use
# Play decision SE
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
when 1 # move
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
when 2 # drop
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_usa
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @grid.item
# If not a use item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is an ally
if @item.scope >= 3
# Activate target window
@grid.active = false
#@target_window.x = (@item_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# If effect scope is other than an ally
else
# If command event ID is valid
if @item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @item.common_event_id
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1, false)
# Draw item window item
@grid.delete_item
end
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_can_use?(@item.id)
# Remake item window contents
@grid.refresh
end
# Erase target window
@grid.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if @grid.item_del?
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1, false)
# Redraw item window item
@grid.delete_item
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If item wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
def update_muovi
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
if Input.trigger?(Input::C)
if @grid.item != nil
@grid.get_item
bitmap = Bitmap.new(32,32)
x = 4 + (@grid.cursor_rect.width == 32 ? 0 : 18)
y = 4 + (@grid.cursor_rect.height == 32 ? 0 : 32)
bitmap.blt(0,0,@grid.contents,Rect.new(@grid.cursor_rect.x + x,
@grid.cursor_rect.y + y,@grid.cursor_rect.width,@grid.cursor_rect.height))
@cursor_icon.refresh(bitmap, @grid.item_saved[1])
@grid.cursor_rect.width = @cursor_icon.bitmap.width
@grid.cursor_rect.height = @cursor_icon.bitmap.height
@cursor_icon.x = @grid.cursor_rect.x + @grid.x + 16
@cursor_icon.y = @grid.cursor_rect.y + @grid.y + 16
@cursor_icon.visible = true
@grid.delete_item
@grid.mode = 3
end
return
end
end
def update_lascia
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
if Input.trigger?(Input::C)
if @grid.item != nil
@grid.delete_item
end
return
end
end
def update_muovi2
@grid.cursor_rect.width = @cursor_icon.bitmap.width
@grid.cursor_rect.height = @cursor_icon.bitmap.height
@cursor_icon.x = @grid.cursor_rect.x + @grid.x + 16
@cursor_icon.y = @grid.cursor_rect.y + @grid.y + 16
if @grid.empty?
@cursor_icon.blink_on
@cursor_icon.tone.set(0,0,0,0)
else
@cursor_icon.blink_off
@cursor_icon.tone.set(0,0,0,255)
end
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@grid.redraw_item(false)
@grid.mode = 1
return
end
if Input.trigger?(Input::C)
if @grid.empty?
@grid.redraw_item
@cursor_icon.visible = false
@grid.mode = 1
end
return
end
end
end
class Window_Selectable < Window_Base
alias old_initialize initialize
def initialize(x, y, width, height)
old_initialize(x, y, width, height)
if self.is_a?(Window_Grid)
@x = 0
@y = 0
end
end
alias old_update update
def update
if !self.is_a?(Window_Grid)
old_update
return
end
super
item = $game_party.actors[@actor_index].item_grid
# If cursor is movable
if self.active and @item_max > 0 and @x >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
@y = -1 if @y == item.size - (self.cursor_rect.height == 96 ? 3 : 1)
@y += 2 if item[@y][@x][1] == "w" or item[@y][@x][1] == "a"
if item[@y + 1][@x][1] == "r" and item[@y + 1][@x - 1][1] == "a"
@x -= 1
end
@y += 1
$game_system.se_play($data_system.cursor_se)
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
@y = item.size if @y - 1 == -1
@y -= 2 if item[@y - 1][@x][1] == "e" or item[@y - 1][@x][1] == "r"
@x -= 1 if item[@y - 1][@x - 1][1] == "a"
@y -= 1
$game_system.se_play($data_system.cursor_se)
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
if @x + (self.cursor_rect.width == 64 ? 2 : 1) == item[@y].size
@x = 0
@y -= 1 if item[@y - 1][@x][1] == "a"
@y -= 2 if item[@y - 2][@x][1] == "a"
else
@x += 1 if item[@y][@x][1] == "a"
if item[@y][@x + 1][1] == "r"
@y -= 1 if item[@y - 1][@x + 1][1] == "a"
@y -= 2 if item[@y - 2][@x + 1][1] == "a"
end
if item[@y][@x + 1][1] == "e"
@y -= 1
@y -= 1 if item[@y - 1][@x + 1][1] == "w"
end
@x += 1
end
$game_system.se_play($data_system.cursor_se)
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
@x = item[@y].size if @x - 1 == -1
if item[@y][@x - 1][1] == "r"
@x -= 1
@y -= 1 if item[@y - 1][@x - 1][1] == "a"
@y -= 2 if item[@y - 2][@x - 1][1] == "a"
end
if item[@y][@x - 1][1] == "e"
@y -= 1
@y -= 1 if item[@y - 1][@x - 1][1] == "w"
end
@x -= 1
$game_system.se_play($data_system.cursor_se)
end
end
# Update help text (update[/code
What do you do that makes the script crash and what error do you get when the script crashes? I remember this script was posted once before but I don't think the issue was ever solved.
it crashes when I try to test the game. It says: ?????''? 444 ??? SyntaxError ????????
I'll check into it. I have a bit of spare time since I'm taking a break from WoW and a few script projects would be nice to keep me occupied.
EDIT:Hmmm...not only are there two missing end statements, you may be missing a piece of the script. Where did you find the Diablo Item Script? The link inside the actual script didn't have the script. The script database on the site was listed as under construction.
here: http://rmrk.net/index.php/topic,12242.0.html (http://rmrk.net/index.php/topic,12242.0.html)
do you think you can fix it?
I think you just copied the script wrong because the version in the link you posted works perfectly fine.
#==============================================================================
# Item System Diablo Style
#------------------------------------------------------------------------------
# By DarkSchneider
# www.rpg2s.net
#------------------------------------------------------------------------------
# Credit to Schwarz for draw_line
#==============================================================================
class Scene_Item2
def initialize(actor_index = 0)
@actor_index = actor_index
end
def main
# Make help window, item window
s1 = "Use"
s2 = "Move"
s3 = "Drop"
@command_window = Window_Command.new(193, [s1, s2 , s3])
@command_window.y = 64
@help_window = Window_Help.new
@grid = Window_Grid.new(@actor_index)
@grid.active = false
# Associate help window
@grid.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
@window_pc = Window_Base.new(0,192,193,287)
@window_pc.contents = Bitmap.new(161,255)
@window_pc.draw_actor_name($game_party.actors[@actor_index], 10, 0)
@window_pc.draw_actor_picture($game_party.actors[@actor_index], 80, 250)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@cursor_icon.dispose if @cursor_icon != nil
# Dispose of windows
@command_window.dispose
@help_window.dispose
#@item_window.dispose
@target_window.dispose
@grid.dispose
@window_pc.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@help_window.update
@target_window.update
@grid.update
if @command_window.active
update_command
return
end
# If item window is active: call update_item
if @grid.active
case @grid.mode
when 0
update_usa
when 1
@cursor_icon = Cursor_Icon.new if @cursor_icon == nil
@cursor_icon.visible = false
update_muovi
when 2
update_lascia
when 3
@cursor_icon.update
update_muovi2
end
return
end
# If target window is active: call update_target
if @target_window.active
update_target
return
end
end
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
return
end
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # use
# Play decision SE
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
when 1 # move
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
when 2 # drop
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@grid.active = true
@grid.set = 0
@grid.mode = @command_window.index
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_usa
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @grid.item
# If not a use item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is an ally
if @item.scope >= 3
# Activate target window
@grid.active = false
#@target_window.x = (@item_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# If effect scope is other than an ally
else
# If command event ID is valid
if @item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @item.common_event_id
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1, false)
# Draw item window item
@grid.delete_item
end
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_can_use?(@item.id)
# Remake item window contents
@grid.refresh
end
# Erase target window
@grid.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if @grid.item_del?
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1, false)
# Redraw item window item
@grid.delete_item
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If item wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
def update_muovi
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
if Input.trigger?(Input::C)
if @grid.item != nil
@grid.get_item
bitmap = Bitmap.new(32,32)
x = 4 + (@grid.cursor_rect.width == 32 ? 0 : 18)
y = 4 + (@grid.cursor_rect.height == 32 ? 0 : 32)
bitmap.blt(0,0,@grid.contents,Rect.new(@grid.cursor_rect.x + x,
@grid.cursor_rect.y + y,@grid.cursor_rect.width,@grid.cursor_rect.height))
@cursor_icon.refresh(bitmap, @grid.item_saved[1])
@grid.cursor_rect.width = @cursor_icon.bitmap.width
@grid.cursor_rect.height = @cursor_icon.bitmap.height
@cursor_icon.x = @grid.cursor_rect.x + @grid.x + 16
@cursor_icon.y = @grid.cursor_rect.y + @grid.y + 16
@cursor_icon.visible = true
@grid.delete_item
@grid.mode = 3
end
return
end
end
def update_lascia
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@command_window.active = true
@grid.active = false
@grid.set = - 1
return
end
if Input.trigger?(Input::C)
if @grid.item != nil
@grid.delete_item
end
return
end
end
def update_muovi2
@grid.cursor_rect.width = @cursor_icon.bitmap.width
@grid.cursor_rect.height = @cursor_icon.bitmap.height
@cursor_icon.x = @grid.cursor_rect.x + @grid.x + 16
@cursor_icon.y = @grid.cursor_rect.y + @grid.y + 16
if @grid.empty?
@cursor_icon.blink_on
@cursor_icon.tone.set(0,0,0,0)
else
@cursor_icon.blink_off
@cursor_icon.tone.set(0,0,0,255)
end
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@grid.redraw_item(false)
@grid.mode = 1
return
end
if Input.trigger?(Input::C)
if @grid.empty?
@grid.redraw_item
@cursor_icon.visible = false
@grid.mode = 1
end
return
end
end
end
class Window_Selectable < Window_Base
alias old_initialize initialize
def initialize(x, y, width, height)
old_initialize(x, y, width, height)
if self.is_a?(Window_Grid)
@x = 0
@y = 0
end
end
alias old_update update
def update
if !self.is_a?(Window_Grid)
old_update
return
end
super
item = $game_party.actors[@actor_index].item_grid
# If cursor is movable
if self.active and @item_max > 0 and @x >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
@y = -1 if @y == item.size - (self.cursor_rect.height == 96 ? 3 : 1)
@y += 2 if item[@y][@x][1] == "w" or item[@y][@x][1] == "a"
if item[@y + 1][@x][1] == "r" and item[@y + 1][@x - 1][1] == "a"
@x -= 1
end
@y += 1
$game_system.se_play($data_system.cursor_se)
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
@y = item.size if @y - 1 == -1
@y -= 2 if item[@y - 1][@x][1] == "e" or item[@y - 1][@x][1] == "r"
@x -= 1 if item[@y - 1][@x - 1][1] == "a"
@y -= 1
$game_system.se_play($data_system.cursor_se)
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
if @x + (self.cursor_rect.width == 64 ? 2 : 1) == item[@y].size
@x = 0
@y -= 1 if item[@y - 1][@x][1] == "a"
@y -= 2 if item[@y - 2][@x][1] == "a"
else
@x += 1 if item[@y][@x][1] == "a"
if item[@y][@x + 1][1] == "r"
@y -= 1 if item[@y - 1][@x + 1][1] == "a"
@y -= 2 if item[@y - 2][@x + 1][1] == "a"
end
if item[@y][@x + 1][1] == "e"
@y -= 1
@y -= 1 if item[@y - 1][@x + 1][1] == "w"
end
@x += 1
end
$game_system.se_play($data_system.cursor_se)
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
@x = item[@y].size if @x - 1 == -1
if item[@y][@x - 1][1] == "r"
@x -= 1
@y -= 1 if item[@y - 1][@x - 1][1] == "a"
@y -= 2 if item[@y - 2][@x - 1][1] == "a"
end
if item[@y][@x - 1][1] == "e"
@y -= 1
@y -= 1 if item[@y - 1][@x - 1][1] == "w"
end
@x -= 1
$game_system.se_play($data_system.cursor_se)
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
class Window_Grid < Window_Selectable
attr_accessor :mode
attr_reader :item_saved
def initialize(actor_index)
super(192,64,448,416)
self.contents = Bitmap.new(width - 32, height - 32) #icone oggetti
self.opacity = 0
@window = Window_Base.new(x , y , width, height) #griglia bianca
@window.contents = Bitmap.new(width - 32, height - 32)
@window.z = self.z - 4
@grid_color = Sprite.new #colori oggetti
@grid_color.bitmap = Bitmap.new(width - 32, height - 32)
@grid_color.x = self.x + 16
@grid_color.y = self.y + 16
@grid_color.z = @window.z + 2
@actor_index = actor_index
@mode = 0
@mini_help = Mini_Help.new
self.set = -1
n = self.contents.width / 32
m = self.contents.height / 32
@column_max = n
draw_grid
refresh
end
def draw_grid
@window.contents.fill_rect(0, 0, width - 32, height - 32, Color.new(255,255,255))
i = 0
color = Color.new(0,0,0)
while i < self.contents.height
draw_line(0, i, self.contents.width, i, color)
i += 32
end
i = 0
while i < self.contents.width
draw_line(i, 0, i, self.contents.width, color)
i += 32
end
end
def draw_line(sx, sy, ex, ey, color)
rad = Math.atan2(ey-sy, ex-sx)
dx = Math.cos(rad)
dy = Math.sin(rad)
while (sx - ex).abs > 1 || (sy - ey).abs > 1
sx += dx
sy += dy
@window.contents.set_pixel(sx, sy, color)
end
end
def refresh
@item_max = 0
item = $game_party.actors[@actor_index].item_grid
for i in 0..item.size - 1
for j in 0..item[i].size - 1
if item[i][j][0]!= 0 and item[i][j][1] != "r" and item[i][j][1] != "e"
@item_max += 1
end
end
end
for i in 0..item.size - 1
for j in 0..item[i].size - 1
draw_item(item[i][j][0], item[i][j][1], i , j)
end
end
end
def update_cursor_rect
# If cursor position is less than 0
if @x < 0
self.cursor_rect.empty
return
end
# Calculate cursor width
case $game_party.actors[@actor_index].item_grid[@y][@x][1]
when "i"
cursor_width = 32
cursor_height = 32
when "w"
cursor_width = 32
cursor_height = 96
when "a"
cursor_width = 64
cursor_height = 96
else
cursor_width = 32
cursor_height = 32
end
# Calculate cursor coordinates
x = @x * 32
y = @y * 32
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, cursor_height)
end
def delete_item
case $game_party.actors[@actor_index].item_grid[@y][@x][1]
when "i"
@grid_color.bitmap.fill_rect(@x*32+1, @y*32+1, 31, 31, Color.new(0,0,0,0))
self.contents.fill_rect(@x*32, @y*32, 32, 32, Color.new(0,0,0,0))
$game_party.actors[@actor_index].item_grid[@y][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y][@x][1] = ""
when "w"
@grid_color.bitmap.fill_rect(@x*32+1, @y*32+1, 31, 95, Color.new(0,0,0,0))
self.contents.fill_rect(@x*32, @y*32 + 4 + 32, 32, 32, Color.new(0,0,0,0))
$game_party.actors[@actor_index].item_grid[@y][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y][@x][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 1][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 2][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] = ""
when "a"
@grid_color.bitmap.fill_rect(@x*32+1, @y*32+1, 63, 95, Color.new(0,0,0,0))
self.contents.fill_rect(@x*32 + 18, @y*32 + 4 + 32, 32, 32, Color.new(0,0,0,0))
$game_party.actors[@actor_index].item_grid[@y][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y][@x][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 1][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 2][@x][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] = ""
$game_party.actors[@actor_index].item_grid[@y][@x + 1][0] = 0
$game_party.actors[@actor_index].item_grid[@y][@x + 1][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 1][@x + 1][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 1][@x + 1][1] = ""
$game_party.actors[@actor_index].item_grid[@y + 2][@x + 1][0] = 0
$game_party.actors[@actor_index].item_grid[@y + 2][@x + 1][1] = ""
end
end
def item
i = $game_party.actors[@actor_index].item_grid[@y][@x][0]
case $game_party.actors[@actor_index].item_grid[@y][@x][1]
when "i"
return $data_items[i]
when "w"
return $data_weapons[i]
when "a"
return $data_armors[i]
else return nil
end
end
def item_del?
if $game_party.actors[@actor_index].item_grid[@y][@x][0] == 0
# Unusable
return true
else
return false
end
end
def dispose
super
@window.dispose
@grid_color.dispose
@mini_help.dispose
end
def update_help
@mini_help.contents.font.color = (($game_party.item_can_use?(item.id) and item.is_a?(RPG::Item))? normal_color : disabled_color)
@help_window.set_text(item == nil ? "" : item.description)
@mini_help.set_text(item == nil ? "" : item.name)
@mini_help.visible = false if item == nil
@mini_help.x = self.cursor_rect.x + self.cursor_rect.width + 192 +
(self.contents.width - self.cursor_rect.x - self.cursor_rect.width < @mini_help.width ? -@mini_help.width : 18)
@mini_help.y = self.cursor_rect.y + self.cursor_rect.height + 64 +
(self.contents.height - self.cursor_rect.y - self.cursor_rect.height < @mini_help.height ? -@mini_help.height : 18)
end
def get_item
@item_saved = [$game_party.actors[@actor_index].item_grid[@y][@x][0],
$game_party.actors[@actor_index].item_grid[@y][@x][1], @x, @y]
end
def redraw_item(f = true)
if f
x = 4 + (@x * 32)
y = @y * 32
else
x = 4 + (@item_saved[2] * 32)
y = @item_saved[3] * 32
tx = @x
ty = @y
@x = @item_saved[2]
@y = @item_saved[3]
end
draw_item(@item_saved[0], @item_saved[1], @y , @x)
case @item_saved[1]
when "i"
$game_party.actors[@actor_index].item_grid[@y][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y][@x][1] = @item_saved[1]
when "w"
$game_party.actors[@actor_index].item_grid[@y][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y][@x][1] = @item_saved[1]
$game_party.actors[@actor_index].item_grid[@y + 1][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] = "e"
$game_party.actors[@actor_index].item_grid[@y + 2][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] = "e"
when "a"
$game_party.actors[@actor_index].item_grid[@y][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y][@x][1] = @item_saved[1]
$game_party.actors[@actor_index].item_grid[@y + 1][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] = "r"
$game_party.actors[@actor_index].item_grid[@y + 2][@x][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] = "r"
$game_party.actors[@actor_index].item_grid[@y][@x + 1][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y][@x + 1][1] = "r"
$game_party.actors[@actor_index].item_grid[@y + 1][@x + 1][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 1][@x + 1][1] = "r"
$game_party.actors[@actor_index].item_grid[@y + 2][@x + 1][0] = @item_saved[0]
$game_party.actors[@actor_index].item_grid[@y + 2][@x + 1][1] = "r"
end
@x = tx if @x != tx and tx != nil
@y = ty if @y != ty and ty != nil
end
def empty?
case @item_saved[1]
when "i"
return true if $game_party.actors[@actor_index].item_grid[@y][@x][1] == ""
when "w"
if $game_party.actors[@actor_index].item_grid[@y][@x][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] == ""
return true
end
when "a"
if $game_party.actors[@actor_index].item_grid[@y][@x][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 1][@x][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 2][@x][1] == "" and
$game_party.actors[@actor_index].item_grid[@y][@x + 1][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 1][@x + 1][1] == "" and
$game_party.actors[@actor_index].item_grid[@y + 2][@x + 1][1] == ""
return true
end
end
return false
end
def set=(set)
@x = set
@y = set
@mini_help.visible = (set == 0 ? true : false)
end
def draw_item(item_id, type, i , j)
if type == "i" and
$game_party.item_can_use?($data_items[item_id].id)
opacity = 255
else
opacity = 128
end
if item_id != 0
case type
when "i"
x = 4 + (j * 32)
y = i * 32
bitmap = RPG::Cache.icon($data_items[item_id].icon_name)
@grid_color.bitmap.fill_rect(j*32+1, i*32+1, 31, 31, Color.new(0,0,200))
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
when "w"
x = 4 + (j * 32)
y = i * 32
bitmap = RPG::Cache.icon($data_weapons[item_id].icon_name)
@grid_color.bitmap.fill_rect(j*32+1, i*32+1, 31, 95, Color.new(200,0,0))
self.contents.blt(x, y + 4 + 32, bitmap, Rect.new(0, 0, 24, 24), opacity)
when "a"
x = 4 + (j * 32)
y = i * 32
bitmap = RPG::Cache.icon($data_armors[item_id].icon_name)
@grid_color.bitmap.fill_rect(j*32+1, i*32+1, 63, 95, Color.new(0,200,0))
self.contents.blt(x + 18, y + 4 + 32, bitmap, Rect.new(0, 0, 24, 24), opacity)
end
end
end
end
class Mini_Help < Window_Base
alias old_initialize initialize
def initialize
super(0, 0, 180, 40)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.back_opacity = 170
self.z = 102
self.visible = false
end
def set_text(text, align = 1)
# If at least one part of text and alignment differ from last time
if text != @text or align != @align
# Redraw text
self.contents.clear
#self.contents.font.color = normal_color
self.contents.draw_text(4, -12, self.width - 40, 32, text, align)
#self.width = self.contents.text_size(text).width
@text = text
@align = align
@actor = nil
end
self.visible = true
end
end
class Game_Actor < Game_Battler
attr_accessor :item_grid
alias old_initialize initialize
def initialize(actor_id)
old_initialize(actor_id)
@item_grid = Array.new(12)
for i in 0..@item_grid.size - 1
@item_grid[i] = Array.new(13)
for k in 0..@item_grid[i].size - 1
@item_grid[i][k] = Array.new(2)
@item_grid[i][k][0] = 0
@item_grid[i][k][1] = ""
end
end
end
end
class Game_Party
def gain_item(item_id, n)
if item_id > 0
for k in 1..n
for i in 0..self.actors.size - 1
break if set_item(item_id, "i", i) == nil
end
end
end
end
def gain_weapon(weapon_id, n)
if weapon_id > 0
for k in 1..n
for i in 0..self.actors.size - 1
break if set_item(weapon_id, "w", i) == nil
end
end
end
end
def gain_armor(armor_id, n)
if armor_id > 0
for k in 1..n
for i in 0..self.actors.size - 1
break if set_item(armor_id, "a", i) == nil
end
end
end
end
def lose_item(item_id, n, random = true)
if random == true
if item_id > 0
for k in 1..n
del_item(item_id, "i")
end
end
end
@items[item_id] = [[item_number(item_id) + -n, 0].max, 99].min
end
def lose_weapon(weapon_id, n, random = true)
if random == true
if weapon_id > 0
for k in 1..n
del_item(weapon_id, "w")
end
end
end
@weapons[weapon_id] = [[weapon_number(weapon_id) + -n, 0].max, 99].min
end
def lose_armor(armor_id, n, random = true)
if random == true
if armor_id > 0
for k in 1..n
del_item(armor_id, "a")
end
end
end
@armors[armor_id] = [[armor_number(armor_id) + -n, 0].max, 99].min
end
def set_item(item_id, type, i)
for a in 0..self.actors[i].item_grid.size - 1
for b in 0..self.actors[i].item_grid[a].size - 1
if self.actors[i].item_grid[a][b][0] == 0
case type
when "i"
self.actors[i].item_grid[a][b][0] = item_id
self.actors[i].item_grid[a][b][1] = type
@items[item_id] = [[item_number(item_id) + 1, 0].max, 99].min
return
when "w"
if a < self.actors[i].item_grid.size - 2
if self.actors[i].item_grid[a + 1][b][0] == 0 and
self.actors[i].item_grid[a + 2][b][0] == 0
self.actors[i].item_grid[a][b][0] = item_id
self.actors[i].item_grid[a][b][1] = type
self.actors[i].item_grid[a + 1][b][0] = item_id
self.actors[i].item_grid[a + 1][b][1] = "e"
self.actors[i].item_grid[a + 2][b][0] = item_id
self.actors[i].item_grid[a + 2][b][1] = "e"
@weapons[item_id] = [[weapon_number(item_id) + 1, 0].max, 99].min
return
end
end
when "a"
if b < self.actors[i].item_grid[a].size - 1 and a < self.actors[i].item_grid.size - 2
if self.actors[i].item_grid[a + 1][b][0] == 0 and self.actors[i].item_grid[a + 2][b][0] == 0 and
self.actors[i].item_grid[a][b + 1][0] == 0 and
self.actors[i].item_grid[a + 1][b + 1][0] == 0 and self.actors[i].item_grid[a + 2][b + 1][0] == 0
self.actors[i].item_grid[a][b][0] = item_id
self.actors[i].item_grid[a][b][1] = type
self.actors[i].item_grid[a + 1][b][0] = item_id
self.actors[i].item_grid[a + 1][b][1] = "r"
self.actors[i].item_grid[a + 2][b][0] = item_id
self.actors[i].item_grid[a + 2][b][1] = "r"
self.actors[i].item_grid[a][b + 1][0] = item_id
self.actors[i].item_grid[a][b + 1][1] = "r"
self.actors[i].item_grid[a + 1][b + 1][0] = item_id
self.actors[i].item_grid[a + 1][b + 1][1] = "r"
self.actors[i].item_grid[a + 2][b + 1][0] = item_id
self.actors[i].item_grid[a + 2][b + 1][1] = "r"
@armors[item_id] = [[armor_number(item_id) + 1, 0].max, 99].min
return
end
end
end
end
end
end
end
def del_item(item_id, type)
for i in 0..self.actors.size - 1
for a in 0..self.actors[i].item_grid.size - 1
for b in 0..self.actors[i].item_grid[a].size - 1
if self.actors[i].item_grid[a][b][0] == item_id and
self.actors[i].item_grid[a][b][1] == type
case type
when "i"
self.actors[i].item_grid[a][b][0] = 0
self.actors[i].item_grid[a][b][1] = ""
return
when "w"
self.actors[i].item_grid[a][b][0] = 0
self.actors[i].item_grid[a][b][1] = ""
self.actors[i].item_grid[a + 1][b][0] = 0
self.actors[i].item_grid[a + 1][b][1] = ""
self.actors[i].item_grid[a + 2][b][0] = 0
self.actors[i].item_grid[a + 2][b][1] = ""
return
when "a"
self.actors[i].item_grid[a][b][0] = 0
self.actors[i].item_grid[a][b][1] = ""
self.actors[i].item_grid[a + 1][b][0] = 0
self.actors[i].item_grid[a + 1][b][1] = ""
self.actors[i].item_grid[a + 2][b][0] = 0
self.actors[i].item_grid[a + 2][b][1] = ""
self.actors[i].item_grid[a][b + 1][0] = 0
self.actors[i].item_grid[a][b + 1][1] = ""
self.actors[i].item_grid[a + 1][b + 1][0] = 0
self.actors[i].item_grid[a + 1][b + 1][1] = ""
self.actors[i].item_grid[a + 2][b + 1][0] = 0
self.actors[i].item_grid[a + 2][b + 1][1] = ""
return
end
end
end
end
end
end
end
class Cursor_Icon < RPG::Sprite
def initialize
super
@color = Color.new(255,255,0,150)
@rect = Rect.new(0, 0, 24, 24)
end
def refresh(bitmap, item)
case item
when "i"
x = 4
y = 4
width = 32
height = 32
when "w"
x = 4
y = 36
width = 32
height = 96
when "a"
x = 22
y = 36
width = 64
height = 96
end
if self.bitmap == nil or (self.bitmap.width != width or self.bitmap.height != height)
self.bitmap = Bitmap.new(width, height)
else
self.bitmap.clear
end
self.bitmap.fill_rect(0,0,width,height, @color)
self.bitmap.blt(x, y , bitmap, @rect)
self.z = 9999
end
end
class Window_Base
def draw_actor_picture(actor, x, y)
bitmap = RPG::Cache.battler(actor.character_name, actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
class Scene_Menu
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 5 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item2.new(@status_window.index)
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
it almost fixed the problem. I can test the game now, but the item screen looks like this:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi163.photobucket.com%2Falbums%2Ft284%2Ffadarkrmxp%2Fitemscreen.jpg&hash=d120a760699edb5fef51a509fee7cc83b5719ad5)
I believe that's only because you have no items in your inventory.
no, i've tried it with items
Well you must have a script that edits the default 'x' placement of command windows, because I just tried it and it works fine for me.
Anyway, only way I can think to fix it is set the x placement for the window. So add this line
@command_window.x = 0
Under
s3 = "Drop"
@command_window = Window_Command.new(193, [s1, s2 , s3])
@command_window.y = 64
(which is lines 19, 20, 21)
oooh the COMMAND WINDOW...my bad. I thought you meant the items weren't being displayed even when you had items in your inventory. Sorry to leave you hanging like that.
its okay! ;D ill try the new idea now
it works! thanks alot! I dont know how to repay you! (i cant make battlers, char. sets, scripts etc. The only thing I can do is suggest things, and make games. I have probably helped at least 2 or 3 people now, by just suggesting ideas like using: events, resorses that I got from other people, and other stuff like that)
lol...no problem, it was one line any amateur scripter could figure it out ;)