查看: 1635|回复: 3

[已经解决] 这段脚本能否放进事件脚本框里?

[复制链接]
梦石
0
星屑
50
在线时间
231 小时
注册时间
2007-12-17
回帖
384
发表于 2013-1-8 09:36:59 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 stella 于 2013-1-8 10:10 编辑

有点长,如何压缩?

[pre lang="ruby" line="1"]b=($game_party.actors[
0].hp).to_f/($game_party.actors[0].maxhp).to_f
a=[];for i in 11..14
name = $game_map.events.name
data=name.split(/,/)
if data[1].to_i <= 0;a=2
else;a=data[1].to_f/data[2].to_f;end
end;for i in 1..10
next if $game_self_switches[[
$game_map.map_id,i,"D"]]==true or
$game_map.events.character_name == ""
if a.min==1 or a.min>b;$friend14_target=0
elsif a.min == a;$friend14_target = i
end;end[/pre]
梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
回帖
1296
发表于 2013-1-8 10:07:01 | 显示全部楼层
上面加个def xxx,下面加个end,丢脚本编辑器里,然后事件里就输入xxx就行了- -b
好歹当年也当过大魔王过,orz
回复

使用道具 举报

梦石
0
星屑
275
在线时间
1373 小时
注册时间
2005-10-16
回帖
5038

贵宾

发表于 2013-1-8 11:47:14 | 显示全部楼层
  1. c=$game_party.actors[0]
  2. b=c.hp*1.0/c.maxhp;a=[];for i in 11..14
  3. data=$game_map.events[i].name.split(/,/)
  4. if data[1].to_i <= 0;a[i]=2;else
  5. a[i]=data[1].to_f/data[2].to_f;end;end
  6. for i in 1..10;
  7. next if $game_self_switches[[\
  8. $game_map.map_id,i,"D"]]==true or\
  9. $game_map.events[i].character_name == ""
  10. if a.min==1 or a.min>b;$friend14_target=0
  11. elsif a.min == a[i];$friend14_target = i
  12. end;end
复制代码

评分

参与人数 1星屑 +66 收起 理由
hys111111 + 66 感谢回答

查看全部评分

我只个搬答案的
叔叔我已经当爹了~
婚后闪人了……
回复

使用道具 举报

双子人

梦石
0
星屑
3205
在线时间
3619 小时
注册时间
2009-4-4
回帖
3901

开拓者

发表于 2013-1-8 13:28:04 | 显示全部楼层
亿万星辰 发表于 2013-1-8 11:47

大概可以分开放进去的吧,像这个样子。
null15.jpg
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部