Quantcast
Download
(7 Kb)
Download
Updated: 09/23/21 01:58 PM
Compatibility:
Waking Flame (7.1.5)
Updated:09/23/21 01:58 PM
Created:04/13/21 05:17 PM
Monthly downloads:19,311
Total downloads:151,429
Favorites:137
MD5:
7.1.5
LibMotif  Popular! (More than 5000 hits)
Version: 7.2.1
by: ziggr [More]
LibMotif provides add-on authors with a single API call to determine if a character knows a crafting style or not.

Extracted from WritWorthy.

Available on github

LibMotif.IsKnown()

Code:
local motif_known = LibMotif.IsKnown(motif_id, item_page_num)

motif_id
    one of [1..117] such as 3 for "Orc" or 48 for "Redoran"
    See LibMotif_Data.DATA for a table of all 117 values.

item_page
    one of [1..14] such as 1 for "axes" or 9 for "legs".
    Correspond to the 14 purple motif pages.

    Unused for simple styles such as 3 Orc or crown-exclusives
    such as 58 Grim Harlequin
LibMotif.DATA

Lua Code:
  1. -- Motif ID ==> Achievement ID
  2. --
  3. -- is_simple = true
  4. --
  5. --      For the few motifs that lack 14 individual purple pages,
  6. --      is_simple is true. Use IsSmithingStyleKnown(motif_id).
  7. --
  8. -- achievement_id = 1423
  9. --
  10. --      For motifs with 14 individual purple pages, achievement_id tells
  11. --      the achievement_id to pass to
  12. --      GetAchievementCriterion(achievement_id, page_index)
  13. --      where n is a number 1-14.
  14.  
  15. LibMotif.DATA = {
  16.     [  1] = { is_simple       =  true } -- Breton
  17. ,   [  2] = { is_simple       =  true } -- Redguard
  18. ,   [  3] = { is_simple       =  true } -- Orc
  19. ,   [  4] = { is_simple       =  true } -- Dark Elf
  20. ,   [  5] = { is_simple       =  true } -- Nord
  21. ,   [  6] = { is_simple       =  true } -- Argonian
  22. ,   [  7] = { is_simple       =  true } -- High Elf
  23. ,   [  8] = { is_simple       =  true } -- Wood Elf
  24. ,   [  9] = { is_simple       =  true } -- Khajiit
  25. ,   [ 10] = nil                         -- Unique
  26. ,   [ 11] = { achievement_id  =  1423 } -- Thieves Guild
  27. ,   [ 12] = { achievement_id  =  1661 } -- Dark Brotherhood
  28. ,   [ 13] = { achievement_id  =  1412 } -- Malacath
  29. ,   [ 14] = { achievement_id  =  1144 } -- Dwemer
  30. ,   [ 15] = { is_simple       =  true } -- Ancient Elf
  31. ,   [ 16] = { achievement_id  =  1660 } -- Order of the Hour
  32. ,   [ 17] = { is_simple       =  true } -- Barbaric
  33. ,   [ 18] = nil                         -- Bandit
  34. ,   [ 19] = { is_simple       =  true } -- Primal
  35. ,   [ 20] = { is_simple       =  true } -- Daedric
  36. ,   [ 21] = { achievement_id  =  1411 } -- Trinimac
  37. ,   [ 22] = { achievement_id  =  1341 } -- Ancient Orc
  38. ,   [ 23] = { achievement_id  =  1416 } -- Daggerfall Covenant
  39. ,   [ 24] = { achievement_id  =  1414 } -- Ebonheart Pact
  40. ,   [ 25] = { achievement_id  =  1415 } -- Aldmeri Dominion
  41.  
  42. ...

LibMotif.MOTIF_PAGE

Lua Code:
  1. -- What to pass as page_index for
  2. -- GetAchievementCriterion(achievement_id, page_index)
  3. LibMotif.MOTIF_PAGE = {
  4.     AXES       =  1
  5. ,   BELTS      =  2
  6. ,   BOOTS      =  3
  7. ,   BOWS       =  4
  8. ,   CHESTS     =  5
  9. ,   DAGGERS    =  6
  10. ,   GLOVES     =  7
  11. ,   HELMETS    =  8
  12. ,   LEGS       =  9
  13. ,   MACES      = 10
  14. ,   SHIELDS    = 11
  15. ,   SHOULDERS  = 12
  16. ,   STAVES     = 13
  17. ,   SWORDS     = 14
  18. }
7.2.1 2021-09-23
  • Update 32/ESO 7.2.0/API 101032/Deadlands
  • achievement IDs for House Hexos, Ancient Daedric, Crimson Oath, Silver Rose

7.1.1 2021-09-13
  • Update 31/ESO 7.1.0/API 101031/Walking Flame
  • Achievment IDs for motifs: Black Fin Legion, Sul-Xan

7.0.1 2021-04-28
  • Update 30/ESO 7.0.0/API 100035/Blackwood
  • Achievment IDs for Blackwood motifs: Ancestral Akaviri, True-Sworn, Waking Flame, Ivory Brigade

6.3.2 2021-04-14
  • Soul Shriven fixed.

6.3.1 2021-04-13
  • Initial release.
Optional Files (0)


Archived Files (4)
File Name
Version
Size
Uploader
Date
7.1.1
7kB
ziggr
09/13/21 12:48 PM
7.0.1
7kB
ziggr
04/28/21 10:03 PM
6.3.2
7kB
ziggr
04/14/21 03:29 PM
6.3.1
7kB
ziggr
04/13/21 05:17 PM


Post A Reply Comment Options
Unread 09/17/21, 07:43 AM  
Schrappe

Forum posts: 0
File comments: 101
Uploads: 0
deleted by the user
Last edited by Schrappe : 09/17/21 at 08:15 AM.
Report comment to moderator  
Reply With Quote
Unread 04/29/21, 06:24 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 3719
File comments: 4541
Uploads: 68
Re: LibMotif 6.3.2/2021-04-14 fixes Soul Shriven

Alright, my fault then I only checked the code lines and did not look into the sv files. Thanks for the clarification


Originally Posted by ziggr
It was a bug in LibMotif:Export(). I erroneously favored the achievement (1418 "Soul Shriven Style Master") over my list of overrides in LibMotif.SIMPLE. Fixed now.

Baertram: As for saved variables: LibMotif doesn't even use 'em. I use them for the LibMotif_Scan.lua code myself, and was too lazy to comment them out for release. If you look in your saved vars file, it'll probably be empty except for a saved vars version number.

--Z
Report comment to moderator  
Reply With Quote
Unread 04/14/21, 03:35 PM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
LibMotif 6.3.2/2021-04-14 fixes Soul Shriven

It was a bug in LibMotif:Export(). I erroneously favored the achievement (1418 "Soul Shriven Style Master") over my list of overrides in LibMotif.SIMPLE. Fixed now.

Baertram: As for saved variables: LibMotif doesn't even use 'em. I use them for the LibMotif_Scan.lua code myself, and was too lazy to comment them out for release. If you look in your saved vars file, it'll probably be empty except for a saved vars version number.

--Z
Report comment to moderator  
Reply With Quote
Unread 04/14/21, 12:34 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 3719
File comments: 4541
Uploads: 68
It's in the data file at least:
Code:
,   [ 30] = { achievement_id  =  1418 } -- Soul Shriven
Thanks for the library ziggr!
Finally something I could use to strip the old library LibMotifCategories in AdvancedFilters and just create a new plugin based on your up2date library, as it seems.

But 1 addition you should definately add at once: Server dependent SavedVariables! As the data is stored account wide and many players play on the NA and EU server with the same account this should be taken into account from the beginning.
ZO_SavedVars:NewAccountWide(savedVariableTable, version, namespace, defaults, profile, displayName)

->
Lua Code:
  1. self.saved_vars = ZO_SavedVars:NewAccountWide(
  2.                               "LibMotifVars"
  3.                             , self.saved_var_version
  4.                             , nil
  5.                             , self.default
  6.                             , GetWorldName()
  7.                             )
Last edited by Baertram : 04/14/21 at 12:44 PM.
Report comment to moderator  
Reply With Quote
Unread 04/14/21, 11:04 AM  
JN Slevin
 
JN Slevin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 32
Uploads: 2
Soul shriven missing?

Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: