- Joined
- Jul 18, 2014
- Messages
- 222
- Reaction score
- 13
- First Language
- English
- Primarily Uses
- RMMV
Hello, is there a way to globally reset a self-switch for all events?
Scenario: I would have numerous versions of the typical chest event which is permanently deactivated by use of a Self-Switch (Let's say C). I would like a feature in my game to be able to turn off Self-Switch C for ALL events (across all maps) in one call.
I have come across Kadokawa's OuterSelfSwitch, but it only affects events on the map it is being called.
I have also come across this piece of coding from Hime:
class Game_SelfSwitches
def bulk_set(letter, state)
switches = @data.keys.select {|data| p data; data[2] == letter }
switches.each {|key| self[key] = state }
end
end
class Game_Interpreter
def bulk_self_switch(letter, state)
$game_self_switches.bulk_set(letter, state)
end
end
Script call: bulk_self_switch("A", false)
(Source: http://www.rpgmakercentral.com/topic/30665-resetting-self-switches-a-only/)
However, that is for VX Ace. Is there an MV equivalent to the above coding or another alternative to globally resetting a particular self switch?
Scenario: I would have numerous versions of the typical chest event which is permanently deactivated by use of a Self-Switch (Let's say C). I would like a feature in my game to be able to turn off Self-Switch C for ALL events (across all maps) in one call.
I have come across Kadokawa's OuterSelfSwitch, but it only affects events on the map it is being called.
I have also come across this piece of coding from Hime:
class Game_SelfSwitches
def bulk_set(letter, state)
switches = @data.keys.select {|data| p data; data[2] == letter }
switches.each {|key| self[key] = state }
end
end
class Game_Interpreter
def bulk_self_switch(letter, state)
$game_self_switches.bulk_set(letter, state)
end
end
Script call: bulk_self_switch("A", false)
(Source: http://www.rpgmakercentral.com/topic/30665-resetting-self-switches-a-only/)
However, that is for VX Ace. Is there an MV equivalent to the above coding or another alternative to globally resetting a particular self switch?

