赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 25243 |
最后登录 | 2017-9-29 |
在线时间 | 35 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 35 小时
- 注册时间
- 2008-6-23
- 帖子
- 275
|
5楼
楼主 |
发表于 2014-8-19 13:50:26
|
只看该作者
弗雷德 发表于 2014-8-19 11:55
设置里不是有吗?
# 设置触发确认 $game_map.events[@event_id].le_true = true/false
我希望在脚本中设置,而不是在事件里设置。
我在def see下面添加了一句(红色部分),假设事件1是敌人,当角色接近后事件1确实显示了动画。但是如果在事件1和角色当中加上一个障碍物事件2,虽然角色被障碍物遮住事件1同样会显示动画,我希望事件1没发现角色的时候不要显示动画
def see
@le_true = false
if ($game_player.x-@x).abs<@le_deepness and ($game_player.y-@y).abs<@le_deepness
difference_x = ($game_player.x - @x).abs
difference_y = ($game_player.y - @y).abs
case @direction
when 2
return if @le_circle != true and $game_player.y < @y
unless @le_side and (difference_y == 0 and difference_x == 1)
return if difference_x.to_f/difference_y > @le_slope
end
when 4
return if @le_circle != true and $game_player.x > @x
unless @le_side and difference_y == 1 and difference_x == 0
return if difference_y.to_f/difference_x > @le_slope
end
when 6
return if @le_circle != true and $game_player.x < @x
unless @le_side and difference_y == 1 and difference_x == 0
return if difference_y.to_f/difference_x > @le_slope
end
else
return if @le_circle != true and $game_player.y > @y
unless @le_side and difference_y == 0 and difference_x == 1
return if difference_x.to_f/difference_y > @le_slope
end
end
if @le_mode == 0
return if (difference_x ** 2 + difference_y ** 2) > le_deepness ** 2
end
@le_true = scan_line
$game_map.events[@id].animation_id = 98
if @le_ss and @le_true !=true
@le_trace[0,0] = -1
end
end
end |
|