I would like to turn off a self switch on an event whenever player dies. I don't want to make the self switch a global switch, I don't like clutter. I just want to be able to add a simple line to the death event saying "turn off self switch A for event X on map Y". How can I do that? 🙂
JavaScript to turn off a self switch?
Javascript/Plugin Supportwith script call
$gameSelfSwitches.setValue([a,b,c], true/false);
where:
a - reference to map ID
b - reference to event ID
c - reference to wich self switch you wish to toggle ("A", "B", "C", or "D")
c - element is a string type so it always must be put in quote marks.
$gameSelfSwitches.setValue([a,b,c], true/false);
where:
a - reference to map ID
b - reference to event ID
c - reference to wich self switch you wish to toggle ("A", "B", "C", or "D")
c - element is a string type so it always must be put in quote marks.
awesome, thank you!
Fun fact: It doesn't work if you use it outside of the map the event with self switch is on. Not sure why. But whatever 🙂
It 100% should work, because I use this method in my project, maybe you put wrong map or event id or self switch wasn't set at all?
Original thread: https://forums.rpgmakerweb.com/threads/javascript-to-turn-off-a-self-switch.124974/