All Event images activate sharing a Switch [Solved!]

Hello, I was trying to do what felt like a simple task, but has become a bit of a head scratcher. I would like to setup an event on the Overworld where when the character steps on a square, it triggers a battle. I have all the events sectioned off a portion of the map so that whenever the character tries to cross a certain section, they get a guaranteed encounter. The encounter is "scripted" to lose, but not game over. I created a conditional branch where the character loses, it goes back to the overworld where the character wakes up and has 2 things of dialog. So I changed the Event image to reflect the laying down character and then stands up in the next event page. My issue is, by doing it this way, all of the squares sectioning off the map for the character to cross, are all seeing the character lay down and stand up because they are all attached to the same switch that gets activated when the battle is finished. I want to set it so that only the square that the character stepped on shows the animation and it turns the event off for all the squares afterwards. I'm assuming something like this can be achieved by checking Player X + Y coordinates but, I haven't been able to figure out how to do that yet.

Alternative, I could just do away with those two images and have the character standing normally on the overworld map and not confuse myself anymore xD

EDIT: Solved! - Post #5
Best to show us your event page set up so we can help.

So if I understand this correctly, you want so when the player lands on tile, (let's call it the tile 1) they will enter a battle, scripted to lose, then battle ends, return to overworld but are laying down like they been defeated, but after 2 lines of Dialog, they get back up to standing and normal?

But the issue is all the other tiles, Tile 2, 3,4 etc are making the character laydown when stepped on?


So you just want Tile 1 to trigger the lay down and Tiles 2 onward don't?

Have you tried self switches and like 1 normal switch called laydown?

Have 2 Events.

So Event Tile 1 (The event with the Encounter on)
_______________
Page 1
Battle process
When loss
Self Switch A on
Laydown Switch On
Page 2

Condition "Self Switch A on"

(Then copy these tiles for the border)

_____________________________________

Event 2 Laydown
Condition "Laydown switch on"
Change actor graphic to laydown
Message box oww that hurts etc.
"Laydown Switch" off
I could be misunderstanding that you want to do, but here is what I would try.

If I wanted say 8 tiles that could possibly trigger the same scripted combat only once, I would make an event like this:

Page 1 - Triggers the combat (touch) - At end of page turn on self-switch A to go to page 2
Page 2 - Triggers the laying down and dialog or whatever (autorun) - At end of page turn on self-switch B to go to page 3
Page 3 - Triggers the standing up and dialog or whatever (autorun) - At end of page turn on self-switch C to go to page 4
Page 4 - Event is turned off (no content - not autorun or parallel)

I would copy and paste the event for all 8 tiles.

At the end of page 3, I would use a script to turn on self-switch C for ALL 8 events on the 8 tiles. So there would be 8 scripts.

So once one of the events is triggered, when it finishes, all of the events are now turned off and won't be triggered. So it doesn't matter what event tile the player steps on. All the Events end up on Page 4 and can no longer be triggered.

Here is the script:

$gameSelfSwitches.setValue([47, 1, 'A'], true);

47 = Map ID

1 = Event Number on the Map

A = Which Self Switch

True = On

False = Off

Scripts are case sensitive.

I hope that helps and makes sense.
The problem you have is that you want two different effects on the same events - that needs two different switches to handle.

The easiest way would probably with a regular switch and a self-switch.

the first page would probably your cutscene and battle, and at the end of that sequence you turn on both a regular switch (like you're doing now) AND a self-switch.
The regular switch would activate page 2 (important) and be an empty field, disabling the triggers.

The self-witch would activate page 3, but due to the way self-switches work only for the event that had the battle. And that would be the actor lying down and standing up and so forth

Te page numbers are important here due to page priority preventing the wrong pages to be active.
The problem you have is that you want two different effects on the same events - that needs two different switches to handle.

The easiest way would probably with a regular switch and a self-switch.

the first page would probably your cutscene and battle, and at the end of that sequence you turn on both a regular switch (like you're doing now) AND a self-switch.
The regular switch would activate page 2 (important) and be an empty field, disabling the triggers.

The self-witch would activate page 3, but due to the way self-switches work only for the event that had the battle. And that would be the actor lying down and standing up and so forth

Te page numbers are important here due to page priority preventing the wrong pages to be active.
That worked! Having the second page be empty seemed to do the trick! I'll post what my event page looked like for those that are curious.

Original thread: https://forums.rpgmakerweb.com/threads/all-event-images-activate-sharing-a-switch-solved.170026/