12-08-2006, 01:00 PM
QuickStats V0.5
Neon*
Dec 8 2006
This is the Quickstats script, version 0.5. Its not 100% complete, but the base of it is done and working.
What does it do?
It opens a menu, anywhere while on the maps(Not in battle etc.) and shows you your actors HP, SP and EXP. All you do is press the Q key, and it opens up.
I wanted to do more with this script, but I want to know if people like it, and want me to do more on it. If so, I will add movement while the quickstats menu is displayed and sliding of the menu when it appears and disappears.
So please leave feedback.
Save yourself some time, and download the demo.
QuickStats.zip (Size: 191.72 KB / Downloads: 5)
Now for the scripts you must add. Some of them are small edits, but its easier to paste in the whole edited version.
The QuickStats script(Alot of this script isnt mine. I have added the gradient bars script, by Cogwheel I believe, so credit goes to him for that!)
Now replace Scene_Map with this script:
And Lastly, replace game_temp with this script:
Thats it. Please leave feedback on this one.
Neon*
Dec 8 2006
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
This is the Quickstats script, version 0.5. Its not 100% complete, but the base of it is done and working.
What does it do?
It opens a menu, anywhere while on the maps(Not in battle etc.) and shows you your actors HP, SP and EXP. All you do is press the Q key, and it opens up.
I wanted to do more with this script, but I want to know if people like it, and want me to do more on it. If so, I will add movement while the quickstats menu is displayed and sliding of the menu when it appears and disappears.
So please leave feedback.
Save yourself some time, and download the demo.
QuickStats.zip (Size: 191.72 KB / Downloads: 5)
Now for the scripts you must add. Some of them are small edits, but its easier to paste in the whole edited version.
The QuickStats script(Alot of this script isnt mine. I have added the gradient bars script, by Cogwheel I believe, so credit goes to him for that!)
Content Hidden
Code:
#==============================================================================
# ** Scene_QuickStatus
#------------------------------------------------------------------------------
# This class performs status screen processing.
#==============================================================================
class Scene_Quickstatus
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@quickstatus_window = Window_Quickstatus.new
@quickstatus_window.x = 400
@quickstatus_window.y = 0
@quickstatus_window.opacity = 255
@quickstatus_window.back_opacity = 200
# 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
@quickstatus_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# 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_Map.new
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Map.new
return
end
@quickstatus_window.update
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_Quickstatus.dispose
$scene = Scene_Map.new
return
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_Quickstatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@spriteset = Spriteset_Map.new
super(0, 0, 240, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
@fade_in = true
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def quickstats_color
return Color.new(100, 255, 225, 55)
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 0
y = i * 105
actor = $game_party.actors[i]
self.contents.font.size = 20
draw_actor_graphic(actor, x + 175, y + 95)
draw_actor_exp(actor, x, y + 98)
draw_actor_hp(actor, x, y + 32)
draw_actor_sp(actor, x, y + 64)
end
for i in 0...$game_party.actors.size
x = 0
y = i * 105
self.contents.font.color = quickstats_color
self.contents.font.size = 12
self.contents.draw_text(x, y+114, 120, 32, "===================")
self.contents.draw_text(x+95, y+114, 120, 32, "====================")
end
#Draw Title
self.contents.font.size = 24
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 120, 32, "Quick Stats")
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
end
# HP/SP/EXPƒQ?[ƒW•\Ž¦ƒXƒNƒŠƒvƒg Ver 1.00
# ”z•zŒ³?EƒTƒ|?[ƒgURL
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# ?¡ Game_Actor
#------------------------------------------------------------------------------
# ?@ƒAƒNƒ^?[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·?B‚±‚̃Nƒ‰ƒX‚Í Game_Actors ƒNƒ‰ƒX ($game_actors)
# ‚Ì“à•”‚ÅŽg—p‚³‚ê?AGame_Party ƒNƒ‰ƒX ($game_party) ‚©‚ç‚àŽQ?Æ‚³‚ê‚Ü‚·?B
#==============================================================================
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ?¡ Window_Base
#------------------------------------------------------------------------------
# ?@ƒQ?[ƒ€’†‚Ì‚·‚ׂẴEƒBƒ“ƒhƒE‚̃X?[ƒp?[ƒNƒ‰ƒX‚Å‚·?B
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ?œ HP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 50)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 50)
color4 = Color.new(64, 0, 0, 50)
color5 = Color.new(216 - 24 * rate, 0 * rate, 0 * rate, 192)
color6 = Color.new(255 * rate, 215 * rate, 0 * rate, 192)
if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_hp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?œ SP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹‚ÌSP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•Ï?X
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# •Ï?”rate‚É Œ»?Ý‚ÌSP/MSP‚ð‘ã“ü
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
# plus_x:X?À•W‚̈ʒu•â?³ rate_x:X?À•W‚̈ʒu•â?³(%) plus_y:Y?À•W‚̈ʒu•â?³
# plus_width:•?‚Ì•â?³ rate_width:•?‚Ì•â?³(%) height:?c•?
# align1:•`‰æƒ^ƒCƒv1 0:?¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß
# align2:•`‰æƒ^ƒCƒv2 0:?ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß
# align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l‚ß 1:‰E‹l‚ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf?[ƒVƒ‡ƒ“?Ý’è grade1:‹óƒQ?[ƒW grade2:ŽÀƒQ?[ƒW
# (0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 2:ŽÎ‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“(Œƒ?d)?j
grade1 = 1
grade2 = 0
# ?F?Ý’è?Bcolor1:ŠO˜g?Ccolor2:’†˜g
# color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
# color5:ŽÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:ŽÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
# •Ï?”sp‚É•`‰æ‚·‚éƒQ?[ƒW‚Ì•?‚ð‘ã“ü
if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end
# ƒQ?[ƒW‚Ì•`‰æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# ƒIƒŠƒWƒiƒ‹‚ÌSP•`‰æ?ˆ—?‚ðŒÄ‚Ñ?o‚µ
draw_actor_sp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?œ EXP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒŠƒWƒiƒ‹‚ÌEXP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•Ï?X
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
# •Ï?”rate‚É Œ»?Ý‚Ìexp/nextexp‚ð‘ã“ü
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf?[ƒVƒ‡ƒ“?Ý’è grade1:‹óƒQ?[ƒW grade2:ŽÀƒQ?[ƒW
# (0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 2:ŽÎ‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“(Œƒ?d)?j
grade1 = 1
grade2 = 0
# ?F?Ý’è?Bcolor1:ŠO˜g?Ccolor2:’†˜g
# color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
# color5:ŽÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:ŽÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
# •Ï?”exp‚É•`‰æ‚·‚éƒQ?[ƒW‚Ì•?‚ð‘ã“ü
if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end
# ƒQ?[ƒW‚Ì•`‰æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# ƒIƒŠƒWƒiƒ‹‚ÌEXP•`‰æ?ˆ—?‚ðŒÄ‚Ñ?o‚µ
draw_actor_exp_original(actor, x, y)
end
#--------------------------------------------------------------------------
# ?œ ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
# ˜g•`‰æ
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
# ‹óƒQ?[ƒW‚Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
# ŽÀƒQ?[ƒW‚Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
#------------------------------------------------------------------------------
# ?@BitmapƒNƒ‰ƒX‚É?V‚½‚È‹@”\‚ð’ljÁ‚µ‚Ü‚·?B
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# ?œ ‹éŒ`‚ðƒOƒ‰ƒf?[ƒVƒ‡ƒ“•\Ž¦
# color1 : ƒXƒ^?[ƒgƒJƒ‰?[
# color2 : ƒGƒ“ƒhƒJƒ‰?[
# align : 0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“
# 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“
# 2:ŽÎ‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“?iŒƒ?d‚ɂ‚«’?ˆÓ?j
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end
#==============================================================================
# ?¡ Spriteƒ‚ƒWƒ…?[ƒ‹
#------------------------------------------------------------------------------
# ?@ƒAƒjƒ??[ƒVƒ‡ƒ“‚ÌŠÇ—?‚ð?s‚¤ƒ‚ƒWƒ…?[ƒ‹‚Å‚·?B
#==============================================================================
module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end
Now replace Scene_Map with this script:
Content Hidden
Code:
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
# Transition run
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 sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
#--------------------------------------------------------------------------
# * If the L button(Q button) is pressed, the quick stats menu will appear.
#--------------------------------------------------------------------------
if Input.trigger?(Input::L)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.quickstats_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
#--------------------------------------------------------------------------
# * Makes the Quick Stats menu appear if the player is not moving
#--------------------------------------------------------------------------
elsif $game_temp.quickstats_calling
call_quickstats
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Quickstats Call
#--------------------------------------------------------------------------
def call_quickstats
# Clear menu call flag
$game_temp.quickstats_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Quickstatus.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
And Lastly, replace game_temp with this script:
Content Hidden
Code:
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
#==============================================================================
# ** Quick Stats Edit:
#------------------------------------------------------------------------------
# The line "attr_accessor :quickstats_calling" has been added on line 47.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :map_bgm # map music (for battle memory)
attr_accessor :message_text # message text
attr_accessor :message_proc # message callback (Proc)
attr_accessor :choice_start # show choices: opening line
attr_accessor :choice_max # show choices: number of items
attr_accessor :choice_cancel_type # show choices: cancel
attr_accessor :choice_proc # show choices: callback (Proc)
attr_accessor :num_input_start # input number: opening line
attr_accessor :num_input_variable_id # input number: variable ID
attr_accessor :num_input_digits_max # input number: digit amount
attr_accessor :message_window_showing # message window showing
attr_accessor :common_event_id # common event ID
attr_accessor :in_battle # in-battle flag
attr_accessor :battle_calling # battle calling flag
attr_accessor :battle_troop_id # battle troop ID
attr_accessor :battle_can_escape # battle flag: escape possible
attr_accessor :battle_can_lose # battle flag: losing possible
attr_accessor :battle_proc # battle callback (Proc)
attr_accessor :battle_turn # number of battle turns
attr_accessor :battle_event_flags # battle event flags: completed
attr_accessor :battle_abort # battle flag: interrupt
attr_accessor :battle_main_phase # battle flag: main phase
attr_accessor :battleback_name # battleback file name
attr_accessor :forcing_battler # battler being forced into action
attr_accessor :shop_calling # shop calling flag
attr_accessor :shop_goods # list of shop goods
attr_accessor :name_calling # name input: calling flag
attr_accessor :name_actor_id # name input: actor ID
attr_accessor :name_max_char # name input: max character count
attr_accessor :menu_calling # menu calling flag
attr_accessor :quickstats_calling # quickstats menu calling flag
attr_accessor :menu_beep # menu: play sound effect flag
attr_accessor :save_calling # save calling flag
attr_accessor :debug_calling # debug calling flag
attr_accessor :player_transferring # player place movement flag
attr_accessor :player_new_map_id # player destination: map ID
attr_accessor :player_new_x # player destination: x-coordinate
attr_accessor :player_new_y # player destination: y-coordinate
attr_accessor :player_new_direction # player destination: direction
attr_accessor :transition_processing # transition processing flag
attr_accessor :transition_name # transition file name
attr_accessor :gameover # game over flag
attr_accessor :to_title # return to title screen flag
attr_accessor :last_file_index # last save file no.
attr_accessor :debug_top_row # debug screen: for saving conditions
attr_accessor :debug_index # debug screen: for saving conditions
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@map_bgm = nil
@message_text = nil
@message_proc = nil
@choice_start = 99
@choice_max = 0
@choice_cancel_type = 0
@choice_proc = nil
@num_input_start = 99
@num_input_variable_id = 0
@num_input_digits_max = 0
@message_window_showing = false
@common_event_id = 0
@in_battle = false
@battle_calling = false
@battle_troop_id = 0
@battle_can_escape = false
@battle_can_lose = false
@battle_proc = nil
@battle_turn = 0
@battle_event_flags = {}
@battle_abort = false
@battle_main_phase = false
@battleback_name = ''
@forcing_battler = nil
@shop_calling = false
@shop_id = 0
@name_calling = false
@name_actor_id = 0
@name_max_char = 0
@menu_calling = false
@menu_beep = false
@save_calling = false
@debug_calling = false
@player_transferring = false
@player_new_map_id = 0
@player_new_x = 0
@player_new_y = 0
@player_new_direction = 0
@transition_processing = false
@transition_name = ""
@gameover = false
@to_title = false
@last_file_index = 0
@debug_top_row = 0
@debug_index = 0
end
end
Thats it. Please leave feedback on this one.