Project1
标题:
标题之前
[打印本页]
作者:
嚴子
时间:
2010-9-18 17:09
标题:
标题之前
曾经发过一次,没说清楚,现在再发一次
想跳过标题画面自动执行一段事件,再返回标题。最好不要范例工程。
作者:
BBBBB6
时间:
2010-9-18 18:10
依吾之愚见,汝之要求前后矛盾也。
要跳过标题就要加入跳过标题脚本,如此一来便无法返回标题画面矣------
作者:
oОS+WEi
时间:
2010-9-18 18:53
之前我已经说过了,只不过你不太理解罢了 那我这次说详细点
你建立一个地图,然后在你们设置你要跳开标题制作的事件 然后把那个地图的ID号在这个脚本第60行
当事件执行到最后 用事件调用脚本$scene = Scene_Title.new
唉 如果还不明白我就真的不知道该怎么说了 既然你不需要范例 我也懒得做示范给你了
#==============================================================================
# ■ Scene_LOGO
#------------------------------------------------------------------------------
# 处理标题画面的类。
#==============================================================================
class Scene_Logo
#--------------------------------------------------------------------------
# ● 住处理
#--------------------------------------------------------------------------
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")
$continue_enabled = false
for i in 0..19
if FileTest.exist?("Save/Save#{i}.rxdata")
$continue_enabled = true
end
end
# 如果不是从梦境过来就演奏标题 BGM
if $from_dream_to_title == false
$game_system.bgm_play($data_system.title_bgm)
else
$from_dream_to_title = false
end
Audio.me_stop; Audio.bgs_stop
command_goto_title_map
end
def command_goto_title_map # 生成各种游戏对像并转到Title地图
$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(0) # 设置Title的地图
$game_player.moveto(0,0) # 主角向初期位置移动
$game_player.refresh # 刷新主角
$game_map.update # 刷新地图 (执行并行事件)
$title_selecting = true
$scene = Scene_Map.new # 切换地图画面
end
def battle_test
# 载入数据库 (战斗测试用)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# 重置测量游戏时间用的画面计数器
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_battle_test_members
# 设置队伍 ID、可以逃走标志、战斗背景
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
end
#==============================================================================
# ■ Main
#------------------------------------------------------------------------------
# 各定义结束后、从这里开始实际处理。
#==============================================================================
begin
# 准备过渡
# 设置系统默认字体
Font.default_name = (["迷你简丫丫"])
Graphics.freeze
# 生成场景对像 (标题画面)
$DEBUG = true
$scene = Scene_Logo.new
# $scene 为有效的情况下调用 main 过程
while $scene != nil
$scene.main
end
# 淡入淡出
Graphics.transition(20)
rescue Errno::ENOENT
# 补充 Errno::ENOENT 以外错误
# 无法打开文件的情况下、显示信息后结束
filename = $!.message.sub("No such file or directory - ", "")
print("找不到文件 #{filename}。 ")
end
复制代码
作者:
fux2
时间:
2010-9-18 19:12
把原标题画面改名(其实不改也可以,这是我个人便于区分的习惯),如Scene_newtitle,使用跳过标题脚本,在你执行的事件末加脚本。$scene=Scene_newtitle即可。(如果=nil可以充当退出效果)
作者:
Deathfuture
时间:
2010-9-18 19:21
回复
嚴子
的帖子
自己再加一个Scene_Title 范例(无工程,从火炎之纹章~终焉の高考~Exam Fantasy中拷贝):
第一
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 处理标题画面的类。
#==============================================================================
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 = "0"
# 生成命令窗口
@command_window = Window_Command.new(40, [s1])
@command_window.back_opacity = 30
@command_window.x = -88 - @command_window.width / 2
@command_window.y = -888
# 停止演奏 ME、BGS、BGM
Audio.bgm_stop
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition
# 装备过渡
Graphics.freeze
# 释放标题图形
@sprite.bitmap.dispose
@sprite.dispose
# 重置测量游戏时间用的画面计数器
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(001)
# 主角向初期位置移动
$game_player.moveto(0,0)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
end
def battle_test
# 载入数据库 (战斗测试用)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# 重置测量游戏时间用的画面计数器
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_battle_test_members
# 设置队伍 ID、可以逃走标志、战斗背景
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
end
复制代码
第二:
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 处理标题画面的类。
#==============================================================================
class Scene_Title2
#--------------------------------------------------------------------------
# ● 住处理
#--------------------------------------------------------------------------
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 = " "
s3 = " "
s4 = " "
s5 = " "
@command_window = Window_Command2.new(680, [s1, s2, s3, s4,s5])
@command_window.back_opacity =196
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
@command_window.opacity = 0 #不显示外框
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..4
if FileTest.exist?("Save{i+1}.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled = true
@command_window.index = 1
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
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
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置的分支
case @command_window.index
when 0 # 新游戏
command_new_game
when 1 # 继续
command_continue
when 2 # 退出
command_Tround
when 3 #
command_secondround
when 4 #
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# ● 命令 : 新游戏
#--------------------------------------------------------------------------
def command_new_game
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
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
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
# $newgame = true
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 命令 : 继续
#--------------------------------------------------------------------------
def command_continue
# 继续无效的情况下
unless @continue_enabled
# 演奏无效 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到读档画面
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ● 命令 : 退出
#--------------------------------------------------------------------------
def command_shutdown
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# BGM、BGS、ME 的淡入淡出
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 退出
$scene = nil
end
#--------------------------------------------------------------------------
# ● 命令 : 作者的话
#--------------------------------------------------------------------------
def command_secondround
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
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(235)
# 主角向初期位置移动
$game_player.moveto(06,10)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 命令 : 特别篇
#--------------------------------------------------------------------------
def command_Tround
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
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(236)
# 主角向初期位置移动
$game_player.moveto(06,10)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 战斗测试
#--------------------------------------------------------------------------
def battle_test
# 载入数据库 (战斗测试用)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# 重置测量游戏时间用的画面计数器
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_battle_test_members
# 设置队伍 ID、可以逃走标志、战斗背景
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
end
复制代码
补充:剩下你自己该就好了
# 使用
$scene = Scene_Title2.new
复制代码
召唤Title2(第二个标题)
作者:
enghao_lim
时间:
2010-9-18 19:59
其实我一直觉得用事件标题的脚本不就解决问题了嘛……路过的……
作者:
嚴子
时间:
2010-9-21 19:22
哥哥你竟然不告诉我,把那个脚本的Main部分剪切到原Main脚本就行了……搞了呢么老半天。谢谢!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1