done and done. Insert this script above main and it'll work fine.
SCREENY!!! CLICKY CLICKY!And here is a comparison to the first script I ever wrote.Ironicly, it was for the same person! XD
I've come a long ways since those days ^^ i'm almost embarrassed to see my first script even though I'm the one who wrote it... T.T twas back before I knew how redefined methods worked.
#===================================================
# - CLASS Game_Map Begins
#===================================================
class Game_Map#I have no idea where the hell I got this from but it was in an old CMS
def name#that I started doing when I was learning the basics.
$map_infos[@map_id]
end
end
#===================================================
# - CLASS Game_Map Ends
#===================================================
#===================================================
# - CLASS Scene_Title Begins
#===================================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#===================================================
# - CLASS Scene_Title Ends
#===================================================
#===================================================
# - CLASS Window_Base Begins
#===================================================
class Window_Base
def draw_actor_exp2(actor, x, y)#this method is based on the original draw_actor_exp method
self.contents.font.color = system_color#however it displays the current experience with the
self.contents.draw_text(x, y, 24, 32, "Exp")#experience required for the next level beneath it
self.contents.draw_text(x, y + 20, 24, 32, "Next")
self.contents.font.color = normal_color
self.contents.draw_text(x + 52, y, 84, 32, actor.exp_s, 2)
self.contents.draw_text(x + 52, y + 20, 84, 32, actor.next_rest_exp_s, 2)
end
def draw_actor_hp2(actor, x, y, width = 144)#this one is just modified to keep the max and current
self.contents.font.color = system_color#hp of a character in one place instead of moving around
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)#due to changing max hp.
self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
if actor.maxhp < 100
plus_hpx = 56
plus_slashx = 105
elsif actor.maxhp >= 100 and actor.maxhp < 1000
plus_hpx = 46
plus_slashx = 95
elsif actor.maxhp > 1000 and actor.maxhp < 10000
plus_hpx = 36
plus_slashx = 85
end
self.contents.draw_text(x + plus_hpx, y, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + plus_slashx, y, 12, 32, "/", 1)
self.contents.draw_text(x + 88, y, 48, 32, actor.maxhp.to_s, 2)
end
def draw_actor_sp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
if actor.maxsp < 100
plus_spx = 56
plus_slashx = 105
elsif actor.maxsp >= 100 and actor.maxsp < 1000
plus_spx = 46
plus_slashx = 95
elsif actor.maxsp > 1000 and actor.maxsp < 10000
plus_spx = 36
plus_slashx = 85
end
self.contents.draw_text(x + plus_spx, y, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + plus_slashx, y, 12, 32, "/", 1)
self.contents.draw_text(x + 88, y, 48, 32, actor.maxsp.to_s, 2)
end
def draw_item_name2(item, x, y)#this method was modified to remove the icon
if item == nil#that was being displayed. It took up WAY too much space in the window.
return
end
self.contents.font.color = normal_color
cx = contents.text_size(item.name).width
self.contents.draw_text(x, y, cx, 32, item.name)
end
end
#===================================================
# - CLASS Window_Base Ends
#===================================================
#===================================================
# - CLASS Scene_Menu Begins
#===================================================
class Scene_Menu
#---------------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#---------------------------------------------------------------------------------
def main
@window2 = Window2.new
@window2.x =0
@window2.y =59
@window2.height = 240
@window2.width = 500
@window3 = Window3.new(0)
@window3.x =0
@window3.y =299
@window3.height = 127
@window3.width = 168
@window3_two = Window3.new(1)
@window3_two.x =167
@window3_two.y =299
@window3_two.height = 127
@window3_two.width = 168
@window3_three = Window3.new(2)
@window3_three.x =334
@window3_three.y =299
@window3_three.height = 127
@window3_three.width = 168
@window4 = Window4.new
@window4.x =0
@window4.y =425
@window4.height = 56
@window4.width = 502
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End Game"
@window5 = Window_Command.new(139, [s1, s2, s3, s4, s5, s6])
@window5.index = @menu_index
@window5.x =501
@window5.y =60
@window5.height = 420
@window5.width = 139
@window1 = Window1.new(@window5.index)#window help based on window 5's index
@window1.x =0
@window1.y =0
@window1.height = 60
@window1.width = 640
@window6 = Window6.new(0)#actor window replicated through variables to reduce lag. outside not visible
@window6.x =0
@window6.y =60
@window6.back_opacity = 0
@window6.opacity = 0
@window6_two = Window6.new(1)
@window6_two.x =167
@window6_two.y =60
@window6_two.back_opacity = 0
@window6_two.opacity = 0
@window6_three = Window6.new(2)
@window6_three.x =334
@window6_three.y =60
@window6_three.back_opacity = 0
@window6_three.opacity = 0
if $game_party.actors.size == 0
@window5.disable_item(0)
@window5.disable_item(1)
@window5.disable_item(2)
@window5.disable_item(3)
end
if $game_system.save_disabled
@window5.disable_item(4)
end
@char_windows = [@window6, @window6_two, @window6_three]
@all_windows = [@window1, @window2, @window3, @window3_two,@window3_three, @window4, @window5, @window6, @window6_two, @window6_three]
Graphics.transition#the above variables that I stored the windows in will be used shortly
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
for i in 0...@all_windows.size#and here it is. the reason why I stored the windows in a variable.
@all_windows[i].dispose#this disposes the windows using only 3 lines compared to the 8 or so lines
end#that a conventional way would have used. less lines used means less lag from your scripts.
end
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
def update
for i in 0...@all_windows.size#again....wow...yet again less lines used.
@all_windows[i].update#this updates all of the windows using only 3 lines
end
if @window5.active
@window1.text(@window5.index)
update_command
return
end
if @window6.active or @window6_two.active or @window6_three.active
update_status
return
end
end
#---------------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
#This plays the predefined cancel sound effect
$game_system.se_play($data_system.cancel_se)
#This tells the game to go back to the map.
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
# ??????? 0 ??????????????????????
if $game_party.actors.size == 0 and @window5.index < 4
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ???????????????????
case @window5.index
when 0 # ????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????
$scene = Scene_Item.new
when 1 # ???
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@window5.active = false
@window6.active = true
@window6.index = 0
@char_index = 0
when 2 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@window5.active = false
@window6.active = true
@window6.index = 0
@char_index = 0
when 3 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ???????????????????
@window5.active = false
@window6.active = true
@window6.index = 0
@char_index = 0
when 4 # ???
# ????????
if $game_system.save_disabled
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????
$scene = Scene_Save.new
when 5 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????????
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????????????)
#--------------------------------------------------------------------------
def update_status
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????????????
@window5.active = true
for i in 0...@char_windows.size
@char_windows[i].active = false
@char_windows[i].index = -1
@char_index = -1
end
return
end
if Input.repeat?(Input::LEFT)
if @window6_three.active
@window6_three.active = false
@window6_three.index = -1
@window6_two.active = true
@window6_two.index = 0
@char_index = 1
return
end
if @window6_two.active
@window6_two.active = false
@window6_two.index = -1
@window6.active = true
@window6.index = 0
@char_index = 0
return
end
if @window6.active
if $game_party.actors.size == 3
$game_system.se_play($data_system.cursor_se)
@window6.active = false
@window6.index = -1
@window6_three.active = true
@window6_three.index = 0
@char_index = 2
return
else
$game_system.se_play($data_system.cursor_se)
@window6.active = false
@window6.index = -1
@window6_two.active = true
@window6_two.index = 0
@char_index = 1
return
end
end
end
if Input.repeat?(Input::RIGHT)
if @window6_three.active
@window6_three.active = false
@window6_three.index = -1
@window6.active = true
@window6.index = 0
@char_index = 0
return
end
if @window6_two.active
if $game_party.actors.size == 3
@window6_two.active = false
@window6_two.index = -1
@window6_three.active = true
@window6_three.index = 0
@char_index = 2
return
else
$game_system.se_play($data_system.buzzer_se)
return
end
end
if @window6.active
if $game_party.actors.size >= 2
$game_system.se_play($data_system.cursor_se)
@window6.active = false
@window6.index = -1
@window6_two.active = true
@window6_two.index = 0
@char_index = 1
return
else
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
if Input.trigger?(Input::C)
# ???????????????????
case @window5.index
when 1 # ???
$game_system.se_play($data_system.decision_se)
# ??????????
if $game_party.actors[@char_index].restriction >= 2
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
$scene = Scene_Skill.new(@char_index)
when 2 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ?????????
$scene = Scene_Equip.new(@char_index)
when 3 # ?????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????????
$scene = Scene_Status.new(@char_index)
end
return
end
end
end
#===================================================
# - CLASS Scene_Menu Ends
#===================================================
#===================================================
# - CLASS Window1 Begins
#===================================================
class Window1 < Window_Base
#---------------------------------------------------------------------------------
def initialize(index)
super(0, 0, 640,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
text(index)
refresh
end
#---------------------------------------------------------------------------------
def text(index)
case index
when 0
@text = "Open your bag?"
when 1
@text = "Use "+$data_system.words.skill+"s?"
when 2
@text = "Change your "+$data_system.words.equip+"?"
when 3
@text = "Check your status?"
when 4
@text = "Write down your current progress?"
when 5
@text = "Quit the adventure?"
end
refresh
end
#---------------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size(@text).width
self.contents.draw_text(0, 0, cx, 33, @text)
end
end
#===================================================
# - CLASS Window1 Ends
#===================================================
#===================================================
# - CLASS Window2 Begins
#===================================================
class Window2 < Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 500,240)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Window2 Ends
#===================================================
#===================================================
# - CLASS Window3 Begins
#===================================================
class Window3 < Window_Base
#---------------------------------------------------------------------------------
def initialize(actor_id)
super(0, 0, 166,127)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
actor = $game_party.actors[actor_id]
@data = [$data_weapons[actor.weapon_id], $data_armors[actor.armor3_id], $data_armors[actor.armor4_id]]
for i in 0...@data.size#all this does is draw the actors gear in 2 lines instead of 5 or so.
draw_item_name2(@data[i], 0, 32 * i)
end
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Window3 Ends
#===================================================
#===================================================
# - CLASS Window4 Begins
#===================================================
class Window4 < Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 502, 56)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
#self.contents.draw_text(0, 0, 33, 33, "Window 4:Location/Gold window")
self.contents.font.color = system_color
cx = contents.text_size("Location:").width
self.contents.draw_text(4, 0, cx, 32, "Location:")
self.contents.font.color = normal_color
cx = contents.text_size($game_map.name).width
self.contents.draw_text(80, 0, cx, 32, $game_map.name)
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(345, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(465-cx, 0, cx, 32, $data_system.words.gold, 2)
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Window4 Ends
#===================================================
#===================================================
# - CLASS Window6 Begins
#===================================================
class Window6 < Window_Selectable
#---------------------------------------------------------------------------------
def initialize(actor_id)
super(0, 0, 168,240)
@actor_id = actor_id
@actor = $game_party.actors[actor_id]
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
refresh
self.active = false
self.index = -1
end
#---------------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = 1
if $game_party.actors.size < @actor_id + 1
cx = contents.text_size("EMPTY").width
cy = contents.text_size("EMPTY").height
self.contents.draw_text(0, 0, cx, cy, "EMPTY")
elsif $game_party.actors.size > @actor_id
draw_actor_name(@actor, 0, -10)
draw_actor_graphic(@actor, 20, 70)
draw_actor_level(@actor, 0, 80)
draw_actor_hp2(@actor, 0, 100)
draw_actor_sp2(@actor, 0, 120)
draw_actor_exp2(@actor, 0, 140)
end
end
#---------------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(-2, -2, self.width - 30, self.height - 30)
end
end
end
#===================================================
# - CLASS Window6 Ends
#===================================================
If anyone has questions on how I did something, please feel free to ask. Also, I left notes detailing things to shed light on how I did some things.