TheoAllen

Theo - Event Skip (ENG)

May 27th, 2014
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.18 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Event Skip / Disable Event Command
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (This script documentation is written in informal indonesian language)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_DisableEventCmd] = true
  8. # =============================================================================
  9. # Change Logs:
  10. # -----------------------------------------------------------------------------
  11. # 2013.10.14 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script is to disable some event command in event for debugging purpose.
  17.   For example, you neither want to remove the intro of your game nor watch it
  18.   again, don't you?
  19.  
  20.   How to use :
  21.   Put this script below material but above main
  22.  
  23.   Set the label <event skip> to start skipping event commands
  24.   Set the label </event skip> to end skipping event commands
  25.  
  26.   Terms of use :
  27.   It just for debugging purpose. Edit it as you want
  28.  
  29. =end
  30. # =============================================================================
  31. # No configuration
  32. # =============================================================================
  33. class Game_Interpreter
  34.  
  35.   alias theo_decmd_init initialize
  36.   def initialize(*args)
  37.     theo_decmd_init(*args)
  38.     @event_skip = false
  39.   end
  40.  
  41.   alias theo_decmd_118 command_118
  42.   def command_118
  43.     theo_decmd_118
  44.     if !(@params[0] =~ /<event skip>/i).nil?
  45.       @event_skip = true
  46.     elsif !(@params[0] =~ /<\/event skip>/i).nil?
  47.       @event_skip = false
  48.     end
  49.   end
  50.  
  51.   alias theo_decmd_exe_cmd execute_command
  52.   def execute_command
  53.     return skip_event_command if @event_skip
  54.     return theo_decmd_exe_cmd
  55.   end
  56.  
  57.   def skip_event_command
  58.     command = @list[@index]
  59.     @params = command.parameters
  60.     @indent = command.indent
  61.     if command.code == 118
  62.       method_name = "command_#{command.code}"
  63.       send(method_name) if respond_to?(method_name)
  64.     else
  65.       command_skip
  66.     end
  67.   end
  68.  
  69. end
Advertisement
Add Comment
Please, Sign In to add comment