设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1766|回复: 2
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2392
在线时间
912 小时
注册时间
2014-10-14
帖子
1331

开拓者

跳转到指定楼层
1
发表于 2017-6-22 01:08:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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


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

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

Lv6.析梦学徒

老鹰

梦石
40
星屑
35597
在线时间
6819 小时
注册时间
2012-5-26
帖子
3276

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

2
发表于 2017-6-22 09:50:59 | 只看该作者
这脚本在读取上就已经写死了6个了……
推荐去联系原作者吧

点评

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-21 11:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表