#Check in conditionals if two remainingTime vars are within 1 second of each each other?

17 messages · Page 1 of 1 (latest)

plush surge
#

I want to make a weakaura glow if spell 2 is on cooldown but spell 1 has a charge ready and its cooldown will finish in approximately the same time spell 2 comes off cooldown if I use up a charge. A simple "if var2-var1 <= 1 then" basically. How would I implement that in this case? :

gritty siren
#
function(states)
  if states[1].show and states[2].show and states[1].expirationTime and states[2].expirationTime then
    return abs(states[1].expirationTime - states[2].expirationTime) < 1
  end
end
outer grail
#

curious, wouldn't it be more performant to just tackle the timing check in another trigger? idk what the performance hit would be for the custom logic but I feel like setting a third trigger for spell 2 where its on cd but the time left to charge is the total cd of spell 1 would be how I'd tackle it and avoid custom logic

gritty siren
#

This is a very cheap check

outer grail
#

good to know

gritty siren
#

I think you're imagining that it runs every frame or something. It doesn't

outer grail
#

I guess I never really checked into how often these conditionals are evaluated but I assumed it triggered decently frequently

#

like prolly more event based then

gritty siren
#

Custom Checks runs on Trigger Update, plus any events you list.

outer grail
#

good to know, kinda niche q but I feel like I might change a few auras I have to squeeze an ultra tiny bit of more performance out of them -- would this then be a better alternative to listing several triggers and having custom trigger logic to only trigger off the first but use data from the non-triggering triggers?

#

since iirc custom trigger logic is a bit of a performance hit as well even if its usually pretty simple

gritty siren
#

Honestly, no idea.
You're probably splitting some very fine hairs there.

outer grail
#

thought it was but theres def some hair splitting dramatics being thrown out every now and again

#

just was curious tho since there isnt really a "suggested / best practices" guide out there detailing what you should and shouldnt do besides "creating frames is bad, clickable buttons are bad"