- Joined
- Dec 5, 2015
- Messages
- 4
- Reaction score
- 0
- First Language
- English
- Primarily Uses
I am currently using a specific script for my save layout in RPG Maker VX and it's written in Japanese:
^ This screenshot is similar to how my save layout looks like.
And this game I am working on, you can only have a maximum of two people in your party. So I want to be able for the save to only show the Hero and their Ally. (I removed unnecessary fluff like their stats from the save layout, as I only want to show is their names and their HP.) However, I can only show the Hero's and not their Ally's.
Here is the script I am using:
=begin #=======================================================================
★ セーブレイアウト カスタム版
セーブレイアウト変更、背景を設定したり、表示するステータスを変更できます
※これを導入する前にセーブしたデータがある場合 地名は表示されません
一度セーブすることで、正常に表示されます
=end #=========================================================================
#==============================================================================
# ■ Ziifee Date
#==============================================================================
module ZiiDate
# ▼ 基本項目
MAX = 20 # 最大セーブデータの数
OPAC = 1 # ウィンドウ背景 ( 0:通常 , 1:枠のみ , 2:なし )
# ▼ ピクチャ画像の名前 ( "" で未使用、画像は Graphics/Pictures に)
PICT = "" # 背景用ピクチャ
PCUR = "" # カーソル画像 (推奨 304×26px)
# ▼ 名称
FILE = "File %s" # ファイル
NEW = "New" # 新規ファイル
MAKE = "Create a New File" # 新規作成
NO = "" # 数えない時
EMPTY = "No Saves Available" # ファイルなし
# ▼ 色
COLOR = Color.new(0, 0, 0) # 基本色
BACK = Color.new(0, 0, 128, 64) # コマンド背景色
TEXT = Color.new(0, 208, 0) # テキスト文字色
TIME = Color.new(255, 255, 255) # 時間文字色
MAPC = Color.new(16, 16, 16, 128) # マップ背景の合成色
CURSOL = Color.new(196, 224, 255, 196) # カーソル
# ▼ ステータス表示 ( true : 表示 / false : 非表示 )
BATTER = true # バトラー (拡張用)
FACE = true # 顔グラフィック
FACE_H = 100 # 顔グラフィックの高さ
NAME = true # 名前
CLASS = true # クラス
LV = false # Level
STATE = true # ステート
HP = true # HP
MP = false # MP
EQUIP = false # システム文字 装備
EQ1 = false # 武器
EQ2 = false # 盾
EQ3 = false # 頭
EQ4 = false # 身体
EQ5 = false # 装飾品
STATUS = false # システム文字 ステータス
ATK = false # 攻撃力
DEF = false # 防御力
SPI = false # 精神力
AGI = false # 敏捷性
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# ● メニュー画面系の背景作成
#--------------------------------------------------------------------------
def create_menu_background
@menuback_sprite = Sprite.new
if ZiiDate:
ICT != ""
@menuback_sprite.bitmap = Cache.picture(ZiiDate:
ICT)
else
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color = ZiiDate::MAPC
end
update_menu_background
end
#--------------------------------------------------------------------------
# ● 開始処理 改造
#--------------------------------------------------------------------------
def start
super
create_menu_background
@help_window = Window_LineHelp.new
create_savefile_windows
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
end
@savefile_windows[@index].selected = true
for window in @savefile_windows do window.update end
@info_window = Window_DateInfo.new(@savefile_windows[@index])
create_cursol
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
@info_window.dispose
dispose_menu_background
@help_window.dispose
dispose_item_windows
@cursol.bitmap.dispose
@cursol.dispose
@viewport.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新 改
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
update_savefile_windows
update_savefile_selection
@info_window.manage = @savefile_windows[@index]
@info_window.update
set_cursol_y
@cursol.update
end
#--------------------------------------------------------------------------
# ● セーブファイルウィンドウの作成 改造
#--------------------------------------------------------------------------
def create_savefile_windows
@viewport = Viewport.new(0, 55, 544, 356)
@viewport.z = 100
@savefile_windows = []
for i in 0...ZiiDate::MAX
break if not FileTest.exist?(make_filename(i))
@savefile_windows.push(Manage_DateFile.new(i, make_filename(i), @viewport))
end
@item_max = @savefile_windows.size
plus_new_savefile
end
#--------------------------------------------------------------------------
# ● セーブファイルウィンドウの追加
#--------------------------------------------------------------------------
def plus_new_savefile
return if @savefile_windows.size != 0 and not @saving
return if @savefile_windows.size == ZiiDate::MAX
i = @savefile_windows.size
@savefile_windows.push(Manage_DateFile.new(i, make_filename(i), @viewport))
@savefile_windows.nothing = true if not @saving
@item_max = @savefile_windows.size
end
#--------------------------------------------------------------------------
# ● カーソルの作成
#--------------------------------------------------------------------------
def create_cursol
@cursol = Sprite_Cursol.new(@viewport)
@cursol.x = 12
@cursol.z = 90
set_cursol_y
end
#--------------------------------------------------------------------------
# ● カーソルの高さ調節
#--------------------------------------------------------------------------
def set_cursol_y
unless @savefile_windows[@index].nil?
y = @savefile_windows[@index].date_list.y - 1
if y > 305
for window in @savefile_windows
window.date_list.y -= 5
end
elsif y < 4
for window in @savefile_windows
window.date_list.y += 5
end
end
@cursol.y = @savefile_windows[@index].date_list.y - 1
end
end
end
#==============================================================================
# ■ Window_DateInfo
#------------------------------------------------------------------------------
# データの詳細を表示するウィンドウです。
#==============================================================================
class Window_DateInfo < Window_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :manage # データ管理クラス
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# manage : 表示するデータの管理クラス
#--------------------------------------------------------------------------
def initialize(manage = nil)
super(316, 56, 212, 344)
case ZiiDate:
PAC
when 0;
when 1; self.back_opacity = 0
when 2; self.opacity = 0
end
@manage = manage
@old = manage
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
return if @manage == nil
return if not @manage.file_exist
return if (id = @manage.party.actors[0]) == nil
return if (actor = @manage.actors[id]) == nil
w , h = contents.width , contents.height
set_y = 0 # 設置用 Y座標計算
# グラフィック *********************************************
draw_actor_battler(actor, w / 2, h) if ZiiDate::BATTER
if ZiiDate::FACE
draw_actor_face(actor, w / 2 - 48, set_y)
set_y += ZiiDate::FACE_H
end
# 基本能力 *************************************************
draw_actor_name(actor, 0, set_y) if ZiiDate::NAME
draw_actor_level(actor, w - 56, set_y) if ZiiDate::LV
set_y += WLH if ZiiDate::NAME or ZiiDate::LV
draw_actor_state(actor, w - 56, set_y) if ZiiDate::STATE
if ZiiDate::CLASS
draw_actor_class(actor, 0, set_y)
set_y += WLH
end
if ZiiDate::HP
draw_actor_hp(actor, 0, set_y)
set_y += WLH
end
if ZiiDate::MP
draw_actor_mp(actor, 0, set_y)
set_y += WLH
end
# 装備 *****************************************************
if ZiiDate::EQUIP
self.contents.font.color = system_color
self.contents.draw_text(0, set_y, w, WLH, Vocab::equip)
set_y += WLH
end
if ZiiDate::EQ1
draw_item_name(actor.equips[0], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ2
draw_item_name(actor.equips[1], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ3
draw_item_name(actor.equips[2], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ4
draw_item_name(actor.equips[3], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ5
draw_item_name(actor.equips[4], 12, set_y)
set_y += WLH
end
# ステータス ***********************************************
if ZiiDate::STATUS
self.contents.font.color = system_color
self.contents.draw_text(0, set_y, w, WLH, Vocab::status)
set_y += WLH
end
if ZiiDate::ATK
draw_actor_parameter(actor, 12, set_y, 0)
set_y += WLH
end
if ZiiDate:
EF
draw_actor_parameter(actor, 12, set_y, 1)
set_y += WLH
end
if ZiiDate::SPI
draw_actor_parameter(actor, 12, set_y, 2)
set_y += WLH
end
if ZiiDate::AGI
draw_actor_parameter(actor, 12, set_y, 3)
set_y += WLH
end
end
#--------------------------------------------------------------------------
# ● アクターのバトラーグラフィックの描画
# actor : アクター
# center_x : 描画先 X座標 ( X座標は 中心の位置)
# under_y : 描画先 X座標 ( Y座標は 底辺の位置)
#--------------------------------------------------------------------------
def draw_actor_battler(actor, center_x, under_y)
draw_battler(actor.battler_name, actor.battler_hue, center_x, under_y)
end
#--------------------------------------------------------------------------
# ● バトラーグラフィックの描画
# battler_name : 顔グラフィック ファイル名
# battler_hue : 顔グラフィック インデックス
# center_x : 描画先 X座標 ( X座標は 中心の位置)
# under_y : 描画先 X座標 ( Y座標は 底辺の位置)
#--------------------------------------------------------------------------
def draw_battler(battler_name, battler_hue, center_x, under_y)
bitmap = Cache.battler(battler_name, battler_hue)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
x , y = center_x - bitmap.width / 2 , under_y - bitmap.height
self.contents.blt(x, y, bitmap, rect)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
if @manage != @old
@old = @manage
refresh
end
super
end
end
# データ取得用
class Game_Party
def actors
return @actors
end
end
#==============================================================================
# ■ Manage_DateFile
#------------------------------------------------------------------------------
# 読み込んだファイルデータを管理するクラスです。
#==============================================================================
class Manage_DateFile
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :file_index # ファイルインデックス
attr_reader :filename # ファイル名
attr_reader :file_exist # ファイル存在フラグ
attr_reader :time_stamp # タイムスタンプ
attr_accessor :selected # 選択状態
attr_reader :total_sec # データ プレイ時間
attr_reader :system # データ システム
attr_reader :variables # データ 変数
attr_reader :actors # データ アクター
attr_reader
arty # データ パーティ
attr_reader :date_list # 表示ウィンドウ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(file_index, filename, viewport)
@viewport = viewport
@file_index = file_index
@filename = filename
@selected = false
@nothing = false
load_gamedata
create_list
refresh
end
#--------------------------------------------------------------------------
# ● ゲームデータをロード
#--------------------------------------------------------------------------
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
begin
dummy = Marshal.load(file) # character
frame_count = Marshal.load(file) # frame_count
dummy = Marshal.load(file) # last_bgm
dummy = Marshal.load(file) # last_bgs
@system = Marshal.load(file) # system
dummy = Marshal.load(file) # message
dummy = Marshal.load(file) # switches
@variables = Marshal.load(file) # variables
dummy = Marshal.load(file) # self_switches
@actors = Marshal.load(file) # actors
@party = Marshal.load(file) # party
#dummy = Marshal.load(file) # troop
#dummy = Marshal.load(file) # map
#dummy = Marshal.load(file) # player
@total_sec = frame_count / Graphics.frame_rate
rescue
@file_exist = false
ensure
file.close
end
end
end
#--------------------------------------------------------------------------
# ● ファイルなしの設定
#--------------------------------------------------------------------------
def nothing=(nothing)
@nothing = nothing
refresh
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
@date_list.bitmap.dispose
@date_list.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
@date_list.update
end
#--------------------------------------------------------------------------
# ● 画像を取得する
#--------------------------------------------------------------------------
def sprite
return @date_list
end
#--------------------------------------------------------------------------
# ● 画像ビットマップを取得する
#--------------------------------------------------------------------------
def contents
return @date_list.bitmap
end
#--------------------------------------------------------------------------
# ● リスト画像を作成する
#--------------------------------------------------------------------------
def create_list
@date_list = Sprite.new(@viewport)
@date_list.bitmap = Bitmap.new(272, 24)
@date_list.x = 16
@date_list.y = @file_index * 25 + 5
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_back_graphic
self.contents.font.size = 14
self.contents.font.color = ZiiDate::TIME
if @file_exist
index = sprintf(ZiiDate::FILE, @file_index + 1)
text = @system.save_map
draw_playtime(72, 0, contents.width - 76, 24, 2)
elsif @nothing
index = ZiiDate::NO
text = ZiiDate::EMPTY
else
index = ZiiDate::NEW
text = ZiiDate::MAKE
end
self.contents.draw_text(0, 0, 64, 24, index, 1)
self.contents.font.color = ZiiDate::TEXT
self.contents.draw_text(72, 0, 160, 24, text)
end
#--------------------------------------------------------------------------
# ● プレイ時間の描画 (フォント非設定)
#--------------------------------------------------------------------------
def draw_playtime(x, y, width, height, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
text = sprintf("%d:%02d", hour, min)
self.contents.draw_text(x, y, width, height, text, align)
end
#--------------------------------------------------------------------------
# ● 背景の描画
#--------------------------------------------------------------------------
def draw_back_graphic
# 上下平行線 + 縦線
self.contents.fill_rect(0, 0, contents.width, 1, ZiiDate::COLOR)
self.contents.fill_rect(0, 23, contents.width, 1, ZiiDate::COLOR)
self.contents.fill_rect(66, 1, 1, 22, ZiiDate::COLOR)
# 塗りつぶし
color = ZiiDate::COLOR.dup
color.alpha = 0
self.contents.gradient_fill_rect(0, 1, 64, 22, color, ZiiDate::COLOR)
self.contents.fill_rect(67, 1, contents.width - 67, 22, ZiiDate::BACK)
end
end
#==============================================================================
# ■ Sprite_Cursol
#------------------------------------------------------------------------------
# カーソル画像を作成、使用するクラスです
#==============================================================================
class Sprite_Cursol < Sprite
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
create_cursol
@count = 0
end
#--------------------------------------------------------------------------
# ● カーソル画像を作成する
#--------------------------------------------------------------------------
def create_cursol
if ZiiDate:
CUR != ""
self.bitmap = Cache.picture(ZiiDate:
CUR)
return
end
self.bitmap = Bitmap.new(304, 26)
color = ZiiDate::CURSOL.dup
color.alpha = 128
self.bitmap.fill_rect(1, 1, 275, 24, color)
self.bitmap.fill_rect(0, 1, 1, 24, ZiiDate::CURSOL)
self.bitmap.fill_rect(1, 25, 302, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(288, 24, 12, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(287, 23, 10, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(287, 22, 7, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(286, 21, 5, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(286, 20, 2, 1, ZiiDate::CURSOL)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
update_count
end
#--------------------------------------------------------------------------
# ● 点滅の更新
#--------------------------------------------------------------------------
def update_count
if @count < 160
self.opacity = 255 - @count
@count += 4
else
self.opacity = @count - 64
@count += 4
end
@count = 0 if @count >= 320
end
end
#==============================================================================
# ■ Window_LineHelp
#------------------------------------------------------------------------------
# スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================
class Window_LineHelp < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(-16, 0, 576, WLH + 32)
self.opacity = 0
end
#--------------------------------------------------------------------------
# ● テキスト設定
# text : ウィンドウに表示する文字列
# align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
back_color = Color.new(0, 0, 0, 80)
self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
self.contents.font.color = normal_color
self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
@text = text
@align = align
end
end
end
# ◆ 地名保存用 (参考にどうぞ)
class Game_System
attr_writer :save_map
def save_map # 地名の取得
return "" if @save_map == nil
return @save_map
end
end
class Scene_File < Scene_Base
alias neomemo16_map write_save_data
def write_save_data(file) # セーブ実行
map_infos = load_data("Data/MapInfos.rvdata")
$game_system.save_map = map_infos[$game_map.map_id].name
neomemo16_map(file)
end
end
I don't see specifically where I can add a second actor, so if anyone can point me in the right direction, it'll be appreciated! Thanks!
^ This screenshot is similar to how my save layout looks like.
And this game I am working on, you can only have a maximum of two people in your party. So I want to be able for the save to only show the Hero and their Ally. (I removed unnecessary fluff like their stats from the save layout, as I only want to show is their names and their HP.) However, I can only show the Hero's and not their Ally's.
Here is the script I am using:
=begin #=======================================================================
★ セーブレイアウト カスタム版
セーブレイアウト変更、背景を設定したり、表示するステータスを変更できます
※これを導入する前にセーブしたデータがある場合 地名は表示されません
一度セーブすることで、正常に表示されます
=end #=========================================================================
#==============================================================================
# ■ Ziifee Date
#==============================================================================
module ZiiDate
# ▼ 基本項目
MAX = 20 # 最大セーブデータの数
OPAC = 1 # ウィンドウ背景 ( 0:通常 , 1:枠のみ , 2:なし )
# ▼ ピクチャ画像の名前 ( "" で未使用、画像は Graphics/Pictures に)
PICT = "" # 背景用ピクチャ
PCUR = "" # カーソル画像 (推奨 304×26px)
# ▼ 名称
FILE = "File %s" # ファイル
NEW = "New" # 新規ファイル
MAKE = "Create a New File" # 新規作成
NO = "" # 数えない時
EMPTY = "No Saves Available" # ファイルなし
# ▼ 色
COLOR = Color.new(0, 0, 0) # 基本色
BACK = Color.new(0, 0, 128, 64) # コマンド背景色
TEXT = Color.new(0, 208, 0) # テキスト文字色
TIME = Color.new(255, 255, 255) # 時間文字色
MAPC = Color.new(16, 16, 16, 128) # マップ背景の合成色
CURSOL = Color.new(196, 224, 255, 196) # カーソル
# ▼ ステータス表示 ( true : 表示 / false : 非表示 )
BATTER = true # バトラー (拡張用)
FACE = true # 顔グラフィック
FACE_H = 100 # 顔グラフィックの高さ
NAME = true # 名前
CLASS = true # クラス
LV = false # Level
STATE = true # ステート
HP = true # HP
MP = false # MP
EQUIP = false # システム文字 装備
EQ1 = false # 武器
EQ2 = false # 盾
EQ3 = false # 頭
EQ4 = false # 身体
EQ5 = false # 装飾品
STATUS = false # システム文字 ステータス
ATK = false # 攻撃力
DEF = false # 防御力
SPI = false # 精神力
AGI = false # 敏捷性
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# ● メニュー画面系の背景作成
#--------------------------------------------------------------------------
def create_menu_background
@menuback_sprite = Sprite.new
if ZiiDate:
@menuback_sprite.bitmap = Cache.picture(ZiiDate:
else
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color = ZiiDate::MAPC
end
update_menu_background
end
#--------------------------------------------------------------------------
# ● 開始処理 改造
#--------------------------------------------------------------------------
def start
super
create_menu_background
@help_window = Window_LineHelp.new
create_savefile_windows
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
end
@savefile_windows[@index].selected = true
for window in @savefile_windows do window.update end
@info_window = Window_DateInfo.new(@savefile_windows[@index])
create_cursol
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
@info_window.dispose
dispose_menu_background
@help_window.dispose
dispose_item_windows
@cursol.bitmap.dispose
@cursol.dispose
@viewport.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新 改
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
update_savefile_windows
update_savefile_selection
@info_window.manage = @savefile_windows[@index]
@info_window.update
set_cursol_y
@cursol.update
end
#--------------------------------------------------------------------------
# ● セーブファイルウィンドウの作成 改造
#--------------------------------------------------------------------------
def create_savefile_windows
@viewport = Viewport.new(0, 55, 544, 356)
@viewport.z = 100
@savefile_windows = []
for i in 0...ZiiDate::MAX
break if not FileTest.exist?(make_filename(i))
@savefile_windows.push(Manage_DateFile.new(i, make_filename(i), @viewport))
end
@item_max = @savefile_windows.size
plus_new_savefile
end
#--------------------------------------------------------------------------
# ● セーブファイルウィンドウの追加
#--------------------------------------------------------------------------
def plus_new_savefile
return if @savefile_windows.size != 0 and not @saving
return if @savefile_windows.size == ZiiDate::MAX
i = @savefile_windows.size
@savefile_windows.push(Manage_DateFile.new(i, make_filename(i), @viewport))
@savefile_windows.nothing = true if not @saving
@item_max = @savefile_windows.size
end
#--------------------------------------------------------------------------
# ● カーソルの作成
#--------------------------------------------------------------------------
def create_cursol
@cursol = Sprite_Cursol.new(@viewport)
@cursol.x = 12
@cursol.z = 90
set_cursol_y
end
#--------------------------------------------------------------------------
# ● カーソルの高さ調節
#--------------------------------------------------------------------------
def set_cursol_y
unless @savefile_windows[@index].nil?
y = @savefile_windows[@index].date_list.y - 1
if y > 305
for window in @savefile_windows
window.date_list.y -= 5
end
elsif y < 4
for window in @savefile_windows
window.date_list.y += 5
end
end
@cursol.y = @savefile_windows[@index].date_list.y - 1
end
end
end
#==============================================================================
# ■ Window_DateInfo
#------------------------------------------------------------------------------
# データの詳細を表示するウィンドウです。
#==============================================================================
class Window_DateInfo < Window_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :manage # データ管理クラス
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# manage : 表示するデータの管理クラス
#--------------------------------------------------------------------------
def initialize(manage = nil)
super(316, 56, 212, 344)
case ZiiDate:
when 0;
when 1; self.back_opacity = 0
when 2; self.opacity = 0
end
@manage = manage
@old = manage
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
return if @manage == nil
return if not @manage.file_exist
return if (id = @manage.party.actors[0]) == nil
return if (actor = @manage.actors[id]) == nil
w , h = contents.width , contents.height
set_y = 0 # 設置用 Y座標計算
# グラフィック *********************************************
draw_actor_battler(actor, w / 2, h) if ZiiDate::BATTER
if ZiiDate::FACE
draw_actor_face(actor, w / 2 - 48, set_y)
set_y += ZiiDate::FACE_H
end
# 基本能力 *************************************************
draw_actor_name(actor, 0, set_y) if ZiiDate::NAME
draw_actor_level(actor, w - 56, set_y) if ZiiDate::LV
set_y += WLH if ZiiDate::NAME or ZiiDate::LV
draw_actor_state(actor, w - 56, set_y) if ZiiDate::STATE
if ZiiDate::CLASS
draw_actor_class(actor, 0, set_y)
set_y += WLH
end
if ZiiDate::HP
draw_actor_hp(actor, 0, set_y)
set_y += WLH
end
if ZiiDate::MP
draw_actor_mp(actor, 0, set_y)
set_y += WLH
end
# 装備 *****************************************************
if ZiiDate::EQUIP
self.contents.font.color = system_color
self.contents.draw_text(0, set_y, w, WLH, Vocab::equip)
set_y += WLH
end
if ZiiDate::EQ1
draw_item_name(actor.equips[0], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ2
draw_item_name(actor.equips[1], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ3
draw_item_name(actor.equips[2], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ4
draw_item_name(actor.equips[3], 12, set_y)
set_y += WLH
end
if ZiiDate::EQ5
draw_item_name(actor.equips[4], 12, set_y)
set_y += WLH
end
# ステータス ***********************************************
if ZiiDate::STATUS
self.contents.font.color = system_color
self.contents.draw_text(0, set_y, w, WLH, Vocab::status)
set_y += WLH
end
if ZiiDate::ATK
draw_actor_parameter(actor, 12, set_y, 0)
set_y += WLH
end
if ZiiDate:
draw_actor_parameter(actor, 12, set_y, 1)
set_y += WLH
end
if ZiiDate::SPI
draw_actor_parameter(actor, 12, set_y, 2)
set_y += WLH
end
if ZiiDate::AGI
draw_actor_parameter(actor, 12, set_y, 3)
set_y += WLH
end
end
#--------------------------------------------------------------------------
# ● アクターのバトラーグラフィックの描画
# actor : アクター
# center_x : 描画先 X座標 ( X座標は 中心の位置)
# under_y : 描画先 X座標 ( Y座標は 底辺の位置)
#--------------------------------------------------------------------------
def draw_actor_battler(actor, center_x, under_y)
draw_battler(actor.battler_name, actor.battler_hue, center_x, under_y)
end
#--------------------------------------------------------------------------
# ● バトラーグラフィックの描画
# battler_name : 顔グラフィック ファイル名
# battler_hue : 顔グラフィック インデックス
# center_x : 描画先 X座標 ( X座標は 中心の位置)
# under_y : 描画先 X座標 ( Y座標は 底辺の位置)
#--------------------------------------------------------------------------
def draw_battler(battler_name, battler_hue, center_x, under_y)
bitmap = Cache.battler(battler_name, battler_hue)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
x , y = center_x - bitmap.width / 2 , under_y - bitmap.height
self.contents.blt(x, y, bitmap, rect)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
if @manage != @old
@old = @manage
refresh
end
super
end
end
# データ取得用
class Game_Party
def actors
return @actors
end
end
#==============================================================================
# ■ Manage_DateFile
#------------------------------------------------------------------------------
# 読み込んだファイルデータを管理するクラスです。
#==============================================================================
class Manage_DateFile
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :file_index # ファイルインデックス
attr_reader :filename # ファイル名
attr_reader :file_exist # ファイル存在フラグ
attr_reader :time_stamp # タイムスタンプ
attr_accessor :selected # 選択状態
attr_reader :total_sec # データ プレイ時間
attr_reader :system # データ システム
attr_reader :variables # データ 変数
attr_reader :actors # データ アクター
attr_reader
attr_reader :date_list # 表示ウィンドウ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(file_index, filename, viewport)
@viewport = viewport
@file_index = file_index
@filename = filename
@selected = false
@nothing = false
load_gamedata
create_list
refresh
end
#--------------------------------------------------------------------------
# ● ゲームデータをロード
#--------------------------------------------------------------------------
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
begin
dummy = Marshal.load(file) # character
frame_count = Marshal.load(file) # frame_count
dummy = Marshal.load(file) # last_bgm
dummy = Marshal.load(file) # last_bgs
@system = Marshal.load(file) # system
dummy = Marshal.load(file) # message
dummy = Marshal.load(file) # switches
@variables = Marshal.load(file) # variables
dummy = Marshal.load(file) # self_switches
@actors = Marshal.load(file) # actors
@party = Marshal.load(file) # party
#dummy = Marshal.load(file) # troop
#dummy = Marshal.load(file) # map
#dummy = Marshal.load(file) # player
@total_sec = frame_count / Graphics.frame_rate
rescue
@file_exist = false
ensure
file.close
end
end
end
#--------------------------------------------------------------------------
# ● ファイルなしの設定
#--------------------------------------------------------------------------
def nothing=(nothing)
@nothing = nothing
refresh
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
@date_list.bitmap.dispose
@date_list.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
@date_list.update
end
#--------------------------------------------------------------------------
# ● 画像を取得する
#--------------------------------------------------------------------------
def sprite
return @date_list
end
#--------------------------------------------------------------------------
# ● 画像ビットマップを取得する
#--------------------------------------------------------------------------
def contents
return @date_list.bitmap
end
#--------------------------------------------------------------------------
# ● リスト画像を作成する
#--------------------------------------------------------------------------
def create_list
@date_list = Sprite.new(@viewport)
@date_list.bitmap = Bitmap.new(272, 24)
@date_list.x = 16
@date_list.y = @file_index * 25 + 5
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_back_graphic
self.contents.font.size = 14
self.contents.font.color = ZiiDate::TIME
if @file_exist
index = sprintf(ZiiDate::FILE, @file_index + 1)
text = @system.save_map
draw_playtime(72, 0, contents.width - 76, 24, 2)
elsif @nothing
index = ZiiDate::NO
text = ZiiDate::EMPTY
else
index = ZiiDate::NEW
text = ZiiDate::MAKE
end
self.contents.draw_text(0, 0, 64, 24, index, 1)
self.contents.font.color = ZiiDate::TEXT
self.contents.draw_text(72, 0, 160, 24, text)
end
#--------------------------------------------------------------------------
# ● プレイ時間の描画 (フォント非設定)
#--------------------------------------------------------------------------
def draw_playtime(x, y, width, height, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
text = sprintf("%d:%02d", hour, min)
self.contents.draw_text(x, y, width, height, text, align)
end
#--------------------------------------------------------------------------
# ● 背景の描画
#--------------------------------------------------------------------------
def draw_back_graphic
# 上下平行線 + 縦線
self.contents.fill_rect(0, 0, contents.width, 1, ZiiDate::COLOR)
self.contents.fill_rect(0, 23, contents.width, 1, ZiiDate::COLOR)
self.contents.fill_rect(66, 1, 1, 22, ZiiDate::COLOR)
# 塗りつぶし
color = ZiiDate::COLOR.dup
color.alpha = 0
self.contents.gradient_fill_rect(0, 1, 64, 22, color, ZiiDate::COLOR)
self.contents.fill_rect(67, 1, contents.width - 67, 22, ZiiDate::BACK)
end
end
#==============================================================================
# ■ Sprite_Cursol
#------------------------------------------------------------------------------
# カーソル画像を作成、使用するクラスです
#==============================================================================
class Sprite_Cursol < Sprite
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
create_cursol
@count = 0
end
#--------------------------------------------------------------------------
# ● カーソル画像を作成する
#--------------------------------------------------------------------------
def create_cursol
if ZiiDate:
self.bitmap = Cache.picture(ZiiDate:
return
end
self.bitmap = Bitmap.new(304, 26)
color = ZiiDate::CURSOL.dup
color.alpha = 128
self.bitmap.fill_rect(1, 1, 275, 24, color)
self.bitmap.fill_rect(0, 1, 1, 24, ZiiDate::CURSOL)
self.bitmap.fill_rect(1, 25, 302, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(288, 24, 12, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(287, 23, 10, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(287, 22, 7, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(286, 21, 5, 1, ZiiDate::CURSOL)
self.bitmap.fill_rect(286, 20, 2, 1, ZiiDate::CURSOL)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
update_count
end
#--------------------------------------------------------------------------
# ● 点滅の更新
#--------------------------------------------------------------------------
def update_count
if @count < 160
self.opacity = 255 - @count
@count += 4
else
self.opacity = @count - 64
@count += 4
end
@count = 0 if @count >= 320
end
end
#==============================================================================
# ■ Window_LineHelp
#------------------------------------------------------------------------------
# スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================
class Window_LineHelp < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(-16, 0, 576, WLH + 32)
self.opacity = 0
end
#--------------------------------------------------------------------------
# ● テキスト設定
# text : ウィンドウに表示する文字列
# align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
back_color = Color.new(0, 0, 0, 80)
self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
self.contents.font.color = normal_color
self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
@text = text
@align = align
end
end
end
# ◆ 地名保存用 (参考にどうぞ)
class Game_System
attr_writer :save_map
def save_map # 地名の取得
return "" if @save_map == nil
return @save_map
end
end
class Scene_File < Scene_Base
alias neomemo16_map write_save_data
def write_save_data(file) # セーブ実行
map_infos = load_data("Data/MapInfos.rvdata")
$game_system.save_map = map_infos[$game_map.map_id].name
neomemo16_map(file)
end
end
I don't see specifically where I can add a second actor, so if anyone can point me in the right direction, it'll be appreciated! Thanks!
