Project1
标题:
選取空白存檔後直接進入遊戲(XP&VX&VA)
[打印本页]
作者:
serena718
时间:
2012-1-23 02:26
标题:
選取空白存檔後直接進入遊戲(XP&VX&VA)
本帖最后由 serena718 于 2012-1-25 00:47 编辑
※新增VX版
#-----------------------------------------------------
方才幫一個人完成了這個腳本,在6R搜尋了下後發現似乎沒人有發過類似的
其實這腳本的原理很簡單,相信高手都會,而我也只是將內建的腳本移花接木罷了
還有就是這腳本並沒有做美化以及和截圖存檔之類的有動到存讀檔方面的腳本做整合
標題美化類的一定會有衝突
小妹我雖然註冊時間早但是一直都在潛水,所以也算個半新人(?)
這也是我在6R的第一個腳本,寫法各種渣(應該說只是內建的移過去),希望各位高手多包涵m(_ _)m
※請將腳本插入在Scene_Debug下、Main上
※我順便將標題的選單改了下,將"讀取"這項拿掉了,以後要開始或讀取遊戲,都將由"進入遊戲"這選項完成
※跟一些標題類,還有大部分有動到存讀檔的腳本(ex:截圖存檔…)會有衝突,請注意
(XP版本)
class Scene_Title
#---------------------------------
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "進入遊戲"
s2 = "退出"
@command_window = Window_Command.new(192, [s1, s2])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#---------------------------------
def update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_continue
when 1
command_shutdown
end
end
end
#---------------------------------
def command_continue
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load.new
end
#---------------------------------
end
class Scene_Load
#---------------------------------
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("要選擇哪個紀錄?")
end
#---------------------------------
def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$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
end
#---------------------------------
end
复制代码
那啥……我幫人寫完後,才發現對方沒跟我講版本,我自顧自地以為他跟我一樣是用XP版的(汗)
於是我又弄了個RMVA版的了
上面的那個是XP版本
下面這VA版的,使用方式以及注意事項一樣
還有就是,VA版的我是將"開始遊戲"刪掉了,要更改標題選單中顯示的字
要到資料庫>用語,將"繼續遊戲"這項改成"開始遊戲"之類的……
(VA版本)
class Window_TitleCommand < Window_Command
def initialize
super(0, 0)
update_placement
self.openness = 0
open
end
def make_command_list
add_command(Vocab::continue, :continue)
add_command(Vocab::shutdown, :shutdown)
end
end
class Scene_Title < Scene_Base
def create_command_window
@command_window = Window_TitleCommand.new
@command_window.set_handler(:continue, method(:command_continue))
@command_window.set_handler(:shutdown, method(:command_shutdown))
end
end
class Scene_Load < Scene_File
def on_savefile_ok
super
if DataManager.load_game(@index)
on_load_success
else
DataManager.setup_new_game
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
end
end
复制代码
(VX版本)
class Scene_Title < Scene_Base
def update
super
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_continue
when 1
command_shutdown
end
end
end
def create_command_window
s1 = Vocab::continue
s2 = Vocab::shutdown
@command_window = Window_Command.new(172, [s1, s2])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = 288
@command_window.openness = 0
@command_window.open
end
def command_continue
Sound.play_decision
$scene = Scene_File.new(false, true, false)
end
end
class Scene_File < Scene_Base
def confirm_player_location
if $data_system.start_map_id == 0
print "玩家起始位置沒有被指定。"
exit
end
end
def determine_savefile
if @saving
Sound.play_save
do_save
else
if @savefile_windows[@index].file_exist
Sound.play_load
do_load
else
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(1500)
Graphics.fadeout(60)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
return
end
end
$game_temp.last_file_index = @index
end
end
复制代码
作者:
菜鸟飞呀飞
时间:
2012-1-23 11:45
提示:
作者被禁止或删除 内容自动屏蔽
作者:
企鹅达达
时间:
2012-1-24 16:58
就是说以后如果存档空格满了的话就无法新游戏了?
作者:
serena718
时间:
2012-1-24 22:55
企鹅达达 发表于 2012-1-24 16:58
就是说以后如果存档空格满了的话就无法新游戏了?
是的,但是可以手動擴展存檔數量來解決這個問題
作者:
各种压力的猫君
时间:
2012-1-25 14:48
需要添加存档管理功能啊(有 删除/复制 就够了)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1