interactive moving events 'above character'

hi,

so in my game, the monsters you encounter are events (not random encounters) - and they are land, sea or air-based. So, for birds, for example, I want them to be able to fly over the scenery (e.g. trees), but still engage in battle with the character on contact. (some move randomly, some towards the char, but that's not really important)

If I set the event to 'above character', and 'through', they fly as I want them to, but the 'Event touch' doesn't trigger very reliably.
If I set the event to 'same as character', and 'through', they end up flying behind certain parts of the scenery and over others.

Without through, they just don't fly over anything at all.

Is there a way to do this? Am I missing something?

Thanks in advance.
Try adding this snippet in your project.
Spoiler: Click to see the code
Code:
class Game_CharacterBase
 
#======================New method==========================================
  def above_priority?
    @priority_type == 2
  end
#=========================================================================

#=====================Original method edit================================
    def move_straight(d, turn_ok = true)
    @move_succeed = passable?(@x, @y, d)
    if @move_succeed
      set_direction(d)
      @x = $game_map.round_x_with_direction(@x, d)
      @y = $game_map.round_y_with_direction(@y, d)
      @real_x = $game_map.x_with_direction(@x, reverse_dir(d))
      @real_y = $game_map.y_with_direction(@y, reverse_dir(d))
      increase_steps
      check_event_trigger_touch(@x, @y) if above_priority?
    elsif turn_ok
      set_direction(d)
      check_event_trigger_touch_front
    end
  end
#===========================================================================

end

class Game_Event < Game_Character
 
#=====================Original method edit================================
  def check_event_trigger_touch(x, y)
    return if $game_map.interpreter.running?
    if @trigger == 2 && $game_player.pos?(x, y)
      start if !jumping? &&   (normal_priority? || above_priority? )
    end
  end
#===========================================================================
end
Seems the default engine checks for event touch only with normal priority events, which is why I edited it a little. And for being a "Through" event, I altered it so it checks for touch event even in succeseful movement, as long the moving event is above player priority. Hope it helps.
Hey. Thanks for the reply. It looks great.

I'm not so hot when it comes to scripts, so can you tell me where i should put this? It looks like it's more than just a copy/paste job 🙂
It is just copy and paste job 🙂. It is in Tools > Script editor, under ▼ Materials, above ▼ Main Process.
Copy paste it there, then try again. The event must be above player priority, "event touch" trigger, and "Through" enabled so the event(your flyer monster) is able to fly over other events and the player.
The 'through' is still causing me problems. Without it, it works perfectly with 'above character' selected, but when i put 'through' on, i still find it hard to make contact with the event - the event literally goes 'through' me when i approach it. after a few tries, i can make contact, but it's not ideal 🙁
Wait, did you added my snippet?
It won't work if you don't.
yes, I added it 🙂 My comments were about the game after I added the snippet.
That's weird. For me it works perfectly. Every single touch activates the event's active page.
Edit: Is your game with enabled diagonal movement? Or other script?
I think I've fixed it now.

Thanks so much for your help - that was awesome 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/interactive-moving-events-above-character.95272/