This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Check how fast you are going
Post Reply
Return to board index
Post by
352985
This post was from a user who has deleted their account.
Post by
HighFive
Try/run print((GetUnitSpeed("target")/0.07).."%")
Post by
607
This post was from a user who has deleted their account.
Post by
352985
This post was from a user who has deleted their account.
Post by
Champ527
Huh intresting, have to mess with this sometime.
Post by
pelf
The only problem with this API is that it returns the speed the game believes you should be going, based on your current movement speed modifiers, with respect only to your movement. That is, it doesn't answer the question, "
How fast am I moving through the world?
" Rather, it answers the question, "
What is the sum of all of my movement-increasing effects?
"
The distinction becomes apparent when you're trying to use your movement speed to align your pitch to 0. Obviously, when flying from point A to point B, if you're moving as fast as you can be with relation to the plane of the earth, you'll get there faster. If you're tilted up, or tilted down, wasting part of your movement speed on increasing or decreasing elevation, you won't get there as fast.
There's only one addon that I've found that does the movement calculation manually rather than using that API.
Post by
HighFive
Actually, it seems to get the speed through calculation of distance traveled between your current position and your previous one in some few milliseconds. This is better for addons such as TomTom in the sense that the resulting E.T.A will be correct if the player is correctly pitched (or otherwise incorrectly longer or shorter), as blizzard has refused to provide a Z coord API.
The GetUnitPitch function however is present, and with some trigonometry one can figure out the absolute unit speed.
edit:no, wait, you're right. It provides absolute speed.
BRB with plane speed.
edit:/run print(format("Your plane speed is %f%%.",math.cos(GetUnitPitch("player"))*GetUnitSpeed("player")/0.07))Upon further investigation it appears that this will only work when you are flying or swimming, as your pitch does not really reflect how your character is tilted on the ground.
The most accurate way to do this indeed seems to be raw calculation of distance/time.
How irritating.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.