I have a watched trigger that fires when other triggers are active; it also checks when those other triggers become inactive, but I'm not sure how to actually check for that in code, as when the triggers are inactive, the updatedTriggerStates param doesn't have useful information (and I'm having trouble checking if its nil or similar).
Backstory - I have multiple simple triggers for buffs, bloodlust, combat potion, lightweave proc, engi gloves activated, etc.
I want to display how many are active at any given time. 0 if none are, 1 if just bloodlust, 2 if bloodlust + engi gloves...etc
function(event, triggerNum, triggerStates)
if event == "TRIGGER" and triggerNum then
DevTool:AddData(event, "event")
DevTool:AddData(triggerStates, "triggerStates")
DevTool:AddData(triggerNum, "triggerNum")
if next(triggerStates) == nil then -not consistently working
aura_env.score = aura_env.score - 10
end
for _, state in pairs(triggerStates) do
if state.show then
aura_env.score = aura_env.score + 10
end
end
return true
my devtool just shows the triggerStates table as not having anything in it (when the function is checked upon losing one of the buffs)