Hi, I wrote this script into my game and now my character walks slower in water titles...
But I can't figure out a way to play this to my enemy events. They just walk over it like it's nothing.
Here is the script:
module CLAIVE_SLOW_REGION
#Region ID which slows the player.
REGION_ID = 3
#Switch used to disable this feature at any time.
DISABLE_SWITCH = 16
end
class Game_Player < Game_Character
attr_accessor :move_speed
alias :claive_update :update
def update
claive_update
check_slow_region
end
def check_slow_region
return if $game_switches[CLAIVE_SLOW_REGION:😀ISABLE_SWITCH]
r_id = $game_map.region_id($game_player.x, $game_player.y)
if r_id == CLAIVE_SLOW_REGION::REGION_ID
$game_player.move_speed = 3
else
$game_player.move_speed = 4
end
end
end
But I can't figure out a way to play this to my enemy events. They just walk over it like it's nothing.
Here is the script:
module CLAIVE_SLOW_REGION
#Region ID which slows the player.
REGION_ID = 3
#Switch used to disable this feature at any time.
DISABLE_SWITCH = 16
end
class Game_Player < Game_Character
attr_accessor :move_speed
alias :claive_update :update
def update
claive_update
check_slow_region
end
def check_slow_region
return if $game_switches[CLAIVE_SLOW_REGION:😀ISABLE_SWITCH]
r_id = $game_map.region_id($game_player.x, $game_player.y)
if r_id == CLAIVE_SLOW_REGION::REGION_ID
$game_player.move_speed = 3
else
$game_player.move_speed = 4
end
end
end