View Single Post
  #25223    
Old May 26th, 2013 (4:28 PM).
Trev's Avatar
Trev Trev is offline
starting my comeback tour
     
    Join Date: May 2012
    Location: anywhere as long as I have dogs
    Age: 21
    Gender: Male
    Nature: Sassy
    Posts: 1,233
    Quote:
    Originally Posted by shinyabsol1 View Post
    Is there any way to check what direction the hero is facing from a script?
    Yes, there is. There's a variable called PLAYERFACING (0x800C) that checks the player's direction and stores it to that variable. It stores the values as 1 (down), 2 (up), 3 (left), or 4 (right). To apply it you could use something like this:

    Code:
    compare PLAYERFACING 0x1 'Checks if the player is facing down
    if 0x1 goto @down 'Checks if the player is facing down. 0x1 = yes, 0x0 = no.
    You can use it 4 times to check every direction, simply replacing the 0x1 in the first line with 0x2, 0x3, or 0x4, to check up, left, or right, respectively.