查看: 2364|回复: 2

[已经过期] 章节选择 请问如何加入新 章节 而基本不出错

[复制链接]
梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-6-22 01:08:55 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
  1.     @command_window.set_handler(:sdf, method(:sdf6))  
  2. 难道是我设置错了吗
复制代码


章节选择 请问如何加入新 章节 而基本不出错

  1. #==============================================================================
  2. # ■             【VX Ace】章节选择  - By 哇哈哈哇哈哈(Ver 1.03)
  3. #------------------------------------------------------------------------------
  4. #                           简介:通过章节进行传送。
  5. #                           适用范围:大部分游戏。
  6. #-------------------------------------------------------------------------------
  7. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  8. #  ※ 基本信息(Basic Information):
  9. #   * 适用:RPGVXAce(RGSS3)
  10. #   * 难度:★★★
  11. #   * 版本:1.03
  12. #   * 编写日期:2014/8/25
  13. #   * 上手度:中等
  14. #   * 兼容性:中等
  15. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  16. #------------------------------------------------------------------------------
  17. #                  ※    使用方法、注意事项及更新内容     ※
  18. #------------------------------------------------------------------------------
  19. # ● 使用方法:
  20. #    放入脚本Main之上,为了减少冲突请将脚本尽量往下放置。
  21. #    地图中使用该脚本:local
  22. #    如果章节需要条件开启,请将Value_C所设置的变量序号设置到相应的数值。
  23. #    例如:开启第二章,将3号变量赋值为2。
  24. #    如有疑问请在脚本发布贴内说明。
  25. #    请将章节开启后输入事件脚本saver
  26. #------------------------------------------------------------------------------
  27. #  ● 注意事项:
  28. #   1、请查看该脚本是否用于RMVA上。
  29. #   2、由于脚本未经多次测试,兼容性未知。
  30. #   3、如有BUG请及时反馈。
  31. #------------------------------------------------------------------------------
  32. #  ● 版本更新:
  33. #    * 1.03   12.15
  34. #    1、新增加章节补充说明,提高脚本实用性和灵活性;
  35. #    2、改善多处细节,即使不使用基础脚本也可以运行。
  36. #    * 1.02   11.30
  37. #    1、再次修改脚本,取消大部分全局变量;
  38. #    2、增强脚本兼容性。
  39. #    3、加强细节修正。
  40. #    * 1.01   9.20
  41. #    1、简化语句,修改项位置修改至更容易修改的地方;
  42. #    2、更改章节更新的脚本及位置,使操作更简单。
  43. #    * 1.00   8.26
  44. #    初版发布,脚本制作完成。
  45. #==============================================================================
  46. $wahaha_script = {} if $wahaha_script.nil?
  47. $wahaha_script["local_choose"] = 1.03
  48. module Wahaha
  49.   # 支持此脚本运行的变量序号。
  50.   Value_C = 3
  51.   
  52.   # 章节设置。
  53.   # 其格式为[名称,地图序号,X坐标,Y坐标]。
  54.   Name1 = ["暴风城",1,15,12,"World"]
  55.   Name2 = ["泰坦遗迹",2,10,"Castle"]
  56.   Name3 = ["天界重地",3,21,16,"Plain"]
  57.   Name4 = ["万神殿",4,13,15,"Crystal"]
  58.   Name5 = ["万魔殿",5,17,11,"Demoncastle"]
  59.   Name6 = ["神魔墓地",7,17,11,"Demoncastle"]
  60.   
  61.   # 位于界面右旁的说明。
  62.   Story = ("今天我们所讲的就有这些,你需\n要进行不断的传送才可以成为兄\n贵!!!")
  63.   
  64.   Story2 = ("今天我们就有这些,你需\n要进行不断的传送才可以成为兄\n贵!!!")
  65.   # 在标题画面中是否自动开启章节选择,如果不需要请改为false.
  66.   NewStart = true
  67.   
  68.   # 进入章节选择的背景界面,需要放入游戏根目录/Graphics/Title1文件夹里。
  69.   # 你可以自定义设置。
  70.   Background = "Plain"

  71.   # 第一章是否默认开启?如果不是请改为false.
  72.   Normal_One = true
  73. end
  74. #==============================================================================
  75. # ■                           Script
  76. #------------------------------------------------------------------------------
  77. #     ※ 注意:除注释区内制定修改的脚本以外请勿随意更改,否则会发生脚本错误。
  78. #==============================================================================
  79. #==============================================================================
  80. # ■ Scene_Title
  81. #------------------------------------------------------------------------------
  82. #  标题画面
  83. #==============================================================================
  84. class Scene_Title < Scene_Base
  85.   #--------------------------------------------------------------------------
  86.   # ● 开始处理
  87.   #--------------------------------------------------------------------------
  88.   alias wahaha_orginial_20141031 start
  89.   def start
  90.    wahaha_orginial_20141031
  91.    Wahaha_Save.newdoc_save unless FileTest.exist?("System/Saver_Wahaha.rvdata2")
  92.    Wahaha_Save.newdoc_load if FileTest.exist?("System/Saver_Wahaha.rvdata2")
  93.   end
  94. end
  95. #==============================================================================
  96. # ■ Game_Interpreter
  97. #------------------------------------------------------------------------------
  98. #  事件指令的解释器。
  99. #   本类在 Game_Map、Game_Troop、Game_Event 类的内部使用。
  100. #==============================================================================
  101. class Game_Interpreter
  102.   def saver
  103.     Wahaha_Save.newdoc_save
  104.   end
  105.   def local
  106.     SceneManager.call(Scene_Localer)
  107.   end
  108. end
  109. #==============================================================================
  110. # ■ WahahaSave
  111. #------------------------------------------------------------------------------
  112. #  变量储存的设置。
  113. #==============================================================================
  114. module Wahaha_Save
  115.   #=============================================================================
  116.   # * 将游戏变量储存到一个文件内。
  117.   #=============================================================================
  118.   def self.newdoc_save
  119.     file = File.open("System/Saver_Wahaha.rvdata2","wb")
  120.     Marshal.dump($game_variables, file)
  121.     file.close
  122.   end
  123.   def self.newdoc_load
  124.     file = File.open("System/Saver_Wahaha.rvdata2","rb")
  125.     $game_variables = Marshal.load(file)
  126.     file.close
  127.   end
  128. end
  129. module Check_Locals
  130.   def self.filexist?(kao)
  131.     $game_variables[Wahaha::Value_C] >= kao
  132.   end
  133. end
  134. #==============================================================================
  135. # ■ Scene_Title
  136. #------------------------------------------------------------------------------
  137. #  标题画面。
  138. #==============================================================================
  139. class Scene_Title < Scene_Base
  140.   alias a start
  141.   def start
  142.     a
  143.     Wahaha_Save.newdoc_load
  144.   end
  145.   alias old_command_new_game command_new_game
  146.   def command_new_game
  147.     if Wahaha::NewStart
  148.     close_command_window
  149.     SceneManager.call(Scene_Localer)
  150.     else
  151.     old_command_new_game
  152.     end
  153.   end
  154. end
  155. #==============================================================================
  156. # ■ Window_Localer
  157. #------------------------------------------------------------------------------
  158. #  传送画面的窗口。
  159. #==============================================================================
  160. class Window_Localer < Window_Command
  161.   include Wahaha
  162.   def initialize
  163.     super(0, 0)
  164.     update_placement
  165.     select_symbol(:one) if checker1
  166.     select_symbol(:two) if checker2
  167.     select_symbol(:thr) if checker3
  168.     select_symbol(:fou) if checker4
  169.     select_symbol(:fiv) if checker5
  170.     select_symbol(:sdf) if checker6
  171.     self.openness = 0
  172.     open
  173.   end
  174.   def window_width
  175.     return 160
  176.   end
  177.   def update_placement
  178.     self.x = 0
  179.     self.y = 50
  180.   end
  181.   def make_command_list
  182.     add_command(Name1[0], :one,checker1)
  183.     add_command(Name2[0], :two,checker2)
  184.     add_command(Name3[0], :thr,checker3)
  185.     add_command(Name4[0], :fou,checker4)
  186.     add_command(Name5[0], :fiv,checker5)
  187.     add_command(Name5[0], :sdf,checker6)   
  188.   end
  189.   def checker1
  190.     Check_Locals.filexist?(1)
  191.   end
  192.   def checker2
  193.     Check_Locals.filexist?(2)
  194.   end
  195.   def checker3
  196.     Check_Locals.filexist?(3)
  197.   end
  198.   def checker4
  199.     Check_Locals.filexist?(4)
  200.   end
  201.   def checker5
  202.     Check_Locals.filexist?(5)
  203.   end
  204.    def checker6
  205.     Check_Locals.filexist?(6)
  206.   end
  207. end
  208. class Window_Localersyst <Window_Selectable
  209.   def initialize
  210.     super(0, 0, Graphics.width, 50)
  211.     draw_text_ex(200, 1, "六道轮回")
  212.     activate
  213.   end
  214. end
  215. class Window_Localertext < Window_Selectable
  216.   def initialize
  217.     super(160, 50, Graphics.width - 160, Graphics.height - 50)
  218.     draw_text_ex(4, 0, Wahaha::Story)
  219.     activate
  220.   end
  221. end
  222. #==============================================================================
  223. # ■ Scene_Localer
  224. #------------------------------------------------------------------------------
  225. #  传送画面。
  226. #==============================================================================
  227. class Scene_Localer < Scene_Base
  228.   include Wahaha
  229.   def start
  230.     super
  231.     Graphics.freeze
  232.     onesa
  233.     create_command_window
  234.     create_command_window2
  235.     new_background
  236.   end
  237.   def transition_speed
  238.     return 20
  239.   end
  240.   def terminate
  241.     super
  242.     SceneManager.snapshot_for_background
  243.   end
  244.   def onesa
  245.   $game_variables[Value_C] = 1 if Normal_One && $game_variables[Value_C] == 0
  246.   end
  247.   def new_background
  248.     @background_sprite = Sprite.new
  249.     @background_sprite.bitmap = Cache.title1(Background)
  250.     @background_sprite.color.set(16, 16, 16, 128)
  251.   end
  252.   def create_command_window
  253.     @command_window = Window_Localer.new
  254.     @command_window.set_handler(:one, method(:one1))
  255.     @command_window.set_handler(:two, method(:two2))
  256.     @command_window.set_handler(:thr, method(:thr3))
  257.     @command_window.set_handler(:fou, method(:fou4))
  258.     @command_window.set_handler(:fiv, method(:fiv5))
  259.     @command_window.set_handler(:sdf, method(:sdf6))   
  260.     @command_window.set_handler(:cancel,    method(:return_scene))
  261.   end
  262.   def create_command_window2
  263.     @story_window = Window_Localertext.new
  264.     @story_window.set_handler(:cancel, method(:return_scene))
  265.     @story2_window = Window_Localersyst.new
  266.     @story2_window.set_handler(:cancel, method(:return_scene))
  267.   end
  268.   def close_command_window
  269.     @command_window.close
  270.     update until @command_window.close?
  271.   end
  272.   def same
  273.     close_command_window
  274.     DataManager.setup_new_game
  275.     fadeout_all
  276.   end
  277.   def one1
  278.     same
  279.     $game_map.setup(Name1[1])
  280.     $game_player.moveto(Name1[2],Name1[3])
  281.     $game_map.autoplay
  282.     SceneManager.goto(Scene_Map)
  283.   end
  284.   def two2
  285.     same
  286.     $game_map.setup(Name2[1])
  287.     $game_player.moveto(Name2[2],Name2[3])
  288.     $game_map.autoplay
  289.     SceneManager.goto(Scene_Map)
  290.   end
  291.   def thr3
  292.     same
  293.     $game_map.setup(Name3[1])
  294.     $game_player.moveto(Name3[2],Name3[3])
  295.     $game_map.autoplay
  296.     SceneManager.goto(Scene_Map)
  297.   end
  298.   def fou4
  299.     same
  300.     $game_map.setup(Name4[1])
  301.     $game_player.moveto(Name4[2],Name4[3])
  302.     $game_map.autoplay
  303.     SceneManager.goto(Scene_Map)
  304.   end
  305.   def fiv5
  306.     same
  307.     $game_map.setup(Name5[1])
  308.     $game_player.moveto(Name5[2],Name5[3])
  309.     $game_map.autoplay
  310.     SceneManager.goto(Scene_Map)
  311.   end
  312.   def sdf6
  313.     same
  314.     $game_map.setup(Name6[1])
  315.     $game_player.moveto(Name6[2],Name6[3])
  316.     $game_map.autoplay
  317.     SceneManager.goto(Scene_Map)
  318.   end
  319. end
  320. #==============================================================================
  321. # ■                           脚本结束
  322. #------------------------------------------------------------------------------
  323. #  ※                    The End of Scripts                 2014/8/26 10:04
  324. #==============================================================================
复制代码
------落尽红樱君不见,轻绘梨花泪沾衣。~~~

老鹰

梦石
40
星屑
38049
在线时间
7128 小时
注册时间
2012-5-26
回帖
3306

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2017-6-22 09:50:59 | 显示全部楼层
这脚本在读取上就已经写死了6个了……
推荐去联系原作者吧

点评

hb好吧 ,那你能看看怎么扩大分辨率吗 谢谢  发表于 2017-6-22 11:13
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部