RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
i need some help with this script plz

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 88
hi again i need some help with this script, its a menu script but when i put it i cant save... could any1 fix it plz? if you guys remove the new save menu this creates and remove the "save" option from the base menu (stats skill one) would be nice in future thx
idahlo

[code]=============================================================================
# ** Tale of Symphonia Menu_Compilations
#------------------------------------------------------------------------------
# By: Vash (of hbgames.org/Creation Asylum)
# Released on: Dec. 27, 2005
# Last Updates: Jan. 4, 2006, March 2, 2006, April 14, 2006, Augest 26, 2006,
# Augest 28, 2006, Augest 29, 2006, Augest 30, 2006, Augest 31, 2006,
# September 1, 2006
# Recent Updates: September 3, 2006
# Version: 2.4.3
#------------------------------------------------------------------------------
# Credits Goes To:
# + Selwyn/Squall's Cursor Script
# + RPG Advocate's Changing Party Order
# + AcedentProne's Shadow Text & Save/Load Windows +(modified)+.
# + Trickster help with limiting the party in battle.
# + SephirothSpawn Battle Count Mod
# + My (Vash) Death Switch Script
#==============================================================================

#==============================================================================
# ** Customize Tale of Symphonia Menu
#==============================================================================
 module Vash_ToS
  TOS_MENU_ENABLED = true # Enable or disable this entire script.
  TOS_SAVE_ENABLED = true # Enable or disable save window remodel.
  TOS_STATUS_ENABLED = true # Enable or disable status window remodel.
  ICON = true # True if want icon in command window, false if not.
  ICON_NAME = 'icons' # Name of icon images.
  FONT_SHADOW = true # True if shaow on text wanted, false if not.
  FONT_BOLD = true # Main menu command text bolded.
  CURSOR_N = 'cursor' # Name of curor image.
  CURSOR_X = -12 # x position of cursor.
  CURSOR_Y = 16 # y position of cursor.
  WINOW_OPACITY = 200  # Opacity of CMS' windows.
  WIN_SKIN = '001-Blue01' # Windowskin for windows not using cursor - save window.
  WIN_SKINS = '001-Blue02' # Windowskin for windows using cursor.
  PARTY_SIZE = 4 # Number of members in party.
  PARTY_BATTLE = 4 # Number of members in party during battle.
 end
#--------------------------------------------------------------------------
# * If scripts enabled or disabled
#--------------------------------------------------------------------------
  if Vash_ToS::TOS_MENU_ENABLED
   
begin
  Font.default_name = 'Book Antiqua' # Font of game.
  Font.default_size = 22 # Font size of game.
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

class Window_Base < Window
alias vash_tos_initialize initialize
def initialize(x, y, width, height)
vash_tos_initialize(x, y, width, height)
if $scene.is_a?(Scene_Item) or 
$scene.is_a?(Scene_Skill) or   
$scene.is_a?(Scene_Equip) or 
$scene.is_a?(Scene_Status) or   
$scene.is_a?(Scene_End)
self.back_opacity = Vash_ToS::WINOW_OPACITY
end
end

def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_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

def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.hp / actor.maxhp
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end

def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.sp / actor.maxsp
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end

def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
self.contents.fill_rect(x, y, width, width, start_color)
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end

def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, 32, 'Lv.')
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end

def draw_actor_parameter(actor, x, y, type)
case type
when 0
 parameter_name = $data_system.words.atk
 parameter_value = actor.atk
when 1
 parameter_name = $data_system.words.pdef
 parameter_value = actor.pdef
when 2
 parameter_name = $data_system.words.mdef
 parameter_value = actor.mdef
when 3
 parameter_name = $data_system.words.str
 parameter_value = actor.str
when 4
 parameter_name = $data_system.words.dex
 parameter_value = actor.dex
when 5
 parameter_name = $data_system.words.agi
 parameter_value = actor.agi
when 6
 parameter_name = $data_system.words.int
 parameter_value = actor.int
when 7
 parameter_name = 'Evasion'
 parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end

end
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Shadow Text
#==============================================================================

#------------------------------------------------------------------------------
# If Shadow font is wanted
#------------------------------------------------------------------------------
if Vash_ToS::FONT_SHADOW
#------------------------------------------------------------------------------
class Bitmap
if not method_defined?('original_draw_text')
alias vash_tos_original_draw_text draw_text
def draw_text(*arg)
original_color = self.font.color.dup
self.font.color = Color.new(0, 0, 0, 128)
if arg[0].is_a?(Rect)
arg[0].x += 2
arg[0].y += 2
self.vash_tos_original_draw_text(*arg)
arg[0].x -= 2
arg[0].y -= 2
else
arg[0] += 2
arg[1] += 2
self.vash_tos_original_draw_text(*arg)
arg[0] -= 2
arg[1] -= 2
end
self.font.color = original_color
self.vash_tos_original_draw_text(*arg)
end
end
end
#------------------------------------------------------------------------------
# End of if
#------------------------------------------------------------------------------
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

class Sprite_Cursor < Sprite
#--------------------------------------------------------------------------
# * instances
#--------------------------------------------------------------------------
attr_accessor :true_x
attr_accessor :true_y
#--------------------------------------------------------------------------
# * initialize
#--------------------------------------------------------------------------
def initialize(x = 0, y = 0)
super()
self.x = @true_x = x
self.y = @true_y = y
self.z = 10000
self.bitmap = RPG::Cache.windowskin(Vash_ToS::CURSOR_N) rescue Bitmap.new(32, 32)
end
#--------------------------------------------------------------------------
# * update
#--------------------------------------------------------------------------
def update
super

if self.y < @true_y
n = (@true_y - self.y) / 3
n = 1 if n == 0
self.y += n
elsif self.y > @true_y
n = (self.y - @true_y) / 3
n = 1 if n == 0
self.y -= n
end

if self.x < @true_x
n = (@true_x - self.x) / 3
n = 1 if n == 0
self.x += n
elsif self.x > @true_x
n = (self.x - @true_x) / 3
n = 1 if n == 0
self.x -= n
end
end
end

class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# * instances
#--------------------------------------------------------------------------
attr_reader   :index
attr_reader   :help_window
attr_accessor :cursor
alias update_cursor_moves update
#--------------------------------------------------------------------------
# * initialize
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
@cursor = Sprite_Cursor.new(x, y)
update_cursor
end
#--------------------------------------------------------------------------
# * x=
#--------------------------------------------------------------------------
def x=(x)
super
@cursor.x = x if !@cursor.nil?
end
#--------------------------------------------------------------------------
# * y=
#--------------------------------------------------------------------------
def y=(y)
super
@cursor.y = y if !@cursor.nil?
end
#--------------------------------------------------------------------------
# * visible=
#--------------------------------------------------------------------------
def visible=(visible)
super
if !@cursor.nil? and visible == false
@cursor.visible = false
end
end
#--------------------------------------------------------------------------
# * dispose
#--------------------------------------------------------------------------
def dispose
@cursor.dispose
super
end
#--------------------------------------------------------------------------
# * update_cursor_rect
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * update_cursor
#--------------------------------------------------------------------------
def update_cursor
# Play around with numbers depending on the curor you have
@cursor.true_x = self.cursor_rect.x + self.x + Vash_ToS::CURSOR_X
@cursor.true_y = self.cursor_rect.y + self.y + Vash_ToS::CURSOR_Y
@cursor.update
@cursor.visible = (self.visible and self.index >= 0)
end
#--------------------------------------------------------------------------
# * update
#--------------------------------------------------------------------------
def update
update_cursor_moves
update_cursor
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Finds Map Name
#--------------------------------------------------------------------------
def name
load_data('Data/MapInfos.rxdata')[@map_id].name
end 
end

##++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Death Switch
#==============================================================================
class Game_Player < Game_Character
 alias vash_tos_switch_refresh refresh
  def refresh
   vash_tos_switch_refresh
#------------------------------------------------------------------------------
# If lead character is dead
#------------------------------------------------------------------------------
  for actor in $game_party.actors
   lead = actor unless actor.hp == 0   
   break unless lead.nil?
 end
#------------------------------------------------------------------------------
    @character_name = lead.character_name
    @character_hue = lead.character_hue
    @opacity = 255
    @blend_type = 0
  end
end

class Game_Player < Game_Character
 alias vash_tos_switch_update update
  def update
   vash_tos_switch_update
#------------------------------------------------------------------------------
# If lead character is dead
#------------------------------------------------------------------------------
for actor in $game_party.actors
   lead = actor unless actor.hp == 0
   break unless lead.nil?
end
#------------------------------------------------------------------------------
# If all characters are dead
#------------------------------------------------------------------------------
  if $game_party.all_dead? or $game_party.actors.size == 0
    $scene = Scene_Gameover.new
      return
    end
   $game_temp.gameover unless !lead.nil?
   @character_name = lead.character_name
   @character_hue = lead.character_hue
 end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

class Game_Party
attr_accessor :battle_count
alias vash_tos_battlecount_init initialize
def initialize
#--------------------------------------------------------------------------
# * battle counter
#--------------------------------------------------------------------------
vash_tos_battlecount_init
@battle_count = 0
end
def add_actor(actor_id)
actor = $game_actors[actor_id]
if @actors.size < Vash_ToS::PARTY_SIZE and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
end
end
end

class Scene_Battle
#--------------------------------------------------------------------------
# * battle counter
#--------------------------------------------------------------------------
alias vash_tos_battlecount_main main
def main
$game_party.battle_count += 1
vash_tos_battlecount_main
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This puts a limit on how many characters can enter battle.
#==============================================================================
class Scene_Battle
alias vash_tos_remove_main main
def main
@saved_actors = []
if $game_party.actors.size > Vash_ToS::PARTY_BATTLE
for i in ToS::PARTY_BATTLE...$game_party.actors.size
@saved_actors << $game_party.actors.id
$game_party.remove_actor($game_party.actors.id)
end
end
vash_tos_remove_main
end

alias vash_tos_add_battle_end battle_end
def battle_end(result)
for actor_id in @saved_actors
$game_party.add_actor(actor_id)
end
vash_tos_add_battle_end(result)
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Window_NewCommand
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_MenuCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#     width    : window width
#     commands : command text string array
#--------------------------------------------------------------------------
def initialize(width, commands, icon = nil)
# Compute window height from command quantity
col_max = 5
super(0, 0, width, (commands.size / col_max + 2) * 21.5 + 32)
@item_max = commands.size
@commands = commands
@column_max = col_max
@icon = icon
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.index = 0
end

#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
#     index : item number
#     color : text color
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
self.contents.font.bold = Vash_ToS::FONT_BOLD
rect = Rect.new((index % @column_max) * ((width - 32) / @column_max),
index / @column_max * 32, (width - 32) / @column_max, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
unless @icon == nil
bitmap = RPG::Cache.icon(@icon + index.to_s)
rect = Rect.new((index % @column_max) * ((width - 32) / @column_max),
index / @column_max * 32, (width - 32) / @column_max, 32)
self.contents.blt((index % @column_max) * ((width - 32) / @column_max),
index / @column_max * 32, bitmap, Rect.new(0, 0, 24, 24))
end     
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
# * Disable Item
#     index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# * Update Cursor Position
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = (self.width - 55) / @column_max
x = @index % @column_max * (cursor_width + 3)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, 32, 32)
end
end


#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Window_Info
#------------------------------------------------------------------------------
#  This window displays game information.
#==============================================================================
class Window_Info < Window_Base
def initialize
super(0, 0, 170, 360)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
cx = contents.text_size($data_system.words.gold).width
self.contents.draw_text(1, -7, 120, 32, 'Play Time')
self.contents.draw_text(1, 30, 120, 32, 'Steps')
self.contents.draw_text(2, 64, 120, 32, 'Encounters')
self.contents.draw_text(2, 97, 120, 32, 'Location')
self.contents.draw_text(124-cx, 220, cx, 25, $data_system.words.gold, 2)
@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(4, 10, 120, 32, text, 2)
self.contents.draw_text(3.5, 45, 120, 32, $game_party.steps.to_s, 2)
self.contents.draw_text(3, 82, 120, 32, $game_party.battle_count.to_s, 2)
self.contents.draw_text(- 2, 117, 124, 32, $game_map.name.to_s, 2)
self.contents.draw_text(4, 216, 122.5-cx-6, 32, $game_party.gold.to_s, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 455, 360)
self.contents = Bitmap.new(width - 32, $game_party.actors.size * 116 - 16)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 85
actor = $game_party.actors
draw_actor_face(actor, x - 70, y - 0 )
draw_actor_name(actor, x + 5, y - 8)
draw_actor_class(actor, x + 5, y + 18)
draw_actor_level(actor, x + 5, y + 45)
draw_actor_state(actor, x + 95, y + 45)
draw_actor_hp_meter_line(actor, x + 223, y + 9, 116, 8)
draw_actor_sp_meter_line(actor, x + 223, y + 37, 116, 8)
draw_actor_hp(actor, x + 195, y + - 8)
draw_actor_sp(actor, x + 195, y + 20)
self.contents.font.color = system_color
self.contents.draw_text(x + 195, y + 45, 84, 32, 'Next')
self.contents.font.color = normal_color
self.contents.draw_text(x + 310, y + 45, 84, 32, actor.next_exp_s)
end
end
#--------------------------------------------------------------------------
def top_row
return self.oy / 85
end
#--------------------------------------------------------------------------
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 85
end
#--------------------------------------------------------------------------
# * Update Cursor Position
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 85 - self.oy
self.cursor_rect.set(x, y, cursor_width, 96)
end
#--------------------------------------------------------------------------
def page_row_max
return 4
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#==============================================================================
# ** Scene_Menu
#==============================================================================

class Scene_Menu
def initialize(menu_index = 0)
$game_system.windowskin_name = Vash_ToS::WIN_SKINS
@menu_index = menu_index
@changer = 0
@where = 0
@checker = 0
end
 def main
  if Vash_ToS::ICON
   s1 = '      ' + $data_system.words.item
   s2 = '      ' + $data_system.words.skill
   s3 = '      ' + $data_system.words.equip
   s4 = '      ' + 'Status'
   s5 = '      ' + 'Party'
   s6 = '      ' + 'Save'
   s7 = '      ' + 'Exit'
 else
   s1 = ' ' + $data_system.words.item
   s2 = ' ' + $data_system.words.skill
   s3 = ' ' + $data_system.words.equip
   s4 = ' ' + 'Status'
   s5 = ' ' + 'Party'
   s6 = ' ' + 'Save'
   s7 = ' ' + 'Exit'
 end
@command_window = Window_MenuCommand.new(626, [s1, s2, s3, s4, s5, s6, s7])
@command_window = Window_MenuCommand.new(626, [s1, s2, s3, s4, s5, s6, s7], Vash_ToS::ICON_NAME)if Vash_ToS::ICON
@command_window.index = @menu_index
@command_window.x = 7
@command_window.y = -96
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(5)
end
@info_window = Window_Info.new
@info_window.x = 913
@info_window.y = 109
@status_window = Window_MenuStatus.new
@status_window.x = -413
@status_window.y = 109

@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
@windows = [@command_window, @status_window, @info_window]
@windows.each {|i| i.opacity = Vash_ToS::WINOW_OPACITY}

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@background.dispose
@windows.each {|i| i.dispose}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
animate
@windows.each {|i| i.update}

if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Animating windows.
#--------------------------------------------------------------------------
def animate
if @command_window.active
@command_window.y += 6 if @command_window.y < 10
@status_window.x += 30 if @status_window.x < 0
@info_window.x -= 30 if @info_window.x > 465
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
@command_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0 # Item
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1 # Skill
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # Equip
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # Status
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # Party Changer
$game_system.se_play($data_system.decision_se)
@checker = 0
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5 # Save
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6 # End
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
when 4
$game_system.se_play($data_system.decision_se)
if @checker == 0
@changer = $game_party.actors[@status_window.index]
@where = @status_window.index
@checker = 1
else
$game_party.actors[@where] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @changer
@checker = 0
@status_window.refresh
end
end
return
end
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

class Scene_Item
alias vash_tos_main main
def main
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@spriteset.dispose
@background.dispose
end
end

class Scene_Skill
alias vash_tos_main main
def main
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@spriteset.dispose
@background.dispose
end
end

class Scene_Equip
alias vash_tos_main main
def main
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@spriteset.dispose
@background.dispose
end
end
 
class Scene_End
alias vash_tos_main main
def main
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@spriteset.dispose
@background.dispose
end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#--------------------------------------------------------------------------
# * If status window remodel enabled or disabled
#--------------------------------------------------------------------------
  if Vash_ToS::TOS_STATUS_ENABLED

#==============================================================================
# ** Window_Status
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
 def initialize(actor)
   super(-378, 13, 385, 456)
   self.contents = Bitmap.new(width - 32, height - 32)
   @actor = actor
   refresh
 end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   self.contents.font.size = 21
   draw_actor_name(@actor, -1, 0)
   draw_actor_class(@actor, 0, 23)
   draw_actor_level(@actor, 0, 45)
   draw_actor_state(@actor, 100, 45)
   draw_actor_hp_meter_line(@actor, 36, 83, 116, 8)
   draw_actor_hp(@actor, 0, 65, 152)
   draw_actor_sp_meter_line(@actor, 36, 108, 116, 8)
   draw_actor_sp(@actor, 0, 90, 152)
   self.contents.font.color = normal_color
   self.contents.draw_text(70, 120, 84, 32, @actor.exp_s, 2)
   self.contents.draw_text(70, 140, 84, 32, @actor.next_rest_exp_s, 2)
   draw_actor_parameter(@actor, 0, 170, 0)
   draw_actor_parameter(@actor, 0, 195, 1)
   draw_actor_parameter(@actor, 0, 220, 2)
   draw_actor_parameter(@actor, 186, 120, 3)
   draw_actor_parameter(@actor, 186, 140, 4)
   draw_actor_parameter(@actor, 186, 170, 5)
   draw_actor_parameter(@actor, 186, 195, 6)
   draw_actor_parameter(@actor, 186, 220, 7)
   self.contents.font.color = system_color
   self.contents.draw_text(0, 120, 80, 32, 'EXP')
   self.contents.draw_text(0, 140, 80, 32, 'NEXT')
   self.contents.draw_text(100, 250, 96, 32, 'Equipment')
   self.contents.draw_text(0, 278, 96, 32, 'Weapon')
   self.contents.draw_text(0, 306, 96, 32, 'Shield')
   self.contents.draw_text(0, 334, 96, 32, 'Helmet')
   self.contents.draw_text(0, 362, 96, 32, 'Armor')
   self.contents.draw_text(0, 390, 96, 32, 'Accessory')
   equip = $data_weapons[@actor.weapon_id]
   if  @actor.equippable?(equip)
     draw_item_name($data_weapons[@actor.weapon_id], 166, 278)
   else
     self.contents.font.color = knockout_color
     self.contents.draw_text(166, 278, 192, 32, 'Nothing equipped')
   end
   equip1 = $data_armors[@actor.armor1_id]
     if  @actor.equippable?(equip1)
     draw_item_name($data_armors[@actor.armor1_id], 166, 306)
   else
     self.contents.font.color = crisis_color
     self.contents.draw_text(166, 306, 192, 32, 'Nothing equipped')
   end
   equip2 = $data_armors[@actor.armor2_id]
     if  @actor.equippable?(equip2)
     draw_item_name($data_armors[@actor.armor2_id], 166, 334)
   else
     self.contents.font.color = crisis_color
     self.contents.draw_text(166, 334, 192, 32, 'Nothing equipped')
   end
   equip3 = $data_armors[@actor.armor3_id]
     if  @actor.equippable?(equip3)
     draw_item_name($data_armors[@actor.armor3_id], 166, 362)
   else
     self.contents.font.color = crisis_color
     self.contents.draw_text(166, 362, 192, 32, 'Nothing equipped')
   end
   equip4 = $data_armors[@actor.armor4_id]
     if  @actor.equippable?(equip4)
     draw_item_name($data_armors[@actor.armor4_id], 166, 390)
   else
     self.contents.font.color = crisis_color
     self.contents.draw_text(166, 390, 192, 32, 'Nothing equipped')
    end   
  end
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

class Scene_Status 
alias vash_tos_main main
def main
@actor = $game_party.actors[@actor_index]
@battler_window = Window_Battler.new(@actor)
@statustop_window = Window_Statustop.new(@actor)
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@battler_window.dispose
@statustop_window.dispose
@spriteset.dispose
@background.dispose
end
end

class Scene_Status 
alias vash_tos_update update
  def update
    vash_tos_update
   if @status_window.x < 0
     @status_window.x += 16
   end
   if @battler_window.x > 300
     @battler_window.x -= 16
   end
   if @statustop_window.y < 0
     @statustop_window.y += 7
   end
 end
end

#????????????????????????

class Window_Battler < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
 def initialize(actor)
   super(678, 13, 350, 456)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   @actor = actor
   refresh
 end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   draw_actor_battler(@actor, 190, 400)
  end
end

class Window_Battler < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
 def initialize(actor)
   super(678, 13, 350, 456)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   @actor = actor
   refresh
 end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   draw_actor_battler(@actor, 190, 400)
  end
end

class Window_Statustop < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
 def initialize(actor)
   super(0, -200, 640, 100)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   @actor = actor
   refresh
 end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.contents.font.size = 30
  self.contents.draw_text(280, 0, 192, 32, 'Status')
  draw_actor_graphic(@actor, 200, 60)
  end
end

#--------------------------------------------------------------------------
# * If no status window remodel
#--------------------------------------------------------------------------
 else

#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
#  This class performs status screen processing.
#==============================================================================

class Scene_Status 
alias vash_tos_main main
def main
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
vash_tos_main
@spriteset.dispose
@background.dispose
end
end
   
#--------------------------------------------------------------------------
# * End of if status window remodel enabled or disabled
#--------------------------------------------------------------------------
end

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#--------------------------------------------------------------------------
# * If save window remodel enabled or disabled
#--------------------------------------------------------------------------
  if Vash_ToS::TOS_SAVE_ENABLED

#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
#  This window displays save files on the save and load screens.
#==============================================================================

class Window_SaveFile < Window_Base
  attr_reader   :filename           
  attr_reader   :selected   
 
  def initialize(file_index, filename)
    $game_system.windowskin_name = Vash_ToS::WIN_SKIN
    super(0, 64 + file_index % 4 * 104, 160, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.sav"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "Entry #{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(20, 40, 600, 32, time_string)
    end
  end
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, 32)
    else
      self.cursor_rect.empty
    end
  end
end
class Window_SaveFile2 < Window_Base
  attr_reader   :filename                 
  attr_reader   :selected                 
  def initialize(file_index, filename)
    super(160, 64, 480, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.sav"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @game_self_switches = Marshal.load(file)
      @game_screen = Marshal.load(file)
      @game_actors = Marshal.load(file)
      @game_party = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
  end
  def refresh
    self.contents.clear
    count = 0
    if @file_exist
      for i in 0...@game_party.actors.size
        x = 64 + 222 * count
        y = ( i  - count ) * 76
        actor = @game_party.actors
        draw_actor_graphic(actor, x - 24, y + 120)
        draw_actor_name(actor, x, y)
        draw_actor_level(actor, x, y + 32)
        draw_actor_hp_meter_line(actor, x + 30, y + 81, 116, 8)
        draw_actor_hp(actor, x, y + 64)
        draw_actor_sp_meter_line(actor, x + 30, y + 113, 116, 8)
        draw_actor_sp(actor, x, y + 96)
        if count == 1
          count = 0
        else
          count += 1
        end
      end
    end
  end
end

class Window_SaveFile3 < Window_Base
  attr_reader   :filename               
  attr_reader   :selected                 
  def initialize(file_index, filename)
    super(160, 384, 480, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.sav"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @game_self_switches = Marshal.load(file)
      @game_screen = Marshal.load(file)
      @game_actors = Marshal.load(file)
      @game_party = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
  end
  def refresh
    self.contents.clear
     if @file_exist
      file = File.open(filename, "r")
      Marshal.load(file)
      frame_count = Marshal.load(file)
      for i in 0...6
        Marshal.load(file)
      end
      party = Marshal.load(file)
      Marshal.load(file)
      map = Marshal.load(file)
           end
    count = 0
    if @file_exist
      self.contents.font.color = system_color
      self.contents.draw_text(234, 32, 480, 32, 'Gold')
      self.contents.draw_text(234, 0, 480, 32, 'Steps')
      self.contents.draw_text(4, 0, 480, 32, 'Location')
      self.contents.font.color = normal_color
      cx = contents.text_size(@game_party.gold.to_s).width
      self.contents.draw_text(446 - cx, 32, cx, 32, @game_party.gold.to_s, 2)
      cx = contents.text_size(@game_party.steps.to_s).width
      self.contents.draw_text(446 - cx, 0, cx, 32, @game_party.steps.to_s, 2)
      map_name = load_data('Data/MapInfos.rxdata')[map.map_id].name
      self.contents.draw_text(6, 30, 144, 32, map_name)
    end
  end
end

#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# ?This class handles the aspects of the file selection process that are
#   unique to loading a game in the Load Game menu.
#==============================================================================

class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Checks to see which files exist and initializes the Load Game menu
#--------------------------------------------------------------------------
  def initialize
    $game_temp = Game_Temp.new
    $game_temp.last_file_index = 0
    latest_time = Time.at(0)
    for i in 0..3
      filename = make_filename(i)
      if FileTest.exist?(filename)
        file = File.open(filename, "r")
        if file.mtime > latest_time
          latest_time = file.mtime
          $game_temp.last_file_index = i
        end
        file.close
      end
    end
    super('Which file do you wish to load from?')
  end
#--------------------------------------------------------------------------
# * Process decisions made by the player in this menu
#--------------------------------------------------------------------------
  def on_decision(filename)
    unless FileTest.exist?(filename)
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.load_se)
    file = File.open(filename, "rb")
    read_save_data(file)
    file.close
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    $game_map.update
    $scene = Scene_Map.new
  end
#--------------------------------------------------------------------------
# * Process to complete when the Cancel key is pressed
#--------------------------------------------------------------------------
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    $scene = Scene_Title.new
  end
#--------------------------------------------------------------------------
# * Reconstitute the serialized objects that were saved
#     file : the file
#--------------------------------------------------------------------------
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    if $game_system.magic_number != $data_system.magic_number
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
  end
end

#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================

class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
 alias vash_tos_save_on_decision on_decision
  def on_decision(filename)
   vash_tos_save_on_decision(filename)
    $scene = Scene_Menu.new(5)
  end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
 alias vash_tos_save_on_cancel on_cancel
  def on_cancel
   vash_tos_save_on_cancel
    $scene = Scene_Menu.new(5)
  end
end

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This is a superclass for the save screen and load screen.
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     help_text : text string shown in the help window
  #--------------------------------------------------------------------------
  def initialize(help_text)
    @help_text = help_text
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @file_index = $game_temp.last_file_index
    @now_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    @save_window = Window_SaveFile2.new(@file_index,make_filename(@file_index))
    @save_window2 = Window_SaveFile3.new(@file_index,make_filename(@file_index))

    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @save_window.dispose
    @save_window2.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
     if @now_index != @file_index
      @now_index = @file_index
      @save_window.dispose
      @save_window = Window_SaveFile2.new(@file_index, make_filename(@file_index))
      @save_window2.dispose
      @save_window2 = Window_SaveFile3.new(@file_index, make_filename(@file_index))
    end

    @help_window.update
    for i in @savefile_windows
      i.update
    end
    # Decision is made
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    # Cancel key is pressed
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    # Down key is pressed
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 3
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    # Up key is pressed
    if Input.repeat?
« Last Edit: October 31, 2006, 01:58:37 PM by idahlo »