Thread Tools Display Modes
08/10/21, 01:21 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
New to AddOn creation? - Usefull links and information

!Attention: The ESOUi Wiki is updated manually and is not always updated with the current files and data!
Always have a look at the top of the pages where the last update date is shown (if provided),
or have alook at the change history feature of the Wiki page, and you'll see if it's up2date or not.


Important! Read first
What addons MUST not , can and cannot do (please read BEFORE starting new addons)


-Getting started with lua and ESOUI-
Programming in Lua is an excellent guide to Lua for those who are not all that familiar with it.
lua - Everything is a table
ESO and lua - What lua version is eso using?

ESOUI addon WIKI ("Getting started" at the top right side)
-Getting started with ESO AddOn development-

AddOn structure / files (txt manifest)
AddOn re-usable libraries/dependencies



-ESOUI API provided by ZOs-
The API functions are listed in the txt files "ESOUI Documentation *.txt" which are linked to the ESOUI Wiki APIversion history entries:
https://wiki.esoui.com/APIVersion
Click on an API version and download the attached ESOUI documentation * .txt file.
Current live server: https://wiki.esoui.com/APIVersion#live_API_version
Current PTS (Public test Server): https://wiki.esoui.com/APIVersion#PTS_API_version
To get the most up2date API version login to the server (live, PTS) and use this script in the chat edtibox:
Code:
/script d(GetAPIVersion())
The returned 6 digit number, e.g. 101040, is the current API version of the server then.


-ESOUI source code-
ESOUI source code, locally for you
ESOUI source code at github (search etc.)


-Existing ESO language constants-
Those can be used via function GetString(SI_...) in your addons so you do not need to re-translate existing texts/words.
Examples how to use: Example1 How to extract the string constant, Example2: How to add localization support via files, and using SafeAddString + SafeAddVersion
https://github.com/esoui/esoui/blob/...tedstrings.lua
https://github.com/esoui/esoui/blob/...tedstrings.lua


-Existing ESOUI helper global functions and code-
https://github.com/esoui/esoui/tree/...soui/libraries (libraries of ZOs)
https://github.com/esoui/esoui/tree/...raries/globals (like time, sound, color, debug utils, etc.)
https://github.com/esoui/esoui/tree/...raries/utility (utilities like anchor, hook, etc.)
https://github.com/esoui/esoui/tree/...tableutils.lua (table functions)


-Other ESO related websites with information, etc.-
Get in touch with other eso devs (chat)
UESP Log Data viewer
Sharing/Upload of SavedVariable files of LibDebugLogger -> Easy way to get feedback about errors


-ESO addons helping to debug/create addons-
ESO addon dev tools & addons


-ESO coding IDE (plugins and/or auto completion)-
ESO: IDE, auto completion, plugins, etc.


-Reviving/Changing older addons-
What to check and change for older addons you'd like to revive


-ESOUI best practice & coding hints-
  • You are able to test code ingame in the chat editbox by using the slash command /script <your code here>
  • To reload the UI type /reloadui into the chat edit box and press the return key. To do this within lua code you need to use the function ReloadUI("ingame").
    You can shorten the /reloadui slash command by using any addon already providing some other slash command like /rl or /rlui, or just add this to your addon's lua file EVENT_ADD_ON_LOADED callback:
    Code:
    if SLASH_COMMANDS["/rl"] == nil then SLASH_COMMANDS["/rl"] = function() ReloadUI("ingame") end end
  • Always disable other addons before testing your addon to make sure nothing else interferes!
  • Addons need a folder in your live/AddOns folder. Within the folder you need 1 manifest (.txt) filename with exactly the same name as the folder!
  • Manipulating the manifest (.txt) files of your addons while you are logged in to the game world might not affect all addons properly, especially if you change the dependencies! You should logout if you have changed dependencies in txt files, and login new to the world.
  • EVENT_ADD_ON_LOADED will fire for EACH of your enabled addons once! You must check the addonName parameter against your addon's name to make sure your addon was currently loaded. And you may unregister the event within your addon's EVENT_ADD_ON_LOADED callback function, after your addonName was met, in order to not let it run through your callback for each other addon (if not needed, like if you want to collect all other loaded addon names etc.).
  • If not explicitly defined with the word "local" up in front variables will be global and pollute the global _G table! This means: if your variable name is a common one like i and you do not define it as local i, your global i (= _G["i"]) will overwrite all other local i variables having the same name!
    So either define variables local or define 1 global table for your addon, e.g. myAddon = {} and then add all functions and variables that need to be global to that table. You can define a local speed up reference like local ma = myAddon and add functions variables to ma then
  • If you feel the need to split up your addon into multiple lua files define 1 global table for your addon (see the hint above) and just add 1 line to the start/most top of each lua file: myAddon = myAddon or {}
    This will check if myAddon is not == nil and reuse myAddon then, else it will create a new empty table myAddon
  • lua code is compiled from top to bottom of a file. Your local variables need to be defined before/in their scope (if ... end, for ... do, function ...end, etc.) in order to be found!
  • If textures ingame are not shown (invisible) after you have added new custom .dds texture files to your addon, or changed any texture usage, logout, navigate to the live/ folder and delete the file shader_cache.cooked. After the next login (will take a bit longer as usual as the cache get's rebuild) it should be shown. If textures show white/black in total the path to the .dds file is wrong and needs to be corrected!
  • You wont see any chat output like d() before EVENT_PLAYER_ACTIVATED! You need to use other addons like pChat (or forks like rChat) or LibDebugLogger + the DebugLogViewer UI to activate the capture of these messages before the "visual chat" is ready for output.
  • Clean addon output in a seperated UI from chat. Also add debug messages to your addon noone can see, if DebugLogViewer UI is not enabled, and LibDebugLogger is set to mode "Info" only. Also share debugging info with others: LibDebugLogger and the UI DebugLogViewer (online upload/sharing of LibDebugLogger SavedVariable files: Log viewer)
  • SavedVariables are used to store data of addons on your disk. They will only be written at a reload of the UI, or as a loading screen (during a zone change e.g.) happens. SavedVariables are kept in the ingame memory as long as you are logegd in! So changing the files won't affect anything as they will be overwritten at the next reload UI/loading screen from the ingame memory again!
    The ZOs wrapper functions ZO_SavedVariables can be used to access those SavedVariables in your addon. They support accountWide and perCharacterId (unique accross servers and rename safe) saved data.

    You can also use the API function GetWorldName() and pass it to your ZO_SavedVars wrapper (or your own wrapper) to save the data server dependent.
    Please also read here about ZO_SavedVariables parameters and how to save it differently on each server (NA, EU) -> This maybe only needed if you use NewAccountWide SavedVariables type AND you want to differ the settings of your same account on server NA and server EU!
    https://wiki.esoui.com/AddOn_Quick_Q...cal_machine.3F
  • If your addon needs a settings menu use e.g. LibAddonMenu for that, as it is common and easy to use. Most addons providing settings already rely on it. It supports widgets for new added settings controls. Just search for addons beginning with "LibAddonMenu" to list them.
  • If your addon needs a tutorial with how to use instructions/steps LibTutorial can help. It provides different tutorial styles, where the pointer box even supports LibAddonMenu & it's submenus (will open and scroll to the controls in the settings menu which you have defined, in order to jump with each tutorial step to the next settings control).
  • If your addon needs a right click context menu or you want to add more entries to the inventory right click context menu, use LibCustomMenu for that
  • Before re-inventing the wheel check the given libraries via the addon search (type "lib" and you should see them all) and re-use the provided libraries at best. Especially LibGroupSocket (share group data), LibMapPing (map ping related stuff liek sahring group data), LibHistoire (Guild history data cached)
  • Do not create libraries (or at least do not release them via www.esoui.com) for only 1 addon, please! Especially not with a name = Lib<YourAddon> or Lib<YourDeveloperName> (this would maybe make sense if you create the library for multiple of your addons). Libraries should be re-usable code for multiple addons, else you could simply include the library's data into the 1 addon's own code files.
  • Minion (the addon manager) can be used to easily download and install/update your addons. Please read the Minion forum e.g. the "Howto install", but especially the sticky thread about the "Minion troubleshooting" BEFORE installation and make sure to follow the info given there, e.g. install 32bit version of Minion 3 even if your OS is a 64bit system!).

    All addons released at www.esoui.com can be found within Minion as well.
    Exceptions:
    -Addons listed as "Outdated & discontinued"
    -The following categories: "Developer utilities", "ESO Tools & Utilities"

Last edited by Baertram : 12/19/23 at 06:09 AM.
  Reply With Quote
08/11/21, 04:21 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
If you want to add missing information, tools, ressources, addons, or correct the given one, please either write me a private message, or reply here to the topic.
Please do not post any off topic or start discuissions in here, but only add relevant information/sources.
After the info was corrected/added I'd be glad if you could delete your posts again so that the thread stays clean.
Thank you
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » New to AddOn creation? - Usefull links and information

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off