Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-22-2006, 06:39 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
getangle questions

So, how would I use getangle? What type of number does it put out? Does it get an angle of 0-360? 0-3?
And, if I wanted to make an npc look in the direction of the player, how would I use this?
__________________
Reply With Quote
  #2  
Old 04-22-2006, 08:10 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
getangle() returns the radian angle (between 0 and 6.28318530...).

For an npc to face a player, use
NPC Code:
dir = getdir( playerx - x , playery - y );

Reply With Quote
  #3  
Old 04-22-2006, 09:39 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
getangle(dx,dy), where
dx is the change in x coordinates points between the two points
dy is the change in y coordinates points between the two points
__________________
Reply With Quote
  #4  
Old 04-23-2006, 01:33 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
oh, makes sense. I did
dir = getdir( playerx - x , playery - y );
but instead of getdir i used getangle and it didnt work.

Thanks this cleared up alot of questions
__________________
Reply With Quote
  #5  
Old 04-23-2006, 01:49 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by wild8900
but instead of getdir i used getangle and it didnt work.
Yeah because getdir returns a direction (0-3) and getangle returns an angle(0-6.28).
__________________
Liek omigosh.

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.