Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Simple Self Switches
- # Author: Nicke
- # Created: 16/06/2011
- # Edited: 12/12/2011
- # Version: 1.0
- #==============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #
- # Use the call script to use this script.
- #
- # Example: setSelfSwitch(1, "A", true)
- # This will change the Self Switch of event ID 1 to true.
- #
- # If you want to change a Self Switch on another map do like this:
- # Change EVENT_ID in the script to your Event ID variable.
- # Then set the variable in a event to the ID you want to change.
- #
- # You can also check if Self Switch is true/false.
- # Example: isSelfSwitch?(1, "A") # True
- # Example: !isSelfSwitch?(1, "A") # False
- # Put this in a Conditional Branch.
- #
- # Last but not least you can turn all Self Switches to true/false.
- # Example: setAllSelfTo(1, true)
- # This will set all Self Switches to true of Event ID 1.
- #==============================================================================
- ($imported ||= {})["NICKE-EVENT-SELFSWITCHES"] = true
- module NICKE
- module SELF_SWITCHES
- #==============================================================================#
- # ** Settings
- #==============================================================================#
- EVENT_ID = 944 # Event ID variable.
- end
- end
- # *** Don't edit below unless you know what you are doing. ***
- class Game_Interpreter
- # Set SelfSwitch Event ID true/false.
- def setSelfSwitch(eID, selfSwitch, trueFalse)
- switch = [@map_id, eID, selfSwitch]
- $game_self_switches[switch] = trueFalse
- $game_map.need_refresh = true
- end
- # Is SelfSwitch of Event ID true/false?
- def isSelfSwitch?(eID, selfSwitch)
- switch = [@map_id, eID, selfSwitch]
- return $game_self_switches[switch]
- end
- # Set SelfSwitch of Event var ID to true/false.
- def setSelfEvent(selfSwitch, trueFalse)
- eID = $game_variables[NICKE::SELF_SWITCHES::EVENT_ID]
- key = [@map_id, eID, selfSwitch]
- $game_self_switches[key] = trueFalse
- $game_map.need_refresh = true
- end
- # Is SelfSwitch of Event var ID true/false?
- def isSelfEvent?(selfSwitch)
- eID = $game_variables[NICKE::SELF_SWITCHES::EVENT_ID]
- switch = [@map_id, eID, selfSwitch]
- return $game_self_switches[switch]
- end
- # Set all SelfSwitches to true/false.
- def setAllSelfTo(eID, trueFalse)
- setSelfSwitch(eID, "A", trueFalse)
- setSelfSwitch(eID, "B", trueFalse)
- setSelfSwitch(eID, "C", trueFalse)
- setSelfSwitch(eID, "D", trueFalse)
- end
- # Set all SelfSwitches Event var ID to true/false.
- def setAllSelfEventTo(trueFalse)
- eID = $game_variables[NICKE::SELF_SWITCHES::EVENT_ID]
- setSelfSwitch(eID, "A", trueFalse)
- setSelfSwitch(eID, "B", trueFalse)
- setSelfSwitch(eID, "C", trueFalse)
- setSelfSwitch(eID, "D", trueFalse)
- end
- end # END OF FILE
- #=*==========================================================================*=#
- # ** END OF FILE
- #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement