-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetTotemInfo vs GetTotemTimeLeft #5378
Comments
So some totems do have secondary effects that can be tracked, e.g. I think there's a shielding totem, spirit link gives a buff etc. I'd would want to test how the timing of these match up to what the totem apis return. GetTotemTimeLeft() is clearly some rounded value and assuming that on initial totem dropping the totem duration is exactly that rounded value seems a questionable assumption. |
test with SLT function()
local a = GetTotemTimeLeft(1)
local _, _, startTime, duration = GetTotemInfo(1)
local expirationTime = startTime and (startTime + duration) or 0;
local b = startTime and startTime > 0 and expirationTime - GetTime() or 0
local sltInfo = C_UnitAuras.GetPlayerAuraBySpellID(325174)
local slt = sltInfo and true or false
print(a, b, slt)
end Wow_2024-09-03_14-48-34.mp4buff is still active when timer from GetTotemInfo is negative |
Buff is still active for a few frame after GetTotemTimeLeft return 0 |
Oh boy what an output, the last line is: So the GetTotemInfo is off by a whole second. |
Lookng at the video again, at the start the difference is .96s, at the end of the video it's 1.11. So this screenshot from the video shows the exact timestamp from when the duration jumps from 6 to 5 in GetTotemTimeLeft, which seems to indicate it's a simple "ceil". I think our options are: We should also complain to blizzard, that api stinks. |
old Wow_2024-09-04_16-00-51.mp4new Wow_2024-09-04_18-45-20.mp4using this function Private.InitTotemTimer()
print("InitTotemTimer")
local totemInfo
if not Private.ExecEnv.GetTotemTimer then
totemInfo = {}
function Private.ExecEnv.GetTotemTimer(totemSlot)
local info = totemInfo[totemSlot]
if info then
print("GetTotemTimer", info.duration, info.startTime)
return info.startTime, info.duration
end
end
local totemTimerFrame = CreateFrame("Frame")
-- run every frame until GetTotemTimeLeft has changed
local function recheckTimers(self, elapsed)
local stillrecheck = false
local sendEvent
for slot, info in pairs(totemInfo) do
if info.recheck then
local newTimeLeft = GetTotemTimeLeft(slot)
if newTimeLeft ~= info.duration then
info.duration = (GetTime() - info.startTime) + newTimeLeft
print("duration2", info.duration, "exp", info.startTime + info.duration)
info.recheck = false
sendEvent = true
else
stillrecheck = true
end
end
end
if not stillrecheck then
totemTimerFrame:SetScript("OnUpdate", nil)
end
if sendEvent then
WeakAuras.ScanEvents("WA_TOTEM_UPDATE")
end
end
local function OnEventScript(self, event, totemSlot)
local timeLeft = GetTotemTimeLeft(totemSlot)
print("duration1", timeLeft, "exp", GetTime() + timeLeft)
totemInfo[totemSlot] = { duration = timeLeft, startTime = GetTime(), recheck = true }
WeakAuras.ScanEvents("WA_TOTEM_UPDATE")
totemTimerFrame:SetScript("OnUpdate", recheckTimers)
end
totemTimerFrame:RegisterEvent("PLAYER_TOTEM_UPDATE")
totemTimerFrame:SetScript("OnEvent", OnEventScript)
end
end |
I think totem slot numbers are not stable, that is a totem that is in slot X will when a totem with a lower slot number expires change it slot number. Though I might be misremembering. Probably worth testing Can't demo warlocks summon multiple totems of the same type? And historical, the first implementation of Gargoyle increased its duration each time the player used runic power. I'm not 100% certain it was an totem back then though. But class designers have used the totem api for lots of things, which behave in lots of ways... Is this totem inaccuracy new with TWW? Or what triggered this investigation? |
Yes, it's even on a 1 min cd now so it's not quite so annoying to test with: Cast Call Dreadstalkers, then Summon Demonic Tyrant (extending all totem summons by 15 seconds), and then Call Dreadstalkers again. Also, I believe restoration shamans can summon two Healing Stream Totems at once. |
I can't tell if this inaccuracy is new, this discord thread caught my attention https://discord.com/channels/172440238717665280/1280310878096593058/1280310878096593058 and i was surprised to see the game wasn't using GetTotemInfo You guys convinced me this is something wow's dev needs to solve, and we shouldn't try to work around it Opened a ticket at Stanzilla/WoWUIBugs#651 |
Is there an existing issue for this?
Description
TotemFrame.lua use the function
GetTotemTimeLeft
to show remaining timeTotem trigger use startTime + duration from
GetTotemInfo
following aura show difference between these 2 when i drop a Earthbind Totem
Wow_2024-09-03_01-53-05.mp4
When i drop totem, using data from GetTotemInfo timer start at 19.5379 instead of 20
Totem visually despawn when GetTotemTimeLeft reach 0
Problem is that GetTotemTimeLeft is only accurate when totem is casted, when checking later with a scheduled scan the data is not good enough
A solution could be to keep track of timers in GenericTrigger.lua, only update value when there was no totem or value is higher than calculated remaining time + gcd?
WeakAuras Version
dev
World of Warcraft Flavor
Retail (Default)
World of Warcraft Region
EU
Tested with only WeakAuras
I got this issue with only WeakAuras enabled
Lua Error
No response
Reproduction Steps
drop a Earthbind Totem on shaman
Last Good Version
No response
Screenshots
No response
Export String
No response
Bisector Report
No response
The text was updated successfully, but these errors were encountered: