Relative direction to your target.

Forum for posting custom UIs, portions of UIs, and HUD stuff using MQ's enhancements.

Moderator: MacroQuest Developers

Sharp of Fairlight
VIP=Very Impressive Pimpin'
Posts: 108
Joined: Wed Oct 29, 2003 3:54 pm
Location: Sweden

Relative direction to your target.

Post by Sharp of Fairlight » Mon Feb 23, 2004 3:13 am

I have this in my target window. It calc's the relative direction to your target, i.e. its 0 if you are looking straight at it.

Code: Select all

$if(n,$target(distance)==0,0,$int($calc($calc($char(heading)-$target(headingto)+540)%360-180)))
Together with $target(distance) its pretty easy to find your target.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Mon Feb 23, 2004 11:06 am

Thanks, if you change the ,0, to ,"", instead of showing a 0 when you have nothing targeted, it will show... nothing when nothing is targeted :)

Code: Select all

$if(n,$target(distance)==0,"",$int($calc($calc($char(heading)-$target(headingto)+540)%360-180)))

Sharp of Fairlight
VIP=Very Impressive Pimpin'
Posts: 108
Joined: Wed Oct 29, 2003 3:54 pm
Location: Sweden

Post by Sharp of Fairlight » Wed Feb 25, 2004 4:38 am

Then it will also show nothing when you have something targeted and is standing on top of it.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Wed Feb 25, 2004 11:29 am

I haven't had it happen yet, you could also probably have it use just "$target()" which would eval to true or false. the nice side benefit is that when you target yourself, it doesn't show up.