=begin
Script Name: Event Move Fix
Author: Tajiin
Release Date: 01/23/2015 | mm/dd/yyyy
Version: 1.0
Version Date: -
Description:
This Script fix a bug that doesnt let a event or even the player
move randomly.
Also i added the function that you can change the Range that the maker
takes to see if a event is near to another event or the player so that
it can move towards it.
What can i change in the EDIT-Area:
Range: Changes the Range(see in the description)
Have Fun
SORRY FOR MY BAD ENGLISH SKILLS
=end
module EventMove
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# EDIT-Area
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Range = 10
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# END
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
end
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# * Move Type : Approach
#--------------------------------------------------------------------------
def move_type_toward_player
if near_the_player?
move_toward_player
else
move_random
end
end
#--------------------------------------------------------------------------
# * Move Type : Random
#--------------------------------------------------------------------------
def move_type_random
move_random
end
#--------------------------------------------------------------------------
# * Determine if Near Player
#--------------------------------------------------------------------------
def near_the_player?
sx = distance_x_from($game_player.x).abs
sy = distance_y_from($game_player.y).abs
sx + sy < EventMove::Range
end
end