Page 1 of 1

Req: simple HUD "tracking" indicator

Posted: Tue Jul 20, 2004 4:12 pm
by Cr4zyb4rd
I currently have code like this in my MQ2HUD.ini to do simple spawn tracking.

Code: Select all

;Track nearest named spawns with heading/name
Spawn1=3,8,220,255,255,0,${If[${NearestSpawn[1,npc named].Name.NotEqual["NULL"]},${NearestSpawn[1,npc named].HeadingTo} - ${NearestSpawn[1,npc named].CleanName},No Named]}
Spawn2=3,8,234,255,255,0,${If[${NearestSpawn[2,npc named].Name.NotEqual["NULL"]},${NearestSpawn[2,npc named].HeadingTo} - ${NearestSpawn[2,npc named].CleanName},No Named]}
This works fine, but I'd like to have an arrow giving the direction of the mob (<-- and --> would be fine) to replace or augment the compass heading.

I did some forum searching, and it seems that HeadingTo used to be numeric but was "dumbed down" a bit to its current state. I could compute the angle manually but I'd rather not have that much math in what's supposed to be a simple .ini file. :) Anybody have an easier suggestion, or perhaps a dev could add a HeadingToLR or somesuch data type (the tracking plugin already has the code) in a future release?

Posted: Tue Jul 20, 2004 6:25 pm
by Sparr
writing this on the fly, so forgive any syntax errors...

${If[$Math.Calc[${NearestSpawn[1,npc named].HeadingTo.Degrees}+15]<30,^^^,If[$Math.Calc[${NearestSpawn[1,npc named].HeadingTo.Degrees}]<180,-->,<--]]}

Posted: Tue Jul 20, 2004 9:02 pm
by Cr4zyb4rd
Thanks, cleaned up the syntax to

Code: Select all

${If[${Math.Calc[${NearestSpawn[1,npc named].HeadingTo.Degrees}+15<30]},^^^,${If[${Math.Calc[${NearestSpawn[1,npc named].HeadingTo.Degrees}<180]},-->,<--]}]}
This is close, but doesn't quite do it. HeadingTo.Degrees gives the direction to the mob, but doesn't take the way I'm facing into account...Need to do something with ${Me.Heading.Degrees}-${Target.HeadingTo.Degrees} in here I think , but the math loses me. :(

Posted: Tue Jul 20, 2004 10:34 pm
by Sparr
(${Me.Heading.Degrees}-${Target.HeadingTo.Degrees}+360)%360

that will normalize it 0-360. then do the -15 and comparisons i suggested, that gives you ^^^ for -15 to +15, and <-- or --> for sides. its just a matter of nesting a few more ifs in there to make it cooler with > then -> then --> for farther turns

Posted: Wed Jul 21, 2004 2:45 am
by Cr4zyb4rd
Doh! Turns out in my brilliance I was doing Target-Me instead of Me-Target somehow without realizing it. At any rate, finished tracker looks like this

Code: Select all

;Track nearest named spawns with heading/name
Spawn1=3,8,220,255,255,0,${If[${NearestSpawn[1,npc named].Name.NotEqual["NULL"]},${If[${Math.Calc[(${Me.Heading.Degrees}-${NearestSpawn[1,npc named].HeadingTo.Degrees}+375)%360]}<30,^^^,${If[${Math.Calc[(${Me.Heading.Degrees}-${NearestSpawn[1,npc named].HeadingTo.Degrees}+360)%360]}<180,<--,-->]}]} ${NearestSpawn[1,npc named].CleanName},No Named]}
Tempted to add > -> --> like you mentioned, but it's already huge enough, methinks.

Thanks a ton.