Self switches in common events

So I evented a rather complex portrait system for myself, which can show up to two people on the screen at a time.

To determine whether this character is on the left or right side of the screen, I use a self switch in the common event that controls the way the images will be displayed.

This all worked until I realized the self switch wasn't working for the common event, but in the map event it was called in. If a common event calls another common event that utilizes a self switch, it just doesn't register.

So:
Map event > calls common event with a self switch = works okay.
Common event > calls common event with a self switch = doesn't work.

Any options I can explore here? It really relies on the self switch for it to work, otherwise I'm going to have to create a unique switch for every single character I have, and the self switch eliminated all of this work. Can I really not use self switches in common events that are tied to the common event, and not a map event?
Use a variable instead, I would think. They tend to be more flexible and in a sense can be a much larger amount of self switches
Using a variable, I'd have the same issue - it's not self contained. If it was a self variable, that would be different ...
I had seen and replied to your tweet, but I'm expanding the response here:

The only reason why self-switches don't work on common events is because they were made to apply to the event that called the common event on purpose. It's very simple to change that behavior with a plugin.

I wrote this code to change that behavior:



Adding that as a plugin should make the game work the way you want it to.
Hah, didn't check my tweets yet! Gonna test this out now 🙂

Hmm no, there's no change. Self switches do not register if a common event calls another common event that uses a self switch.

Edit: Hudell was nice enough to help me out, and he added some changes to make it work. You can get the plugin here.

Original thread: https://forums.rpgmakerweb.com/threads/self-switches-in-common-events.75109/