Checking if Self Switch of another event is active?

Hello!

Currently I'm trying to avoid the use of 'normal' Switches and instead try to use Self Switches as far as possible, which I set via Script Calls. Now I wonder if there is a way to check if the Self Switch of another event is set to a specific Value (A/B/C/D). In the Conditional Branch window there is an Input field for Scripts, but what do you have to enter?

I tried different syntax, for example

if ($gameSelfSwitches.isValue([$gameMap.mapId(), 002, 'A'] = true))

but apparently none of my variations work.

Could anyone enlighten me, please?
There are multiple errors in your example.

The syntax is:

$gameSelfSwitches.value([mapId, eventId, switchId]);Also, comparison is done with "==". What you are doing is assigning a value to another value, which should give an error.So, your example would look like this:

Code:
if($gameSelfSwitches.value([$gameMap.mapId(), 2, 'A'])) {...}
You can leave the "== true", since an "if" expression is automatically evaluated as a boolean value.
Hello lavra,

thank you so much for your quick answer! It worked, both in the Event Command and via ScriptCall 🙂 Your post was also pretty informative.

Thanks again!

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-self-switch-of-another-event-is-active.52603/