ok im making a short script but its not working not sure y it moves the player to an event
it gives an error on the abs
class Game_Character
def toward_event
sx = @x - $game_events[$e_id].x
sy = @y - $game_events[$e_id.y
abs_sx = sx > 0 ? sx : -sx
abs_sy = sy > 0 ? sy : -sy
if sx + sy >= 20
move_random
return
end
case rand(6)
when 0..3
move_toward_event
when 4
move_random
when 5
move_forward
end
@move = [0, false]
end
end
First thing... "$game_events[$e_id.y" should be "$game_events[$e_id].y" and secondly it's "$game_map.events[$e_id].y". xD
Thirdly, Blizz-ABS has already script calls for that. "turn_toward(CHARACTER)" and "move_toward(CHARACTER)". CHARACTER can be any character on the map. i.e. an event would be "$game_map.events[E_ID]".
did not know that i guess i would want to RTFM lol
No, it's not in the manual. It's one of the methods I implemented mainly used by the AI.
oh how would i call it i tryed $bizzabs.moveto($game_map.events[9].x, $game_map.events[9].y)
"$game_map.events[9].move_toward($game_map.events[1])" makes event 9 move toward event 1.
ok i got it thinks