MZ "flying" enemy that still attacks characters

1770647610955.png


I'd like to have a flying enemy (hence the "through" checked above, it goes through elements of the landscape that aren't normally passable) that still triggers a battle when touching the characters, the problem is that checking "through" makes it go through the characters as well (without triggering the encounter). If I remove through, it's not like it's flying anymore.
Is there a way around this that I'm missing?
Do you use Visustella plugins? I recall you maybe did--since there's a notetag in Events and Movement core that lets you decide a region ID where an enemy can move, which bypasses terrain passability, but keeps event collision which sounds like it might be what you were looking for in place of through!

1770648117944.png
That's tricky. Here's how I did it:

temp.png


There's some custom stuff in there.

  • this.checkPlayerHere() is basically shorthand for this.character(0).pos($gamePlayer.x, $gamePlayer.y)
  • this.checkAnyFollowerHere() is runs the above check for each follower (substituting for $gamePlayer.
  • this.touchedFollower() is from HIME_FollowerEventTouch. I don't know if that works in MZ.

Of course, if you don't want the event to trigger when it touches a follower, you can ignore points 2 and 3. Similarly, the direction check for Force Preemptive is not strictly part of this (actually, it's buggy).

Original thread: https://forums.rpgmakerweb.com/threads/flying-enemy-that-still-attacks-characters.182369/