Simple 8-directional movement script.
Did you ever want to have an 8-directional movement script which:
-Doesn't use SDK.
-Has no other fancy functions
-It is compatible with almost everything (found an error with UCoders message system, but fixed)
Then this if for you!
Compatibility:
-Almost everything. It only overwrites Game_Player.
Credits:
-Vgvgf because he helps me with everything.
Script:
Paste above main
There. I'm 90% sure someone will come and say "Hey this is stupid, there are a lot of 8-directional scripts!"
I DON'T CARE.
Be well
Did you ever want to have an 8-directional movement script which:
-Doesn't use SDK.
-Has no other fancy functions
-It is compatible with almost everything (found an error with UCoders message system, but fixed)
Then this if for you!
Compatibility:
-Almost everything. It only overwrites Game_Player.
Credits:
-Vgvgf because he helps me with everything.
Script:
Paste above main
Code:
#======================================
# â– Simple 8-directional movemento script
#======================================
# By: Nachito (rmxp)
#Â Â Date: 20.12.2008
#Â Â Version: 1.0
#======================================
class Game_Player < Game_Character
 def update
  last_moving = moving?
  unless moving? or $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
    case Input.dir8
    when 1
     move_lower_left
    when 2
     move_down
    when 3
     move_lower_right
    when 4
     move_left
    when 6
     move_right
    when 7
     move_upper_left
    when 8
     move_up
    when 9
     move_upper_right
    end
  end
  last_real_x = @real_x
  last_real_y = @real_y
  super
  if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
   $game_map.scroll_down(@real_y - last_real_y)
  end
  if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
   $game_map.scroll_left(last_real_x - @real_x)
  end
  if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
   $game_map.scroll_right(@real_x - last_real_x)
  end
  if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
   $game_map.scroll_up(last_real_y - @real_y)
  end
  unless moving?
   if last_moving
    result = check_event_trigger_here([1,2])
    if result == false
     unless $DEBUG and Input.press?(Input::CTRL)
      if @encounter_count > 0
       @encounter_count -= 1
      end
     end
    end
   end
   if Input.trigger?(Input::C)
    check_event_trigger_here([0])
    check_event_trigger_there([0,1,2])
   end
  end
 end
end
There. I'm 90% sure someone will come and say "Hey this is stupid, there are a lot of 8-directional scripts!"
I DON'T CARE.
Be well