Advertisement
diamondandplatinum3

Outside Event Self-Switch Control ~ RGSS3

Jan 18th, 2013
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.95 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Outside Event Self-Switch Control
  3. #             Author: DiamondandPlatinum3
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. #  Description:
  6. #
  7. #    This script allows you modify one event's self-switch from another event.
  8. #    This can save you lots of event switches from being used if done correctly.
  9. #
  10. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. #------------------------------------------------------------------------------
  12. #  Instructions:
  13. #  
  14. #     Use the following in a script call:
  15. #       mod_self_switch( map_id, event_id, switch, on_or_off )
  16. #
  17. #     Replace 'map_id'     with the id of the map the event is located on.
  18. #     Replace 'event_id'   with the event id (obviously)
  19. #     Replace 'switch'     with either "A", "B", "C", or "D"
  20. #     Replace 'on_or_off'  with either true or false,
  21. #                          true sets the switch on, whilst false turns that switch off.
  22. #
  23. #
  24. #     Screenshot Example can be found here: goo.gl/Gb5Kl
  25. #
  26. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. class Game_Interpreter
  34.   #--------------------------------------------------------------------------
  35.   # * Control Self Switch
  36.   #--------------------------------------------------------------------------
  37.   def mod_self_switch( map_id, event_id, switch, on_or_off )
  38.     current_map_id    = @map_id
  39.     current_event_id  = @event_id
  40.     current_params    = [ @params[0], @params[1] ]
  41.    
  42.     @map_id     = map_id
  43.     @event_id   = event_id
  44.     @params[0]  = switch
  45.     if on_or_off; @params[1] = 0; else; @params[1] = 1; end
  46.      
  47.     # Self Switch Command
  48.     command_123()
  49.    
  50.     @map_id     = current_map_id    
  51.     @event_id   = current_event_id
  52.     @params[0]  = current_params[0]
  53.     @params[1]  = current_params[1]
  54.   end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement