Project1
标题:
关于二周目继承的问题
[打印本页]
作者:
金毛羊羊
时间:
2009-9-20 17:55
提示:
作者被禁止或删除 内容自动屏蔽
作者:
IamI
时间:
2009-9-20 17:56
= =到二周目以后在游戏开始清空所有变量不就完了
作者:
金毛羊羊
时间:
2009-9-20 18:14
提示:
作者被禁止或删除 内容自动屏蔽
作者:
后知后觉
时间:
2009-9-20 18:24
进入‘二周目的时候做一个标记
然后在进入事件标题的地图上判断
如果这个标记存在.就场所移动到’二周目的事件标题地图去
如果这个标记不存在就继续一周目的标题内容
作者:
神龙出世
时间:
2009-9-20 20:09
索性通换地图
作者:
金毛羊羊
时间:
2009-9-20 20:39
提示:
作者被禁止或删除 内容自动屏蔽
作者:
后知后觉
时间:
2009-9-20 22:38
$game_party
作者:
金毛羊羊
时间:
2009-9-21 09:30
提示:
作者被禁止或删除 内容自动屏蔽
作者:
白鬼
时间:
2009-9-21 13:46
我来帮你解决,
你不想继承哪些?
另外,把你用的方法发出来我看下。
作者:
金毛羊羊
时间:
2009-9-21 14:00
提示:
作者被禁止或删除 内容自动屏蔽
作者:
白鬼
时间:
2009-9-21 14:40
简单方法,把你不想继承的剔除,其他都继承
首先
file = File.open("Finished.rxdata", "wb")
Marshal.dump($game_variables, file)
Marshal.dump($game_actors, file)
file.close
复制代码
这部分改成
file = File.open("Finished.rxdata", "wb")
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
file.close
复制代码
不用吝啬,全写里面才500K左右
其次,轮回里面
# 生成各种游戏对像
复制代码
后面全替换成下面的:
if FileTest.exist?("Finished.rxdata")
file = File.open("Finished.rxdata", "rb")
$game_system = Marshal.load(file)
$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 = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
复制代码
Marshal.dump($game_system, file) 系统,不用继承
Marshal.dump($game_switches, file) 开关,不用继承
Marshal.dump($game_variables, file) 变量,不用继承
Marshal.dump($game_self_switches, file) 独立开关,不用继承
Marshal.dump($game_screen, file) 画面闪烁,不用继承
Marshal.dump($game_actors, file) 人物数据相关,继承
Marshal.dump($game_party, file) 人物数据相关,集成
Marshal.dump($game_troop, file) 敌人数据,不用继承
Marshal.dump($game_map, file) 地图信息,不用集成
Marshal.dump($game_player, file) 事件启动的判定、以及地图的滚动等功能,不用继承
我知道了,你把$game_party又初始化了。
作者:
白鬼
时间:
2009-9-21 14:41
把完整的Scene_Title脚本贴上来吧,我帮你改一改
作者:
白鬼
时间:
2009-9-21 15:06
你不贴出来我去洗澡了。
作者:
金毛羊羊
时间:
2009-9-21 16:23
提示:
作者被禁止或删除 内容自动屏蔽
作者:
金毛羊羊
时间:
2009-9-21 16:24
提示:
作者被禁止或删除 内容自动屏蔽
作者:
金毛羊羊
时间:
2009-9-22 14:00
提示:
作者被禁止或删除 内容自动屏蔽
作者:
金毛羊羊
时间:
2009-9-22 20:40
提示:
作者被禁止或删除 内容自动屏蔽
作者:
白鬼
时间:
2009-9-22 20:46
本帖最后由 白鬼 于 2009-9-22 20:47 编辑
#==============================================================================
# ■ 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)
if FileTest.exist?("Finished.rxdata")
# 生成命令窗口
s1 = "新游戏"
s2 = "继续"
s3 = "退出"
s4 = "轮回"
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
else
# 生成命令窗口
s1 = "新游戏"
s2 = "继续"
s3 = "退出"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
end
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(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_shutdown
when 3 # 轮回
command_special
end
end
end
#--------------------------------------------------------------------------
# ● 命令 : 新游戏
#--------------------------------------------------------------------------
def command_new_game
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
if FileTest.exist?("Finished.rxdata")
file = File.open("Finished.rxdata", "rb")
$game_variables = Marshal.load(file)
$game_actors = Marshal.load(file)
file.close
else
$game_variables = Game_Variables.new
$game_actors = Game_Actors.new
end
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.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
# 切换地图画面
$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_special
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
if FileTest.exist?("Finished.rxdata")
file = File.open("Finished.rxdata", "rb")
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
file.close
else
$game_actors = Game_Actors.new
$game_party = Game_Party.new
end
$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_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 设置初期同伴位置
$game_party.setup_starting_members
# 设置初期位置的地图
$game_map.setup(144)
# 主角向初期位置移动
$game_player.moveto(10,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
复制代码
以后发脚本要用“插入代码”
别直接贴
脚本改好了。按照你的要求。
可以凑合用。
不过我觉得,如果没有这个轮回存档的时候,无法选择轮回要更好一些。
先将就用吧。回头我有时间的话,尝试改一改。
作者:
金毛羊羊
时间:
2009-9-22 22:01
提示:
作者被禁止或删除 内容自动屏蔽
作者:
金毛羊羊
时间:
2009-9-22 22:11
提示:
作者被禁止或删除 内容自动屏蔽
作者:
白鬼
时间:
2009-9-22 22:20
你用原来的脚本没这毛病吗?
作者:
白鬼
时间:
2009-9-22 22:21
我才看啊,你这个脚本有问题。
作者:
白鬼
时间:
2009-9-22 22:24
#==============================================================================
# ■ 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)
if FileTest.exist?("Finished.rxdata")
# 生成命令窗口
s1 = "新游戏"
s2 = "继续"
s3 = "退出"
s4 = "轮回"
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
else
# 生成命令窗口
s1 = "新游戏"
s2 = "继续"
s3 = "退出"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
end
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(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_shutdown
when 3 # 轮回
command_special
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
# 切换地图画面
$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_special
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
if FileTest.exist?("Finished.rxdata")
file = File.open("Finished.rxdata", "rb")
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
file.close
else
$game_actors = Game_Actors.new
$game_party = Game_Party.new
end
$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_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
# 切换地图画面
$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
复制代码
好吧,这才是你想要的。
你发给我的那个脚本有问题的。
作者:
白鬼
时间:
2009-9-22 22:27
最后还有一个要说明的
如果你用了 加点 的脚本
就还要修改
作者:
金毛羊羊
时间:
2009-9-22 22:45
提示:
作者被禁止或删除 内容自动屏蔽
作者:
白鬼
时间:
2009-9-23 08:52
25#
金毛羊羊
能解决
回头加我QQ吧
看我签名
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1