Translating Combat Event to group member's unitTag
Hello.
I'm writing my own Roaring Opportunist tracker that checks the presence of RO Cooldown ability on the group members dynamically. However, this is not a "buff" so it cannot be pulled from Code:
GetUnitBuffInfo("group" .. i, j) First, in OnUpdate function I go through every group member and fill my GroupDict dictionary like this: Code:
local groupMemberName = GetRawUnitName("group" .. i) Why I am doing this is because I use EVENT_COMBAT_EVENT's targetName. So when I get the event, I fill my event buff tracker dictionary: Code:
if DynamicRO.GroupDict[targetName] ~= nil then Finally, back in the group loop, if I see that the unitTag's corresponding EventBuffTracker RO buff is nil or less than the current time, I can conclude that RO needs to be recast. ... Now, is there a better way for this? I kinda don't like this workaround with using 2 external dictionaries. I also found it to be unstable at times and thus I had to add Code:
DynamicRO.GroupDict[targetName] ~= nil I hope I was clear enough with my explanation and would appreciate some help. Cheers! |
I think there is no existing vanilla mapping between group unitTags and their names/rawNames. Some events at groups may fire both, not sure.
At best have a look at the ESOUI source code -> group to see what vanilla ZOs code does: https://github.com/esoui/esoui/tree/...i/ingame/group First question: "OnUpdate"? Why not filling and removing entries in your group dict table at the event_group_joined / left callbacks as the group members join and leave your group? They do not need to be re-added or removed each n milliseconds so an OnUpdate is not needed afai understand. You should be easily able to loop over all grouped players and update your dictionary as these events trigger. Hints: I understand that you use the combat event to compare the group's unitTag with the event's name or rawName (or vice versa)? Should work with your method then, yes. In your OnUpdate, which should only be active within combat or certain cases then to make it performant, you can compare your dictionary of grouped names with the combat event's unitTag. You should definately add event filters to that combat events then, e.g. the REGISTER_FILTER_COMBAT_RESULT, the group prefix REGISTER_FILTER_UNIT_TAG_PREFIX "group", and if you know the abilityId of that casted buff also use REGISTER_FILTER_ABILITY_ID https://wiki.esoui.com/AddFilterForEvent And you should define local pointer variables to your tables to speed up the access to them, e.g. Else the code will "each time" search _G table for DynamicRO, then it will search the table DynamicRO for GroupDict and so on. If you use a local pointing to a table, updates on that local will update the table properly (add/remove). Lua Code:
|
|
All times are GMT -6. The time now is 05:35 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI