On Map Enemy Encounters / Event Interaction

Hi everyone!

In my game, I have a mostly working system where enemy sprites appear on a map, and wander in a general vicinity. Using Yanfly's Event Mini Label, I've flagged each with the enemy's name and a colored ♦ symbol to indicate whether the enemy is passive or aggressive (♦ Goblin Bandit = aggressive, ♦ Bumblebee = passive, etc). Enemies that are aggressive can be avoided by staying out of a certain radius, which varies for each enemy. Passive enemies can be fought completely at the player's discretion, but the player can choose to walk past them entirely without worry of being attacked. Once a player engages in, or is engaged in, battle - they will enter into a Sideview Battle. When the enemy is defeated, the sprite will vanish, and it may or may not drop a treasure chest on the map. Once the chest is opened, it vanishes. Either way, the enemy will reappear on the map after approximately 30 seconds. If it's aggressive, the player will have a 5 second grace period to get away from it if they chose, so things aren't attacking them out of thin air.

That much, I have working just fine - but there's a couple of small holdups I have with it - specifically in regard to passive enemies.

Simply, I don't want them blocking narrow passageways. My first thought was to make the enemy appear "below" the party, but it looks kind of goofy. Plus, I don't like standing on top of the enemy, attacking it, and then having the chest appear below the party members. Seems and feels like crappy design to me. Putting enemies "above" the character looks nice for bats and birds, but obviously not the pedestrians of the world. But unfortunately, it seems you have to be UNDER such an event to trigger it, and then there's the issue of the chest appearing on the same tile as the party again.

Ideally, I think I want a way to walk through passive events, but not be able to engage/trigger the event if I'm on the same tile as it.

Anyone have any ideas/solutions? Would love to hear. 🙂
Check Yanfly's Region Restrictions to avoid having them block narrow passageways- he even covered it in one of his tip videos.

Beyond that, you could try making an event that has the "touch" type, but internally you split the event contents in two with a conditional- "is player pressing the action button."

If they are pressing the button, then they're trying to interact. Else, they're trying to go through, and you could... I dunno, give them a custom move route (does not wait for completion) that waits for a quarter-second, toggles the "through" (i.e. pass-through) flag to ON, waits a second and a half, then flips it back to OFF. In theory, something like that makes the event 'fade' if you just ram into it, letting you move through after a moment. (The initial wait before fading is to make it easier to manually interact with the event if you happen to run into it before you press the button).

Could get tedious to put in every event, though, and I haven't tested if that setup works yet.
Beyond that, you could try making an event that has the "touch" type, but internally you split the event contents in two with a conditional- "is player pressing the action button."

If they are pressing the button, then they're trying to interact.
Minor problem with this: imagine the player is facing down but holding the action button, and the enemy bumps into them from the side. I think you'd want to check whether the player is facing the event as well.
Minor problem with this: imagine the player is facing down but holding the action button, and the enemy bumps into them from the side. I think you'd want to check whether the player is facing the event as well.

Collision modes are something like:
Action Button: Must be facing / on top of the event and press the button.
Player Touch: Same as Action Button, or the player moves on top of / tries to move into the event.
Event Touch: Same as Player Touch, or the event moves on top of the player / tries to move into the player.

Where each mode adds a new way to activate in addition to the previous. I'm making the assumption that he's using Player Touch for neutral events, and that you can't "push through" an enemy.

But if you want to be able to "push through" enemies using this, yes, you would need to account for facing directions- I'd suggest event encounter aid in that case.
Ah, my mistake, I misread the context and somehow thought we were talking about Event Touch. 😴

Original thread: https://forums.rpgmakerweb.com/threads/on-map-enemy-encounters-event-interaction.96324/