Advertisement
ezmash

Disable NPC Lock (VX Ace)

Sep 14th, 2013
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.27 KB | None | 0 0
  1. #============================================================================
  2. # Disable NPC Lock
  3. # v1.0 by Shaz
  4. #----------------------------------------------------------------------------
  5. # This is a simple script to allow NPC events to continue with their move
  6. # route while you are interacting with them (they will not stop their
  7. # movement and turn to the player)
  8. #----------------------------------------------------------------------------
  9. # To Install:
  10. # Copy and paste into a new script slot in Materials.  This script aliases
  11. # existing methods, so can go below all other custom scripts.
  12. #----------------------------------------------------------------------------
  13. # To Use:
  14. # Add the text <nolock> in a comment anywhere on your event's page
  15. # (the closer to the top, the better)
  16. #----------------------------------------------------------------------------
  17. # Terms:
  18. # Use in free or commercial games
  19. # Credit Shaz
  20. #============================================================================
  21.  
  22. class Game_Event
  23.   alias shaz_nolock_clear_page_settings clear_page_settings
  24.   alias shaz_nolock_setup_page_settings setup_page_settings
  25.   alias shaz_nolock_lock                lock
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # * Clear Event Page Settings
  29.   #--------------------------------------------------------------------------
  30.   def clear_page_settings
  31.     shaz_nolock_clear_page_settings
  32.     @nolock = false
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # * Set Up Event Page Settings
  36.   #--------------------------------------------------------------------------
  37.   def setup_page_settings
  38.     shaz_nolock_setup_page_settings
  39.     # look for collision in first block of comments
  40.     list_index = 0
  41.     while list_index < @list.size && [108,408].include?(@list[list_index].code)
  42.       if @list[list_index].parameters[0] =~ /<nolock>/i
  43.         @nolock = true
  44.         break
  45.       end
  46.       list_index += 1
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # * Lock (Processing in Which Executing Events Stop)
  51.   #--------------------------------------------------------------------------
  52.   def lock
  53.     shaz_nolock_lock if !@nolock
  54.   end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement