Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(6 Kb)
Download
Updated: 01-28-09 01:39 PM
Pictures
File Info
Updated:01-28-09 01:39 PM
Created:unknown
Downloads:2,556
Favorites:19
MD5:

basicAttitude

Version: 1.3
by: NightHawk The Sane [More]

This is an extremely basic flight pitch monitor, implemented as a simple LDB plugin. It does a rough calculation to turn the game's pitch value into a value in degrees. It may not be 100% accurate, but it's probably close enough.

The text is colored green (for pitch-up) or red (for pitch-down), the colors become more intense as your angle approaches 90.

While this is very usable, I intended it largely as a proof-of-concept, to encourage others to create more interesting and robust implementations.

basicAttitude now also includes a display for "relative horizontal velocity". This attempts to show how fast you're moving horizontally, while flying. Essentially, I take the speed returned by the game, and adjust it based on your current pitch. Note, this only works while flying, as pitch values are meaningless while on the ground. If you're not flying, it will still show a value, it'll just be your abstract relative speed. And, of course, speed is displayed relative to running (which is 100%).

v1.3
- Update toc to 30200
- Add relative horizontal velocity for flying.

v1.2
- If the player's in a vehicle use the vehicle's pitch (playerpet) instead of the player's.

v1.1.1
- Actually pass the proper arguments to LibDataBroker

v1.1a
- Repack of the zip file to try and eliminate some problems for windows users. There are no code changes.

v1.1
- Account for pitch values >90 degrees up or down. I'd forgotten about the ability to do that, and GetUnitPitch() appears to return sane results.
- Normalize pitch-up values past 180 degrees or pitch-down values past -180 degrees.
- Minor tweak to color thresholds.

v1.0
- Initial Release
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Author
Date
1.1.1
6kB
NightHawk The Sane
01-06-09 12:33 PM
1.1a
6kB
NightHawk The Sane
11-11-08 11:29 PM


Post A Reply Comment Options
Unread 08-31-13, 07:30 AM  
3ICE
A Murloc Raider
 
3ICE's Avatar

Forum posts: 7
File comments: 3
Uploads: 0
Extremely useful little addon. Impressive maths inside too!

Now here's how to get a reasonable amount of decimals (1 instead of 5):

edit X:\Program Files\World of Warcraft\Interface\AddOns\basicAttitude\basicAttitude.lua

Change line 26 from:
Lua Code:
  1. local pitch = UnitInVehicle("player") == 1 and round(GetUnitPitch("playerpet"),5) or round(GetUnitPitch("player"),5)
to:
Lua Code:
  1. local pitch = UnitInVehicle("player") == 1 and round(GetUnitPitch("playerpet"),1) or round(GetUnitPitch("player"),1)

Change line 81 from:
Lua Code:
  1. dataobj.text = string_format("|cff%02x%02x%02x%.5f|r", r*255, g*255, b*255, attitude)
to:
Lua Code:
  1. dataobj.text = string_format("|cff%02x%02x%02x%.1f|r", r*255, g*255, b*255, attitude)
--3ICE
__________________
Click here for my full signature (Image limit here is 4)

Last edited by 3ICE : 08-31-13 at 07:36 AM.
3ICE is offline Report comment to moderator  
Reply With Quote
Unread 03-07-09, 10:05 AM  
Zorklat
A Deviate Faerie Dragon

Forum posts: 13
File comments: 63
Uploads: 0
Dunno about you, Sargeant, but I use NinjaPanel instead.
__________________
Play World of Warcraft Free from Windows!
Zorklat is offline Report comment to moderator  
Reply With Quote
Unread 11-12-08, 05:25 PM  
Sargeant
A Murloc Raider
 
Sargeant's Avatar
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 12
basicAttitude is apparently not appearing in Broker2Fubar.
Any known way to fix this?
Sargeant is offline Report comment to moderator  
Reply With Quote
Unread 11-11-08, 06:13 PM  
NightHawk The Sane
A Kobold Labourer
 
NightHawk The Sane's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 17
Uploads: 8
Originally posted by Bilb
Seems pretty accurate to me, and if it's not why so many decimals?
Well, the main issue is that the return from GetUnitPitch() is a float. I'm rounding that, and doing some work to convert it into degrees, so there may be some precision and accuracy lost in the process. It's difficult to know exactly what numbers correspond to.

For the purposes of maintaining level flight, it should actually be fairly accurate, as perfectly level flight is a known value to compare against.

That said, the specific number of decimal places shown is fairly arbitrary. It just felt right, and looked nice to me.
__________________
"The future isn't what it used to be." - G'Kar
NightHawk The Sane is offline Report comment to moderator  
Reply With Quote
Unread 11-10-08, 08:55 PM  
Bilb
A Murloc Raider

Forum posts: 5
File comments: 8
Uploads: 0
Seems pretty accurate to me, and if it's not why so many decimals? =p

-edit a "a" got lost in "decimals".
Last edited by Bilb : 11-10-08 at 08:55 PM.
Bilb is offline Report comment to moderator  
Reply With Quote
Unread 10-26-08, 11:06 AM  
blackpandemic
A Flamescale Wyrmkin
 
blackpandemic's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 123
File comments: 84
Uploads: 2
As soon as I have my flyer I'm going to test this out. Hated on my main hitting auto-run, coming back and have me 50 miles above the ground on the edge of Netherstorm's map :P

Great idea!
__________________
"It is forbidden to kill; therefore all murderers are punished unless they kill in large numbers and to the sound of trumpets." -Voltaire
blackpandemic is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: