TheoAllen

Theo - Force Stop Movements

Jun 27th, 2013
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.93 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Force Stop Movements
  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_StopMovement] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.06.27 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Perkenalan :
  16.   Script ini untuk menghentikan semua movement event baik itu evented ato
  17.   autonomous. Dan juga dapat menghentikan animasi tileset atau player.
  18.  
  19.   Cara penggunaan :
  20.   Pasang dibawah material namun diatas main.
  21.  
  22.   Sisanya edit konfigurasinya.
  23.  
  24.   Terms of use :
  25.   Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
  26.   keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
  27.   dipake buat komersil, jangan lupa, gw dibagi gratisannya.
  28.  
  29.  
  30. =end
  31. # =============================================================================
  32. # Konfigurasi :
  33. # =============================================================================
  34. module THEO
  35.   module MOVEMENT
  36.    
  37.     # =========================================================================
  38.       TILEMAP_SWITCH = 22 # Switch ID untuk tilemap
  39.       PLAYER_SWITCH  = 24 # Switch ID untuk player
  40.       EVENT_SWITCH   = 23 # Switch ID untuk event
  41.     # -------------------------------------------------------------------------
  42.     # Tentukan switch disini. Jika switch dengan id diatas bernilai ON, maka
  43.     # movement ataupun animasinya akan berhenti. Meski itu berarti bakal
  44.     # berhenti di tengah jalan pas gerak.
  45.     # =========================================================================
  46.    
  47.   end
  48. end
  49. # =============================================================================
  50. # Akhir dari konfigurasi
  51. # =============================================================================
  52. class Game_Event < Game_Character
  53.  
  54.   alias pre_stop_update_anim update_animation
  55.   def update_animation
  56.     return if $game_switches[THEO::MOVEMENT::EVENT_SWITCH]
  57.     pre_stop_update_anim
  58.   end
  59.  
  60.   alias ori_distance_per_frame distance_per_frame
  61.   def distance_per_frame
  62.     return 0 if $game_switches[THEO::MOVEMENT::EVENT_SWITCH]
  63.     return ori_distance_per_frame
  64.   end
  65.  
  66. end
  67.  
  68. class Game_Player < Game_Character
  69.  
  70.   alias pre_stop_move_input move_by_input
  71.   def move_by_input
  72.     return if $game_switches[THEO::MOVEMENT::PLAYER_SWITCH]
  73.     pre_stop_move_input
  74.   end
  75.  
  76. end
  77.  
  78. class Tilemap
  79.  
  80.   alias pre_update_stop update
  81.   def update
  82.     pre_update_stop unless $game_switches[THEO::MOVEMENT::TILEMAP_SWITCH]
  83.   end
  84.  
  85. end
Advertisement
Add Comment
Please, Sign In to add comment