Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. =begin
  2.  
  3.   Script Name:   Event Move Fix
  4.   Author:        Tajiin
  5.   Release Date:  01/23/2015 | mm/dd/yyyy
  6.  
  7.   Version: 1.0
  8.   Version Date: -
  9.  
  10.   Description:
  11.     This Script fix a bug that doesnt let a event or even the player
  12.     move randomly.
  13.     Also i added the function that you can change the Range that the maker
  14.     takes to see if a event is near to another event or the player so that
  15.     it can move towards it.
  16.  
  17.   What can i change in the EDIT-Area:
  18.     Range: Changes the Range(see in the description)
  19.    
  20.   Have Fun
  21.  
  22.   SORRY FOR MY BAD ENGLISH SKILLS
  23.  
  24. =end
  25. module EventMove
  26.   #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  27.   #  EDIT-Area
  28.   #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  29.  
  30.   Range = 10
  31.  
  32.   #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  33.   #  END
  34.   #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  35. end
  36. class Game_Event < Game_Character
  37.   #--------------------------------------------------------------------------
  38.   # * Move Type : Approach
  39.   #--------------------------------------------------------------------------
  40.   def move_type_toward_player
  41.     if near_the_player?
  42.       move_toward_player
  43.     else
  44.       move_random
  45.     end
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # * Move Type : Random
  49.   #--------------------------------------------------------------------------
  50.   def move_type_random
  51.     move_random
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # * Determine if Near Player
  55.   #--------------------------------------------------------------------------
  56.   def near_the_player?
  57.     sx = distance_x_from($game_player.x).abs
  58.     sy = distance_y_from($game_player.y).abs
  59.     sx + sy < EventMove::Range
  60.   end
  61. end