查看: 4868|回复: 4

[转载发布] 根据VA脚本移植的XP战斗中执行並行

[复制链接]
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2019-6-12 18:11:07 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 soulsaga 于 2019-6-12 18:28 编辑

[pre lang="ruby"]class Scene_Battle
  alias battle_main main
  def main
    pces = $data_common_events.select {|event| event && !event.nil?}
    @common_events = pces.collect do |common_event|
      Game_CommonEvent.new(common_event.id)
    end
    battle_main
  end
  alias battle_update update
  def update
    @common_events.each{|event|event.refresh; event.update}
    battle_update
  end
  end
    [/pre]
梦石
0
星屑
15056
在线时间
2230 小时
注册时间
2019-1-24
回帖
964

R考场第七期纪念奖

发表于 2019-6-13 18:45:04 | 显示全部楼层
执行并行什么意思
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
 楼主| 发表于 2019-6-13 18:49:51 | 显示全部楼层
本帖最后由 soulsaga 于 2019-6-13 18:52 编辑
miantouchi 发表于 2019-6-13 18:45
执行并行什么意思


默认系统在战斗中执行並行的公共事件並没有效果..插了这脚本就可以用了..
不过因为是所有並行的公共事件都会自动执行..所以有必要加条件例如公共事件名称含有"战斗"才执行..
[pre lang="ruby"]def update
    @common_events.each{|event|event.refresh; event.update if event.name.include?("战斗")}
    battle_update
  end[/pre]

这样就更好使了..
回复

使用道具 举报

梦石
0
星屑
9160
在线时间
466 小时
注册时间
2015-5-8
回帖
704
发表于 2022-1-2 17:21:42 | 显示全部楼层
soulsaga 发表于 2019-6-13 18:49
默认系统在战斗中执行並行的公共事件並没有效果..插了这脚本就可以用了..
不过因为是所有並行的公共事件 ...

大神你的这个def update是不是会在一场战斗中从头到尾每0.00000001秒都会调用一次啊?
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
 楼主| 发表于 2022-1-2 18:19:22 | 显示全部楼层
本帖最后由 soulsaga 于 2022-1-2 18:21 编辑
taeckle 发表于 2022-1-2 17:21
大神你的这个def update是不是会在一场战斗中从头到尾每0.00000001秒都会调用一次啊? ...


是吧...应该没有影响吧?再不行你用开关分岐也行..
公共事件要求开关打开
你的事件执行完后关闭开关
class Scene_Battle
def main
里把开关打开...
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部