| 赞 | 2 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2019-3-12 |
| 在线时间 | 32 小时 |
- 梦石
- 0
- 星屑
- 96
- 在线时间
- 32 小时
- 注册时间
- 2015-1-5
- 回帖
- 21
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 xkm198510 于 2015-1-12 10:54 编辑
我想请问一下,这段脚本 更改角色的 位置 在哪一行上?
[pre lang="ruby" line="1"]#
# クイックロード(RGSS3)
# (C)2012 TYPE74RX-T
#
#==============================================================================
# ■ SceneManager
#------------------------------------------------------------------------------
# シーン遷移を管理するモジュールです。たとえばメインメニューからアイテム画面
# を呼び出し、また戻るというような階層構造を扱うことができます。
#==============================================================================
class << SceneManager # module内のエイリアス
alias rx3_1201202_first_scene_class first_scene_class
def first_scene_class
# ★ クイックロードモードの条件を満たしていたらクイックロードに飛ぶ
return Scene_RX_QuickLoad if rx_quick_load?
rx3_1201202_first_scene_class # メソッド呼び戻し
end
end
module SceneManager
#--------------------------------------------------------------------------
# ★ クイックロードモードの条件を満たしているか
#--------------------------------------------------------------------------
def self.rx_quick_load?
$RX_QLOAD = 0
Input.update
$RX_QLOAD = 1 if Input.press?(:C) # 最後にロードしたファイルから始める
$RX_QLOAD = 2 if Input.press?(:B) # 最後にセーブしたファイルから始める
chk = Dir.glob('RX_SaveFileInfos.dat').size > 0 && $RX_QLOAD > 0
return chk
end
end
#==============================================================================
# ■ Scene_Save
#------------------------------------------------------------------------------
# セーブ画面の処理を行うクラスです。
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# ● セーブ成功時の処理
#--------------------------------------------------------------------------
alias rx3_1201202_on_save_success on_save_success
def on_save_success
index_save # ★ セーブしたファイルインデックス情報を書き込む
rx3_1201202_on_save_success # メソッド呼び戻し
end
#--------------------------------------------------------------------------
# ★ セーブしたファイルインデックス情報を書き込む
#--------------------------------------------------------------------------
def index_save
chk = rx_read_load_index # インデックス情報があれば、それを読み込む
file = File.open("RX_SaveFileInfos.dat", "wb")
# ファイルインデックス情報ファイルがなければ、仮に -1 を記録
chk ? Marshal.dump(@rx_load_index, file) : Marshal.dump(-1, file)
Marshal.dump(@index, file)
file.close
end
#--------------------------------------------------------------------------
# ★ ロードしたファイルインデックス情報を読み込む
#--------------------------------------------------------------------------
def rx_read_load_index
chk = Dir.glob('RX_SaveFileInfos.dat').size > 0
return false unless chk
file = File.open("RX_SaveFileInfos.dat", "rb")
@rx_load_index = Marshal.load(file)
sav_id = Marshal.load(file)
file.close
return true
end
end
#==============================================================================
# ■ Scene_Load
#------------------------------------------------------------------------------
# ロード画面の処理を行うクラスです。
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● ロード成功時の処理
#--------------------------------------------------------------------------
alias rx3_1201202_on_load_success on_load_success
def on_load_success
index_save # ★ ロードしたファイルインデックス情報を書き込む
rx3_1201202_on_load_success # メソッド呼び戻し
end
#--------------------------------------------------------------------------
# ★ ロードしたファイルインデックス情報を書き込む
#--------------------------------------------------------------------------
def index_save
rx_read_save_index # 先にセーブしたファイルインデックス情報を読み込む
file = File.open("RX_SaveFileInfos.dat", "wb")
Marshal.dump(@index, file)
Marshal.dump(@rx_save_index, file)
file.close
end
#--------------------------------------------------------------------------
# ★ セーブしたファイルインデックス情報を読み込む
#--------------------------------------------------------------------------
def rx_read_save_index
file = File.open("RX_SaveFileInfos.dat", "rb")
rx_load_index = Marshal.load(file)
@rx_save_index = Marshal.load(file)
file.close
end
end
#==============================================================================
# ★ Scene_RX_QuickLoad
#------------------------------------------------------------------------------
# クイックロードの処理を行うクラスです。
#==============================================================================
class Scene_RX_QuickLoad < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
quick_load
end
#--------------------------------------------------------------------------
# ● クイックロード
#--------------------------------------------------------------------------
def quick_load
index = read_index
if index >= 0
$game_system.on_after_load if DataManager.load_game(index)
SceneManager.goto(Scene_Map)
else
SceneManager.goto(Scene_Title)
end
end
#--------------------------------------------------------------------------
# ● インデックス情報をロード
#--------------------------------------------------------------------------
def read_index
file = File.open("RX_SaveFileInfos.dat", "rb")
load_index = Marshal.load(file)
save_index = Marshal.load(file)
file.close
return load_index if $RX_QLOAD == 1
return save_index if $RX_QLOAD == 2
end
end[/pre] |
|