View Single Post
  #25223    
Old May 26th, 2013 (04:28 PM).
Awkward.'s Avatar
Awkward. Awkward. is offline
#britanna
 
Join Date: May 2012
Age: 18
Gender: Male
Nature: Sassy
Posts: 845
Quote originally posted by shinyabsol1:
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.