ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Wish List (https://www.esoui.com/forums/forumdisplay.php?f=177)
-   -   [open] IsUnitFalling(unitTag) / IsUnitJumping(unitTag) (https://www.esoui.com/forums/showthread.php?t=8617)

Sordrak 06/24/19 02:26 AM

[open] IsUnitFalling(unitTag) / IsUnitJumping(unitTag)
 
Hi guys

There's already a function IsUnitSwimming(unitTag).

I guess the two functions IsUnitFalling(unitTag) / IsUnitJumping(unitTag) wouldn't be hard to implement and could give quite a bit of nice insights on what is currently going on (analyzing a few things).

Furthermore, i believe there might be a few nice things possible with these two functions. :banana:

Cardinal05 07/12/19 01:00 AM

Quote:

Originally Posted by Sordrak (Post 38513)
Hi guys

There's already a function IsUnitSwimming(unitTag).

I guess the two functions IsUnitFalling(unitTag) / IsUnitJumping(unitTag) wouldn't be hard to implement and could give quite a bit of nice insights on what is currently going on (analyzing a few things).

Furthermore, i believe there might be a few nice things possible with these two functions. :banana:

Just saw this now, but if you're still interested, I had encapsulated the logic for fall detection in my Magic Carpet add-on into the Featherfall.lua file.

The main thing that you would just need to change in order for it to work in non-Player Housing zones would be line 55:

local x, y, z = GetPlayerWorldPositionInHouse()

would need to be:

local _, x, y, z = GetUnitWorldPosition("player")

Sordrak 07/17/19 01:50 AM

Quote:

Originally Posted by Cardinal05 (Post 38590)
Just saw this now, but if you're still interested, I had encapsulated the logic for fall detection in my Magic Carpet add-on into the Featherfall.lua file.

The main thing that you would just need to change in order for it to work in non-Player Housing zones would be line 55:

local x, y, z = GetPlayerWorldPositionInHouse()

would need to be:

local _, x, y, z = GetUnitWorldPosition("player")

Thanks, I'll take a look at it. But i guess, without looking at your code, that you calculate the movement differences and at a certain threshold it will be considered as falling. If that's the case, then unfortunately, this wouldn't be enough :(

ZOS_DanBatson 10/21/19 03:12 PM

IsUnitInAir and IsUnitFalling will be in the API next release (not the release that just went out.) At the moment only the local player unit will ever return true.

Sordrak 02/04/20 06:03 AM

Quote:

Originally Posted by ZOS_DanBatson (Post 39464)
IsUnitInAir and IsUnitFalling will be in the API next release (not the release that just went out.) At the moment only the local player unit will ever return true.


Thanks, just saw that in the API patch notes. I will test this on the PTS when i have more time.

Is there a reason for the restriction on the current player?
And will this be changed in the future?


All times are GMT -6. The time now is 01:32 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI