I'm working on a game wide system that resets a lot of information. I'm trying to find a way to go through every event in the entire game, and set the value of all a specific Self Variables back to 0.
Some time ago, when this system was simpler and only needed Self Switches, I asked on this forum how to reset all Self Switches, and was given this helpful function here.
So, you enter "D" into the function, and all "D" Self Switches in the entire game turn off. Works like a charm, and my game isn't too big as to have this cause any lag.
I'd like a way to do this with Yanfly's Self Variables. For example, to turn all of Self Variable 116 on all events to the value 0. It wouldn't reset all Self Variables, just all of Self Variable 116.
Some time ago, when this system was simpler and only needed Self Switches, I asked on this forum how to reset all Self Switches, and was given this helpful function here.
Code:
ResetAllSelfSwitches = function(nLetter) {
for (var i in $gameSelfSwitches._data) if (i.contains(nLetter)) $gameSelfSwitches._data = false;
}
So, you enter "D" into the function, and all "D" Self Switches in the entire game turn off. Works like a charm, and my game isn't too big as to have this cause any lag.
I'd like a way to do this with Yanfly's Self Variables. For example, to turn all of Self Variable 116 on all events to the value 0. It wouldn't reset all Self Variables, just all of Self Variable 116.