One small problem with a simplified paper mario like encounter system

Paper Mario has a bunch of different ways to trigger an enemy encounter on the overworld:
1. Run into a enemy or let the enemy run into you, which starts a battle without any suprise or preemptive attacks.
2 Press a certain button to jump on the enemy, which will make Mario do Jump Damage right at the start of the battle usually to a single enemy.
3. Press another certain button to attack an enemy with the hammer, so Mario does hammer damage at the start of the battle to a single enemy.
4. Press another certain button or control stick direction to let your partner character attack the enemies inside the triggered battle.
5. Let the enemy attack you and receive damage at the start of the battle. There are enemies with distance and nearby attacks.

I've tried to implement the first 3 types to encounter an enemy as a first simple test using event commands only with just a view script calls.
The first one was easy:
Encounter Enemy.PNG
I've just set event touch, so it triggers when the event touches the player or the player touches the event.

The other two kind of encounters I've tried to implement as a parallel event.
Basically if I press shift and the event is right next to the player in the direction the player faces, then I want to perform a slash attack. If I press space or any key map to 'OK' I want to shoot a fireball with a range of two movements in the direction the player faces and if it hit an event I want to perform a fire magic skill on it.
Therefore I have the following troop event:
Troop Event.PNG
The parallel event looks like this:
Parallel Event 1.PNG
Parallel Event 2.PNG
Parallel Event 3.PNG
Parallel Event 5.PNG
Parallel Event 6.PNG
And the fireball event looks like this:
Fireball.PNG

And everything is almost working except one tiny problem:
If the enemy event is right next to the player and I press shift or space it can still trigger the 'Enemy touch' encounter before the encounter from the parallel event which can be seen after fleeing from the battle and right after that the parallel event encounter is triggered. I just want only the parallel event encounter to be triggered.
How can I do this?

I've read multiple times in other threads that everything should be controlled by a single event (at least every cutscene), but I've already tried out to let the parallel event also cover the normal encounter, but it didn't work, because the enemy event and the player cannot have the same position at the same time. Event touch on the other hand triggers if they would have the same position after either the event or the player performed their movement, but after the battle they would still have the same position as before.
I guess I figured it out myself.
First of all 'OK' was not the best button to test this with, because if I would have read the small pop-up tool tip on the event trigger I would have known that 'Event touch' also triggers when pressing the 'OK' button and the event is next to me. So I've changed that to 'Page Down' for my test map.

It seems I've also managed to make the event stop running into the player by locking it before the battle starts and unlocking it when the player flees from battle. Don't know if this is the best solution, but it works.
1650968625222.png

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/one-small-problem-with-a-simplified-paper-mario-like-encounter-system.147068/