Making events that triggers separately when player enter a room

I want to make events (let's say 2 events) that trigger whenever the player enters a room.

I know how to make the events trigger, but I don't know how to make the events trigger only when the player enter the room.

For example:

Event X will trigger when character A & B is in the party
Event Y will trigger when character A, B & C is in the party.

Currently, I make it so that Event X will trigger first, and then the Event Y will play later using switches.

It works fine when the player only enter the room with character A & B and then come back when they added C into the party, but when the player enter the room with character ABC without triggering the Event X first, Event Y will play immediately which made it look rather awkward.

So, I'm hoping that when the player enter the room with character ABC, event Y will only triggered when the player re-enter the room.

Currently I'm tampering with the switches, but I don't really have the idea how to do exactly that, so I appreciate any ideas that I can get. Thank you so much 🙂
On the teleport event to the room, make conditional branches that check:
If A is in party:
If B is in party:
If C is in party - Yes, trigger event Y
If C is in party - No, trigger event X
@Milennin Thanks for replying 🙂
That works, but the thing is, when the player re-enter the place and still having character C in the party, event X won't triggered unless character C is out of the party. If it's possible, I want the event X still be triggered even though character C is still in the party.
If Self SwitchA is Off (Or use regular switches if needed, in case its spread over several Events)
if yes: If A is in party and If B is in party: Turn Self Switch A On and do EventX
else
If A is in party: and
If B is in party: and
If C is in party: than do EventY and than Turn Self SwitchB On
Self Switch B is the Eventpage Condition for the next empty Eventpage, so this Cutscenes doesnt happen again.

First EventX, later EventY, than nothing. Atleast it read like this in your first post. If something isnt like intended, please tell us.
@Bex Do you mean like this? (Second event page is empty)
cjWvLGD.jpg


If yes, then the event is still happening simultaneously (Event X is played, then immediately Event Y is played after it), which is not my intention.

For reference, @Milennin's suggestion works, but when character C is still in the party, Event X is not played. (Ideally I want Event X to be played even if character C is in the party, because character A & B is still in the party.)

I guess to simplify the if formula would be like this:

If character A + B is in the party = play event X, else if (player re-enter the room and character A + B + C is in the party) = play event Y

The important part is the "player re-enter the room" part, because without that, event Y will immediately played after event X (without the player re-entering the room) when the player have character A+B+C in the party. But I have no idea how to put the "player re-enter the room" condition in the conditional branch formula.
i see an error, you ask if event y is off, but you are not turning it on afterwards, you are turning on event x.
that would mean the else case never runs and the first case continues to run.

I use a Switch as condition, off is cutscene1, on is cutscene2
But i also include second condition: is char A and B in the party?
If both are true, than i turn the switch On, so next Time the other Cutscene Plays and this one doesnt repeat. Now i Play my first Cutscene.

Next Time i enter the Map, the Switch is On, and the else case is used:
but thistime we also have second condition, are actors a, b and c in the party?
if yes: Play Cutscene2 and activate the switch for second eventpage, so this event plays no more.

Edit:
I would put the Eventcommand "Erase Event" at the End, thatway the Eventcode runs only one time and than the Event is deleted until the map is reentered.
Edit2: The reentering problem comes thanks to cutscene on other map. You are changing the Maps for cutscene, that makes also a difference, and creates a need for slightly different conditions. Or to keep the code:

Maybe just execute the Eventcode like the other User mentioned, in the Events that teleport to that Map, not as autorun on that map. Just a thought... but than this error should not occure. and dont execute the code when teleporting from cutscene back to map.
@Bex So, I rewrite it using self switch as per your instruction, but the next scene still plays immediately. Where did I do wrong now?

sLRzooz.jpg

EjyGqkv.png



Edit: So, yeah, now that you mentioned it, the problem is most likely happened because the event is on another map, which makes the player re-enter the initial map automatically which then triggers the scene.

You said that this creates a need for slightly different conditions. What are you suggesting for the change, then?

Edit2: Finally figured it out. Using @Bex's formula and @Milennin's idea to put it on the teleporting event. It turned out the problem is I forgot to erase the scrapped autorun event that triggered after the player transferred back into the room from after the event which happened in the other room.
Thank you both for helping 😂
Good that it works now.
Conditions and Values which are changed depending on what happens ingame, are my answer.

If Switch"I come from Cutscene map is On"
turn switch Off and Erase Event.
else
The Code we allready got.

But if the current solution works, than maybe just stay with it, often there are a dozen Ways to do it.

Original thread: https://forums.rpgmakerweb.com/threads/making-events-that-triggers-separately-when-player-enter-a-room.107477/