Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
new 8dir movement add-on
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Hi I don't know if you remember me but i posted here 2 times a while ago. I then lost interest in rpg maker xp, but now i think my interest is back. after browsing the forum looking at the recent developments, I saw dubealex made a 8dir add-on, but he was calling move left, right, down up twice when you were moving that direction, that is the reason random battles did not occur when set to 1 step.

The script below alias's the 4 move methods Game_Player update calls and then checks for 8 dir movement.

Code:
class Game_Player    
alias_method :old_move_down_8dir, :move_down
   alias_method :old_move_up_8dir, :move_up
    alias_method :old_move_left_8dir, :move_left
  alias_method :old_move_right_8dir, :move_right
    
  def directionalMovement8
    case Input.dir8
    when 2 then old_move_down_8dir
    when 4 then old_move_left_8dir
    when 6 then old_move_right_8dir
    when 8 then old_move_up_8dir
    when 7 then move_upper_left
    when 9 then move_upper_right
    when 3 then move_lower_right
    when 1 then move_lower_left
    end
  end
  
  def move_down(*args)
    directionalMovement8
  end
  
  def move_left(*args)
    directionalMovement8
  end
  
  def move_right(*args)
    directionalMovement8
  end
  
  def move_up(*args)
    directionalMovement8
  end
end
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Event dependent Movement Caldaron 0 2,249 10-09-2006, 01:00 PM
Last Post: Caldaron
  0verworld Isometric Movement sasuke89 0 2,343 08-21-2006, 01:00 PM
Last Post: sasuke89
  Status Color-Movement Derk-Jan 0 2,065 06-30-2005, 01:05 PM
Last Post: Derk-Jan



Users browsing this thread: