Is it possible with a script from the Event001 to enable\disable the SelfWitch A\B\C of the Event002 for example?
Enabling\Disabling from Event001 the Control Switch A, of another event
RPG Maker MV Support'Tutorials' is where people who have made a tutorial for others to use can post them.
Moved to: RPG Maker MV
Moved to: RPG Maker MV
generically:
$switches[[mapID, eventID, "SwitchID"]] = value
$switches[[mapID, eventID, "SwitchID"]] = value
I would just create a regular control switch to handle this. Then you don't need a script to do what you want. It is easier to find how that switch can be set.
The code for MV is:
You can similarly check the value of self switches using this code:
Code:
$gameSelfSwitches.setValue([mapId, eventId, selfSwitch], value);
// eg
$gameSelfSwitches.setValue([11, 5, 'A'], true);
You can similarly check the value of self switches using this code:
Code:
$gameSwitches.value([mapId, eventId , selfSwitch])
You're a Life Saviour!
Note that instead of
[3, 1, "A"]
you can use
"3,1,A"
since the former is converted into the latter since the latter is what's needed to create the hash table entry. (Note the lack of spaces in between commas in the latter)
so
$gameSelfSwitches.setValue("3,1,A", true)
Will set self switch A on the event with id 1 on map id 3 and
$gameSelfSwitches.value("3,1,A")
Will retrieve the value
[3, 1, "A"]
you can use
"3,1,A"
since the former is converted into the latter since the latter is what's needed to create the hash table entry. (Note the lack of spaces in between commas in the latter)
so
$gameSelfSwitches.setValue("3,1,A", true)
Will set self switch A on the event with id 1 on map id 3 and
$gameSelfSwitches.value("3,1,A")
Will retrieve the value
Original thread: https://forums.rpgmakerweb.com/threads/enabling-disabling-from-event001-the-control-switch-a-of-another-event.107077/