Self Switch check via script call?

Okay, so in VX Ace, you could use
Code:
$game_self_switches[[map, event, 'self_switch']] = value
to manipulate an event's self switch. For example:
Code:
$game_self_switches[[@map_id, 7, 'C']] = true
would change event 7 on the current map's self switch "C" to "On," since in that code @map_id referenced the current map.

So, my question is, I suppose, two-fold.

1) What is the value identifier for the parameter that references the current running map? (such as @map_id in VX Ace)
2) What is the script call for the command to manipulate (or at least read) an event's self switch boolean?

Thanks for your time, and I hope someone here can help me out! I searched through the .js files, but the self switch functions there within provide VERY little insight on how to manipulate or read them (either that or it's just so nested that I can't quite make heads or tails of it 😛 )
If you are running this through a Script command in an event (and not a Script command in a move route), I think it will be something like this:

Code:
$gameSelfSwitches.setValue([this._mapId, 7, 'C'], true);

I don't have my laptop with me so I can't test that out.

This might be of interest to you:
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/
Nevermind, found the answers! Just had my syntax wrong and was looking for the wrong info in the .js files 😛
But the answers are

1) $gameMap._mapId (or $gameMap.mapId() )
2) $gameSelfSwitches.Value([$gameMap._mapId, EventID, 'A/B/C/D']); to read
$gameSelfSwitches.setValue([$gameMap._mapId, EventID, 'A/B/C/D'], true/false); to write

ex: $gameSelfSwitches.setValue([$gameMap._mapId, 6, 'B'], true); would set event 6 on the current map's B self switch to "True."
If you are running this through a Script command in an event (and not a Script command in a move route), I think it will be something like this:

Code:
$gameSelfSwitches.setValue([this._mapId, 7, 'C'], true);

I don't have my laptop with me so I can't test that out.

This might be of interest to you:
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/

Yup thanks! I hadn't refreshed this before I wrote my prior reply, but you're pretty close! The call was dead-on, and the map ID was close (it uses $gameMap._mapId, but maybe this. works as well, just haven't tried it).

Thanks for your response! Wish I'd refreshed this page half an hour ago haha.
this._mapId will also work if you're calling it in a Script call.

Script calls are run by Game_Interpreter, which has a _mapId variable.
I'm not sure if I should ask here or start a new thread. i have the same question but I can't get your answers to work.

Map Id: 014,
Event Id: 038,
Self-Switch 'A' : check is it on?

I'm using MV and trying to read if a self-switch is TRUE and then do something in a conditional if-then.
I'm using an autorun event that runs this code in a script call. This autorun then deletes, so not running forever. The MV event window looks like:

If : Script : $gameSelfSwitches.Value([014, 038, 'A']);
Text : None, Window, Bottom
: : Sample Text
: End

I get Type Error. undefined is not a function

I also tried: $gameSelfSwitches.Value([$gameMap._mapId, 038, 'A']); = undefined is not a function
I also tried: $gameSelfSwitches.Value([$gameMap.014, 038, 'A']); = unexpected number
I also tried: $gameSelfSwitches.Value([$this._mapId, 038, 'A']); = $this not defined
I also tried: $gameSelfSwitches.Value([this._mapId, 038, 'A']); = undefined is not a function

Obviously, I dont understand what the code is doing. Is there some way to provide an ACTUAL example so I can just switch out the numbers to match my game?
This is right around the 90 day limit for necroposting, but it is on-topic so hopefully it is OK.

Javascript is case-sensitive and so try "value" instead of "Value". Also, try without the leading zeros.

If : Script : $gameSelfSwitches.value([14,38,'A'])
Text : None, Window, Bottom
: : Sample Text
: End
Sorry for the necro-post and Thank-you Aloe Guvner! You were correct.

$gameSelfSwitches.value([14,38,'A']) works = small v for value AND no leading '0's
$gameSelfSwitches.value([this._mapId,38,'A']) also works!

$gameSelfSwitches.value([this._mapId,038,'A']) //both of these DON'T work. weird. so, the 038 is a 'string' not a integer? that was surprising.
$gameSelfSwitches.value([014,038,'A'])

Thanks again! It works!
Do not put leading zeros before numbers. It converts them to hexadecimal (or something weird like that). Long-standing rule.

Also, the necropost limit is 30 days, not 90.
@Aloe Guvner Just to confirm Shaz's post, the necropost limit is indeed 30 days, not 90.
@SlingB Could you note the correct length so you know for the future.

Moderator note: Closing

Original thread: https://forums.rpgmakerweb.com/threads/self-switch-check-via-script-call.86176/