Quantcast
optional dependencies - ESOUI
Thread Tools Display Modes
03/20/22, 06:24 AM   #1
Octopuss
 
Octopuss's Avatar
Join Date: Jul 2017
Posts: 157
optional dependencies

Could anyone explain what this means? English is not my native language so I might be missing something, but I always thought that when something depends on something else, it's a hard requirement, so how can a dependency be optional?
  Reply With Quote
03/20/22, 07:50 AM   #2
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 388
Let's say for Quest Map it has an optional dependency for a text box. So when you type a slash command a list of hidden quests appears in the text box. If the author made that optional then when you load the mod the game checks both required and optional libraries. If you are missing the requirements then the mod doesn't load. If you are missing the optional dependency then the mod will load anyway because the author checks to see if the dependency is loaded before using it. Authors have to specify the optional dependency in a special text file to ensure that the game loads the optional dependency prior to the mod.
__________________
Admin for TES5Edit, occasional LOOT masterlist contributor, and Wrye Bash contributor. I also maintain special Fallout 3 and Fallout NV versions of Wrye Flash.

Last edited by Sharlikran : 03/20/22 at 09:47 AM.
  Reply With Quote
03/20/22, 08:35 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,162
https://www.esoui.com/forums/showthread.php?t=9149
-> "Dependency type"

Optional means: The addon loads even though the dependency is missing/not given with the correct version
## AddOnVersion in that dependencies txt file needs to be >= (higher or equal) the versionNumber that is provided at the addon that adds that [optional] dependency via
Code:
## OptionalDependsOn: addonName>=versionNumber
If the optional dependency is found with the correct version it will be loaded prior to the addon that needs that optional dependency,
means the lua and xml files of the dependency will load before the addon adding that dependency and the event EVENT_ADD_ON_LOADED of the dependency also will fire before the one of the addon adding the dependency.

An optional dependency could e.g. be another addon which we need to check for in our code but we need to assure for that, that it loads before ou own addon. If we add the optional dependency it will load before ours and we are able to check in our EVENT_ADD_ON_LOADED if the other addon was loaded or check fo the other addons global variable (e.g. libraries like LibAddonMenu2).

Also optional dependency could be even this LibAddonMenu-2.0 if you "could" add a settings menu but this is optional and your addon even works without it, only usng e.g. slash commands.
So in both cases it would load, either with a settings menu or without.



Non optional dependencies, defined via ## DependsOn: are MUST dependencies: Means the addon adding those dependencies will NOT LOAD if that non-optionald dependency is missing or not provided with the correct version.

Last edited by Baertram : 03/20/22 at 08:41 AM.
  Reply With Quote

ESOUI » General Discussion » Chit-Chat » optional dependencies

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