Project1

标题: 增加一个标题命令使其调用一个公共事件.. [打印本页]

作者: aaalbx    时间: 2012-1-25 14:25
标题: 增加一个标题命令使其调用一个公共事件..
RT....鄙人改了好久,但就是改不好dsu_plus_rewardpost_czw
作者: 腐琴琴    时间: 2012-1-25 15:41
本帖最后由 腐琴琴 于 2012-1-25 16:19 编辑

[attach]95212[/attach]

不知道我理解的对不对呀……
特殊开头.rar (412.9 KB, 下载次数: 19)

在Scene_Title这里可以加选项(貌似这个你知道的)
  1. s1 = "新游戏"
  2.     s2 = "继续"
  3.     s3 = "退出"
  4.     @command_window = Window_Command.new(192, [s1, s2, s3])
复制代码
  1. s1 = "新游戏"
  2.     s2 = "继续"
  3.     s3 = "额外"
  4.     s4 = "退出"
  5.     @command_window = Window_Command.new(192, [s1, s2, s3,s4])
复制代码
还有这里改一下:
  1. if Input.trigger?(Input::C)
  2.       # 命令窗口的光标位置的分支
  3.       case @command_window.index
  4.       when 0  # 新游戏
  5.         command_new_game
  6.       when 1  # 继续
  7.         command_continue
  8.       when 2  # 退出
  9.         command_shutdown
复制代码
  1. when 0  # 新游戏
  2.         command_new_game
  3.       when 1  # 继续
  4.         command_continue
  5.       when 2  # 额外
  6.         command_another_game
  7.       when 3  # 退出
  8.         command_shutdown
复制代码
然后公共事件可以用一个不太好的方法加入
把新游戏的东西复制一份
  1. def command_new_game
  2.     # 演奏确定 SE
  3.     $game_system.se_play($data_system.decision_se)
  4.     # 停止 BGM
  5.     Audio.bgm_stop
  6.     # 重置测量游戏时间用的画面计数器
  7.     Graphics.frame_count = 0
  8.     # 生成各种游戏对像
  9.     $game_temp          = Game_Temp.new
  10.     $game_system        = Game_System.new
  11.     $game_switches      = Game_Switches.new
  12.     $game_variables     = Game_Variables.new
  13.     $game_self_switches = Game_SelfSwitches.new
  14.     $game_screen        = Game_Screen.new
  15.     $game_actors        = Game_Actors.new
  16.     $game_party         = Game_Party.new
  17.     $game_troop         = Game_Troop.new
  18.     $game_map           = Game_Map.new
  19.     $game_player        = Game_Player.new
  20.     # 设置初期同伴位置
  21.     $game_party.setup_starting_members
  22.     # 设置初期位置的地图
  23.     $game_map.setup($data_system.start_map_id)
  24.     # 主角向初期位置移动
  25.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  26.     # 刷新主角
  27.     $game_player.refresh
  28.     # 执行地图设置的 BGM 与 BGS 的自动切换
  29.     $game_map.autoplay
  30.     # 刷新地图 (执行并行事件)
  31.     $game_map.update
  32.     # 切换地图画面
  33.     $scene = Scene_Map.new
  34.   end
复制代码
然后在
  1. start_map_id
复制代码
中的start_map_id改成一个数字,然后就在该数字编号的地图做事件……也不一定是公共事件啦……
  1.   def command_new_game
  2.     # 演奏确定 SE
  3.     $game_system.se_play($data_system.decision_se)
  4.     # 停止 BGM
  5.     Audio.bgm_stop
  6.     # 重置测量游戏时间用的画面计数器
  7.     Graphics.frame_count = 0
  8.     # 生成各种游戏对像
  9.     $game_temp          = Game_Temp.new
  10.     $game_system        = Game_System.new
  11.     $game_switches      = Game_Switches.new
  12.     $game_variables     = Game_Variables.new
  13.     $game_self_switches = Game_SelfSwitches.new
  14.     $game_screen        = Game_Screen.new
  15.     $game_actors        = Game_Actors.new
  16.     $game_party         = Game_Party.new
  17.     $game_troop         = Game_Troop.new
  18.     $game_map           = Game_Map.new
  19.     $game_player        = Game_Player.new
  20.     # 设置初期同伴位置
  21.     $game_party.setup_starting_members
  22.     # 设置初期位置的地图
  23.     $game_map.setup($data_system.start_map_id)
  24.     # 主角向初期位置移动
  25.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  26.     # 刷新主角
  27.     $game_player.refresh
  28.     # 执行地图设置的 BGM 与 BGS 的自动切换
  29.     $game_map.autoplay
  30.     # 刷新地图 (执行并行事件)
  31.     $game_map.update
  32.     # 切换地图画面
  33.     $scene = Scene_Map.new
  34.   end
  35. #====================================================================
  36.   def command_another_game
  37.     # 演奏确定 SE
  38.     $game_system.se_play($data_system.decision_se)
  39.     # 停止 BGM
  40.     Audio.bgm_stop
  41.     # 重置测量游戏时间用的画面计数器
  42.     Graphics.frame_count = 0
  43.     # 生成各种游戏对像
  44.     $game_temp          = Game_Temp.new
  45.     $game_system        = Game_System.new
  46.     $game_switches      = Game_Switches.new
  47.     $game_variables     = Game_Variables.new
  48.     $game_self_switches = Game_SelfSwitches.new
  49.     $game_screen        = Game_Screen.new
  50.     $game_actors        = Game_Actors.new
  51.     $game_party         = Game_Party.new
  52.     $game_troop         = Game_Troop.new
  53.     $game_map           = Game_Map.new
  54.     $game_player        = Game_Player.new
  55.     # 设置初期同伴位置
  56.     $game_party.setup_starting_members
  57.     # 设置初期位置的地图
  58.     $game_map.setup(2)
  59.     # 主角向初期位置移动
  60.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  61.     # 刷新主角
  62.     $game_player.refresh
  63.     # 执行地图设置的 BGM 与 BGS 的自动切换
  64.     $game_map.autoplay
  65.     # 刷新地图 (执行并行事件)
  66.     $game_map.update
  67.     # 切换地图画面
  68.     $scene = Scene_Map.new
  69.   end
复制代码
哦对了,上一个附件因为我少打了一个d,所以退出的时候会出错。附件已更新。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1