View Single Post
  #2  
Old 02-09-2010, 06:06 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
First find the delta like so:

temp.dx = ((player.x+1.5) - (npc.x+1.5));
temp.dy = ((player.y+2) - (npc.y+2));

The offset is 1.5x2, which is the center of the player objects. If the NPC is not a player character and has a different body shape, you'll want to adjust that accordingly.

Then use the getangle() function:
getangle(dx,dy);

By the by, Graal uses radials(0-pi*2) and not degrees(0-360).
Reply With Quote