How to make an event both parallel process AND event-touch?

As part of a real-time battle system, I have enemies (events) who have various pages which form a kind of state machine.

Page 1 is what happens when they spawn
Page 2 is their behaviour while they are alive
Page 3 is their behaviour when they die & despawn

The 2nd page above is a parallel process, as the logic each enemy is largely self-contained (they evaluate the situation and make decisions about what to do based on some simple conditions).

However, I also want the player to take damage if they touch an enemy.

I can't just have an "event touch" page, because obviously if that's to the right of the parallel page, that'll take precedence and page 2 won't work correctly.

I know I could do some logic to get the position of the event in Page-2 and compare it to the player's, but as I'm using pixel movement, that'll be complex as I'll need to work with the realX/realY of the characters.

Basically, I'm just asking, before I go down that route - is there any way to have an Event Touch page to the right of a Parallel page, which only activates upon touch?

EDIT: Realised that might get messy because I've got multiple enemies performing the check each frame, so I would have to do the entire thing as one script statement or they might happen on top of each other, "stealing" each others' variable data.

Is there no function I can call, e.g. checkTouch(player ID, event ID) to do this?
I think you should make the behaviour in movement, but the page itself should be "event touch" or "player touch" to take damage/attack them.If you want to make the moves more conditions'related, you should make other paraller event to move them, I think.
@EthanFox basically you can't.
the triggers are exclusive to each other, and only one page can be active on any one event.
theoretically you could handle this with two different events for each enemy, but that would cause a lot of other problems.

one possible solution (depending on what it does) is to move the parallel process into the autonomous movement of an event trigger page. That will process at the same time as the event trigger, but it is much more limited than a full page.

For more help I suggest you post screenshots of your event pages, then we can check if there are any workarounds.
@EthanFox basically you can't.
the triggers are exclusive to each other, and only one page can be active on any one event.
theoretically you could handle this with two different events for each enemy, but that would cause a lot of other problems.

one possible solution (depending on what it does) is to move the parallel process into the autonomous movement of an event trigger page. That will process at the same time as the event trigger, but it is much more limited than a full page.

For more help I suggest you post screenshots of your event pages, then we can check if there are any workarounds.
Thanks; yeah, the movement approach won't work, as my enemy logic is more than just a few movement commands, and I really don't want to have to use the "script" command for everything in that autonomous movement area.

I'm trying to see if, instead, I could use the exact positions of the two events in question, and get their distance apart in pixels - but right now I can only figure out how to get the distance between their tiles, which is no good for an action battle system.

I can't seem to find a workaround for this; has no-one ever written a plugin with a function in which you can supply 2 events, and it returns the pixel distance between the two sprites on the present frame? (not their tile coords)

EDIT: Ah, I think I might have figured it out; the scrolled coordinates do this.
EDIT : Removed; I missed something obvious 😀
Hi,
Could you use "realX" and "realY" of your events ?
I have never tried it but it could be a little more precise than the tiles coordinates.

As I understand you want your player to receive damage when it touches enemies. If you have a third event that checks the positions of the enemies and the player it should work, shouldn't it?

I did this in a training game where I use a mobile crane. you should not pass over other people, so I had an event wich at each frame checked the position of the hook and the position of every other character.
Hi,
Could you use "realX" and "realY" of your events ?
I have never tried it but it could be a little more precise than the tiles coordinates.

As I understand you want your player to receive damage when it touches enemies. If you have a third event that checks the positions of the enemies and the player it should work, shouldn't it?

I did this in a training game where I use a mobile crane. you should not pass over other people, so I had an event wich at each frame checked the position of the hook and the position of every other character.
Thanks! In the end I figured it out and wrote a small plugin, where you can call a function and give it the IDs of two events alongside a pixel distance, and it'll return TRUE if they're closer than the distance or FALSE if further apart.

At some point I'll post it up; it's a very short plugin but it might save someone an hour.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-event-both-parallel-process-and-event-touch.141178/