Quantcast
Download
(2 Kb)
Download
Updated: 07/15/19 12:09 PM
Pictures
File Info
Compatibility:
Scalebreaker (5.1.5)
Updated:07/15/19 12:09 PM
Created:07/14/19 10:12 PM
Monthly downloads:120
Total downloads:217
Favorites:0
MD5:
5.1.5
Maarselok Helmet Proc cooldown tracker
Version: 1.0.1
by: dowinterfor6 [More]
A simple addon to track the cooldown of the new helmet set.

(My first addon, was an exploration of LUA)
v1.0.1 Updated file structure, implemented changes suggested by Baertram
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Uploader
Date
1.0.0
2kB
07/14/19 10:12 PM


Post A Reply Comment Options
Unread 08/16/19, 05:03 PM  
BruceLeeRoy

Forum posts: 0
File comments: 1
Uploads: 0
I can't get this addon to work at all, it there some slash command I need to be using? any advice would be greatly appreciated :-)
Report comment to moderator  
Reply With Quote
Unread 07/15/19, 12:11 PM  
dowinterfor6
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 1
Uploads: 1
Hey Baertram! Thanks for the quick response, I've updated the addon with your suggestions, and I'll double check it myself when I get back to my desktop again later today. Thank you for the suggestions and improvements!

Originally Posted by Baertram
...
Report comment to moderator  
Reply With Quote
Unread 07/15/19, 04:06 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2274
File comments: 2509
Uploads: 57
Hi, welcome to the addon community and thanks for the addon.
As you said it's your first addon I had a quick check if you are able to improve it somehow.

1st thing I recognized - ZP archive is missing the foldername -> Addon won't work this way!
The zip archive is packacked wrong!
You need the foldername of the addon (must be the same as your txt filename) on top level and then the files lua txt xml etc. below!
Or the game won't recognize this addon and Minion is not able to provide it as download neither.

Code:
MaarselokTracker.zip:
|-MaarselokTracker (folder)
   |-MaarselokTracker.lua
   |-MaarselokTracker.txt
   |-MaarselokTracker.xml
2nd thing - EVENT_ADD_ON_LOADED should be unregisteerd if not needed after addon was loaded:
Your event EVENT_ADD_ON_LOADED should be unregistered once your addon got loaded or it will be called for every other addon again. EVENT_ADD_ON_LOADED of each registred addon will be called each time an addon or ZOs code or a library is loaded again, that#s why the is addonName = myaddon.name check is in there.
If you do not need to recognize other addons (like you want to check if event's addonName variable is == "OtherTrackerName" to be sure it was loaded as well -> should be in your txt file's ##OptionalDependsOn: OtherTrackerName then to be sure it is loaded BEFORE your addon got loaded) you should unregister your's after it got loaded like this:
Lua Code:
  1. function MaarselokTracker.OnAddOnLoaded(event, addonName)
  2.   -- EVENT_ADD_ON_LOADED fires for each addon, check for own
  3.   if addonName ~= MaarselokTracker.NAME then return end
  4.   --We only get here if it's our addon, so initialize it and unregister the event
  5.   EventManager:UnregisterForEvent(MaarselokTracker.NAME, EVENT_ADD_ON_LOADED)
  6.   MaarselokTracker:Initialize()
  7. end

3rd - Event filtering for your own unitTag "player" only:
Well done with teh event filtering. It will only fire as your Maarselok abilityId is recognized but it will also fire if other players got it. Not sure if the game provides this information but to be sure you should also add an event_filter for your own player, which makes the game check less on lua side and more on c code side, making it work a bit faster. As the eventfilter and eventregister name bust be th same (and unique) for each eventName and filterName pair you can just reuse the same eventName MaarselokTracker.NAME as the filterName is another one (REGISTER_FILTER_UNIT_TAG):
Lua Code:
  1. EVENT_MANAGER:AddFilterForEvent(
  2.     MaarselokTracker.NAME,
  3.     EVENT_COMBAT_EVENT,
  4.     REGISTER_FILTER_UNIT_TAG,
  5.     "player"
  6.   )

4th proposal is only a minor thing, unregister update timer before registering it new:
Before using a RegisterForUpdate function you should unregister the old one with the same name just to be sure it is invalidated. If you are using the same name for them the unregister will happen automatically (I assume) as it will be overwritten with the new one.
But to be sure you could call
EVENT_MANAGER:UnregisterForUpdate(MaarselokTracker.NAME)
just before using EVENT_MANAGER:RegisterForUpdate(MaarselokTracker.NAME, ...).
If nothing was registered with this name it will silently fail and that's all.

Thanks again for the addon, I'm planign to play with the set and I think this is a nice helper.
Last edited by Baertram : 07/15/19 at 04:31 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: