View Single Post
08/14/15, 03:47 PM   #9
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Some great technical answers have already been given, so I tried to list a few more basic answers.

Originally Posted by haggen View Post
Still, I don't grasp most of the concepts here, for instance, what is a Scene ?
A scene is a group of fragments (windows) that are shown/hidden all at once when the scene is shown/hidden. So basically it just shows/hides a group of objects so you don't have to show/hide each individual object.

Originally Posted by haggen View Post
2. The most prominent ZO_* objects, what they're for and how can you benefit from them
Heres a thread where it was discussed: zo_objects

Originally Posted by haggen View Post
2. Callbacks; I know what they're but what are some actual use cases, besides events I haven't see any asynchrony
They are used when you need to run code after something happens, typically used when there is not a pre-defined event for something. Merlights example of using callbacks with the inventory is a great example. Some others might be if you need to run some code when the fence "Sell" panel or the fence "Luander" panel opens. There is an event for when the fence window opens or closes, but not for the invididual "sell" & "launder" panels. You could register a callback
Lua Code:
  1. FENCE_MANAGER:RegisterCallback("FenceEnterSell", OnFenceEnterSell)
  2. FENCE_MANAGER:RegisterCallback("FenceEnterLaunder", OnFenceEnterLaunder)
And then whenever that window/panel is shown it will run your function. Other useful ones might be when the map changes, or when a scenes state changes (when it is shown/hidden).
Lua Code:
  1. WORLD_MAP_SCENE:RegisterCallback("StateChange", OnMapStateChange)
  2. CALLBACK_MANAGER:RegisterCallback("OnWorldMapChanged", OnWorldMapChanged)

Originally Posted by haggen View Post
One question though; when developing an add-on with a form-like GUI, should I use an existing scene or scene fragment or should it reside in its own ? And why ?
It depends on when you want it shown. If you want your GUI to show "with" the other fragments in a scene, then you would put it into that scene. For example if you created something that was related to the world map, you may only want it to show when the world map is shown, so put it in that scene. If your GUI is unrelated to, or not strictly tied to, the fragments in any given scene then you probably want to create your own scene for it.


Originally Posted by haggen View Post
3. Other stuff that once you discovered allowed you to write add-ons more efficiently and add more features
  1. Using the free program "Total Commander" that allows you to search multiple files at once to search the eso lua code for functions/constants to allow me to see an example of how it is used. I'm sure there are other programs that do this, but this is one Garkin told me about & I would not have been able to do a fraction of what I have done without it.
  2. Knowing how to look up functions, constants, & their values in game. You can look them up on the wiki, but this has saved me a lot of time. There are at least 2 addons that I know of that do the work for you Click4Info and Mer Torchbug
  3. Learning how to use zgoo or merlights new Mer Torchbug
  4. Using some type of ingame notepad that allows you to write & run code from within the game so you don't have to alt+tab out, write some code, go back to the game, & reload the ui to test something. Addons that do that: Click4Info and ZAM Notebook
  Reply With Quote