| 
 
| 赞 | 15 |  
| VIP | 320 |  
| 好人卡 | 64 |  
| 积分 | 3 |  
| 经验 | 112963 |  
| 最后登录 | 2022-8-25 |  
| 在线时间 | 2355 小时 |  
 Lv2.观梦者 (暗夜天使) 
	梦石0 星屑266 在线时间2355 小时注册时间2009-3-13帖子2309 
 | 
| 本帖最后由 Sion 于 2013-2-22 21:22 编辑 
 获取玩家前面的事件id:
 放在Game_Interpreter类里可以方便调用。当然一堆事件重叠在一起只能得到其中一个的id,我估计是id最小的一个。复制代码class Game_Interpreter
  def get_front_event_id
    x2 = $game_map.round_x_with_direction($game_player.x,
      $game_player.direction)
    y2 = $game_map.round_y_with_direction($game_player.y,
      $game_player.direction)
    $game_map.events_xy(x2, y2).each {|event| return event.id}
    return -1
  end
end
 改了一下……让前面没有事件的时候返回-1
 | 
 |