Keys in Self Switches for Events and Objects

I was trying to access the self switch via a script code and here's how I did it:

$gameSelfSwitches.setValue([1, 7, 1], true);[1, 7, 1] is my mapID, eventID, and self switchID.

Now here's my problem.

atAYHEH.png


I have an event where I have two pages. The first one is the main page and the second page would only work if self switch A is activated. So I am trying to access the selfSwitch of this event on an another event, where in the script command I placed that code above.

It should be able to turn on Self Switch A of this event so automatically it goes away as it is being erased. Where did I went wrong?

Also, I would like to ask if this code is placed on game_event, how would I know the current map's id where the player is in?
Your self switch has the id 'A', not 1, so the correct call would be:

Code:
$gameSelfSwitches.setValue([1, 7, 'A'], true);
Oh my, I was wrong 😮

Thanks a lot. I thought switches had to do with numbers as representations. 🙂
switches do, but not self switches.


The current map is $gameMap.mapId() or this._mapId (the first one will work in an event command and in a move route command, the second one will only work in an event command)


The current event is eventId() (from an event command) or eventId() (in a move route command)


There is no "current self switch"

Original thread: https://forums.rpgmakerweb.com/threads/keys-in-self-switches-for-events-and-objects.51563/