Project1

标题: 请问独立开关和地图事件的问题 [打印本页]

作者: bear001    时间: 2014-5-17 04:18
标题: 请问独立开关和地图事件的问题
本帖最后由 bear001 于 2014-5-17 04:30 编辑

请问独立开关能否修改成更多选择吗?
另外弱弱的问一下请问游戏进行中时有什么方法把某个地图事件自动完全删除掉,不能用事件页切换成隐形那种因为可能在一样的地方生成其他事件。。(怕重置)
作者: 机械守护者    时间: 2014-5-17 08:26
好像小海龟有拓展独立开关的脚本,善用搜索?
在编辑器内实现可视删除大概不行,但是你可以创建一个事件在他旁边,我等凡夫俗子看不出这有什么影响。
作者: bear001    时间: 2014-5-17 11:54
就是地图事件A变成地图事件B。。。
   我会想要这方法是因为我用了XAS脚本,然后我想做个能随机生成XAS敌人事件之后我发现XAS敌人打死过后无法消除。。。
作者: bear001    时间: 2014-5-17 18:11
现在我找到了一个英文版的扩展独立开关研究了很久不懂怎么用
有哪位大大能帮帮忙吗。。。。。

RUBY 代码复制
  1. #===============================================================================
  2. # More Self-Switches (VX Ace Edition)
  3. # Version 1.0
  4. # Author game_guy
  5. #-------------------------------------------------------------------------------
  6. # Intro:
  7. # Ever need more than 4 self switches? With this small script, you can now
  8. # have as many self switches you want. You aren't just limited to letters
  9. # either. You can have names for them.
  10. #
  11. # Features:
  12. # -More Self Switches
  13. # -Name them whatever
  14. #
  15. # Instructions:
  16. # -First, lets create a self switch for our event. Anywhere in the event, add
  17. # a comment and type this,
  18. # Switch:switch_name.
  19. # switch_name can be whatever you want to name the switch. Thats all you have
  20. # to do to create a self switch for that page.
  21. # There cannot be any spaces between the colon and the switch name.
  22. # e.g. Switch: switch - Does not work.
  23. # e.g. Switch:switch - Does work.
  24. #
  25. # -Now to turn this switch of or on, call this in a script call.
  26. # self_switch("switch", true/false)
  27. # switch is the switch name, this must be in double " " or single ' ' quotes.
  28. # true/false tells the script whether to turn it off or on. true = on,
  29. # false = off.
  30. #
  31. # -If you want to see if a self switch is on/off, use this script in a
  32. # condtional branch.
  33. # self_switch_state("switch") == true/false
  34. # switch is the switch name, this must be in double " " or single ' ' quotes.
  35. # true = on, false = off
  36. #
  37. # Compatibility:
  38. # Should work with anything.
  39. #
  40. # Credits:
  41. # game_guy ~ For creating it.
  42. #===============================================================================
  43.  
  44. class Game_Event < Game_Character
  45. alias gg_init_more_switches_lat initialize
  46. def initialize(map_id, event)
  47. gg_init_more_switches_lat(map_id, event)
  48. @event.pages.each {|page| page.list.each {|command|
  49. if [108, 408].include?(command.code)
  50. command.parameters.each {|p| check_custom_switch(page, p) }
  51. end}}
  52. refresh
  53. end
  54. def check_custom_switch(page, code)
  55. a = code.split(':')
  56. if !a[0].nil? && a[0].downcase == "switch" && a[1] != nil
  57. page.condition.self_switch_ch = a[1]
  58. page.condition.self_switch_valid = true
  59. end
  60. end
  61. end
  62.  
  63. class Game_Interpreter
  64. def self_switch(switch, state)
  65. if @event_id > 0
  66. key = [$game_map.map_id, @event_id, switch]
  67. $game_self_switches[key] = state
  68. end
  69. $game_map.need_refresh = true
  70. end
  71. def self_switch_state(switch)
  72. key = [$game_map.map_id, @event_id, switch]
  73. return $game_self_switches[key]
  74. end
  75. end

作者: moy    时间: 2014-5-17 20:17
bear001 发表于 2014-5-17 18:11
现在我找到了一个英文版的扩展独立开关研究了很久不懂怎么用
有哪位大大能帮帮忙吗。。。。。

使用注释功能,在注释中写入
  1. Switch:switch_name
复制代码
来新建一个独立开关,中间不能有空格
使用脚本功能,用下面的方法开关这个开关
  1. self_switch("switch_name", true)
  2. self_switch("switch_name", false)
复制代码
任何需要判断的时候,使用脚本的
  1. self_switch_state("switch_name")
复制代码
获取开关的状态。
作者: garfeng    时间: 2014-5-17 20:17
如果独立开关太少,就给这个事件设置一个变量。变量初始值设置大一点,每-1,该事件向下进行一个事件页。

你还可以用这一个变量控制整个游戏的流程,控制整个游戏的所有事件。




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