Project1

标题: 有没有资源采集系统? [打印本页]

作者: lirn    时间: 2013-5-11 11:25
标题: 有没有资源采集系统?
本帖最后由 lirn 于 2013-5-13 10:36 编辑

就是关于可重复采集
通过等待多少帧,或者公共开关变量的方法,我懂,但是这些东西各有缺点。等待多少帧的话与剧情行进无关,暂时消失一切换地图就会重置,公共开关变量的话数量一多起来就会很麻烦。

有没有其他方法可以在睡一觉才会重置这类事件的方法?
作者: 光の異形    时间: 2013-5-11 11:28
就是说 等一定时间 资源才可以再生再调查时才能得到 这样吗?
感觉是一个真实的 时间系统嘛 其实 蛮简单的
作者: 光の異形    时间: 2013-5-11 12:42
本帖最后由 光の異形 于 2013-5-11 13:10 编辑

我懂了 就是采集过了的 就没有了 其他的还在 然后  要等剧情 才一起全部刷出来 这样啊  等我想想 马上好

话说 怎么样都 不能做得很简单呢

不过可以做到 减少暂用的 开关和变量
作者: Sion    时间: 2013-5-11 17:38
  1. # 说明:
  2. # 事件中插入脚本 collected ,启动后事件消失
  3. # 要刷新全部采集事件,事件中运行脚本 refresh_collected


  4. class Game_Event
  5.   alias conditions_met_2013_5_11? conditions_met?
  6.   def conditions_met?(page)
  7.     return false if $game_self_switches[[@map_id, @id, :collected]]
  8.     conditions_met_2013_5_11?(page)
  9.   end
  10. end

  11. class Game_Interpreter
  12.   def collected
  13.     $game_self_switches[[@map_id, @event_id, :collected]] = true
  14.   end
  15.   def refresh_collected
  16.     $game_self_switches.refresh_collected_events
  17.   end
  18. end

  19. class Game_SelfSwitches
  20.   def refresh_collected_events
  21.     @data.delete_if {|key| key[2] == :collected}
  22.   end
  23. end
复制代码

作者: lirn    时间: 2013-5-11 17:58
Sion 发表于 2013-5-11 17:38



使用方法是这样吗?
作者: 光の異形    时间: 2013-5-13 08:31
Sion 发表于 2013-5-11 17:38

  虽然吾辈也知道怎么用 地图ID 事件ID 来定位操作事件

不过 这不是吾辈最想要的脚本版本吗? 超级有用啊 ~!!!!!!!!!

只用来资源采集系统绝对是可耻的浪费啊 ·····················




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