[DiscordArchive] Anyone know any TC functions to get a unit’s current speed?
[DiscordArchive] Anyone know any TC functions to get a unit’s current speed?
Archived author: will0x539 • Posted: 2023-09-10T22:00:01.553000+00:00
Original source
Anyone know any TC functions to get a unit’s current speed?
Archived author: Kiffy • Posted: 2023-09-11T10:30:33.273000+00:00
Original source
GetSpeed(movetype) and GetSpeedRate(movetype) to include modified speed maybe?
you could maybe also use eventoffset lambda function which is a bit convoluted but would allow you to do an actual position difference over time calculation for speed and do something with that, I could provide an example if youre interested
Archived author: stoneharry • Posted: 2023-09-11T10:38:36.186000+00:00
Original source
Pretty sure get speed returns the speed without any modifiers (e.g slow aura)
Archived author: will0x539 • Posted: 2023-09-11T10:50:21.804000+00:00
Original source
Well, afaik while Unit::GetSpeed does indeed give us a speed, it seems to give us the params of the speed (it takes a UnitMoveType and give us the unit's speed during that move type) and not the current speed. So we either need a way to get the current speed, or the current movement type so we can use Unit::GetSpeed along with it to figure out the current actual speed. Dunno if that makes much sense
Archived author: will0x539 • Posted: 2023-09-11T10:51:05.284000+00:00
Original source
also need vertical speed, strafe speed and direction
Archived author: stoneharry • Posted: 2023-09-11T10:52:29.513000+00:00
Original source
You'll likely need to expose more of the movement class internals. (not looked at code)
Archived author: Kiffy • Posted: 2023-09-11T10:53:40.175000+00:00
Original source
you could get the movement types in a switch by checking for IsWalking, IsFlying* etc. but direction and all that would make me opt for doing positional calculations manually
Archived author: stoneharry • Posted: 2023-09-11T10:54:10.261000+00:00
Original source
Not sure the server even tracks it 100%, it trusts the client and verifies it within a threshold occasionally
Archived author: will0x539 • Posted: 2023-09-11T10:54:20.518000+00:00
Original source
Yes i think i agree
Archived author: stoneharry • Posted: 2023-09-11T10:54:25.841000+00:00
Original source
Of course you can calculate what it should be at any point