ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Possible to check if player have DLC access? (https://www.esoui.com/forums/showthread.php?t=6194)

SnowmanDK 03/20/16 02:37 PM

Possible to check if player have DLC access?
 
I wonder if there is a function I missed that can tell me if a player have access to a specific DLC.
I need it to hide/show certain quests.

Lets say each DLC was given a number value, like this:
1 = Imperial City
2 = Orsinium
3 = Thieves Guild

and the function was like this:
isDLCAvailable(DLC number)
Returns true/false depending on if the player has access to that DLC.

Then I could do something like this:

Lua Code:
  1. If isDLCAvailable(2) then
  2. -- show quests in the Orsinium dlc zone and subzones
  3. end

sirinsidiator 03/20/16 02:46 PM

The collections menu shows exactly what you ask for. Take a look at collections/keyboard/dlcbook_keyboard.lua and you will find that the function you are looking for is called GetCollectibleUnlockStateById and returns a CollectibleUnlockState.
The ESOUIDocumentation.txt shows that CollectibleUnlockState can be one of these three values:
  • COLLECTIBLE_UNLOCK_STATE_LOCKED
  • COLLECTIBLE_UNLOCK_STATE_UNLOCKED_OWNED
  • COLLECTIBLE_UNLOCK_STATE_UNLOCKED_SUBSCRIPTION

Now you just need to figure out how to get the collectibleIds for the DLCs.

Ayantir 03/20/16 03:11 PM

254 - Thieves Guild
215 - Orsinium
154 - Imperial City

For the list :
Lua Code:
  1. local name, _, numCollectibles, unlockedCollectibles, _, _, collectibleCategoryType = GetCollectibleCategoryInfo(COLLECTIBLE_CATEGORY_TYPE_DLC)
  2.  
  3. for i=1, numCollectibles do
  4.     local collectibleId = GetCollectibleId(COLLECTIBLE_CATEGORY_TYPE_DLC, nil, i)
  5.     local collectibleName, _, _, _, unlocked = GetCollectibleInfo(collectibleId) -- Will return true or false. If the user unlocked throught ESO+ without buying DLC it will return true.
  6.     d("DLC ".. collectibleName .. "( ".. collectibleId .. ") unlocked : " .. tostring(unlocked))
  7. end

SnowmanDK 03/21/16 02:00 AM

Thanks for your replies :)
Didn't think about checking the collectibles functions :o

Now I just need to find out how to get the Thieves Guild Skill Line level...

Ayantir 03/21/16 09:37 AM

Lua Code:
  1. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  2.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  3.     if skillLineName == GetString(DESTINATIONS_DLC_SKILLLINE) then
  4.         local GetNumSkillAbilities(SKILL_TYPE_GUILD, i)
  5.         -- etc.
  6.         break
  7.     end
  8. end


DESTINATIONS_DLC_SKILLLINE =

de = "Diebesgilde"
fr = "Guilde des voleurs"
en = "Thieves Guild"

sirinsidiator 03/21/16 10:58 AM

Wouldn't it be better to check the first abilityId in each skill line? That way you are independent of translations.

Ayantir 03/21/16 11:22 AM

It can change too.

They changed skills in IC (Racial passives).
They deleted the skillLine 2 in IC (Emperor) make the 3rd become the 2nd (Assistance moved from 3rd to the 2nd).
And they added a skillline in the 3rd position instead of the 4th with TG.
And for World it can change depending of skillline unlocking.
And for Tradeskills, skilllines are not even sames if you are starting game in EN , DE or FR.

And with a revamp, they can add skills too.

Plus, for 1 skill, you can have 12 abilityId. Per exemple here are abilityId of DK Skill 1 of Draconic Skillline (1st skill line).
Lua Code:
  1. [SKILL_TYPE_CLASS] = {
  2.     ["Draconic"] = {
  3.     [1] = {["skillPool"] = {
  4.     [0] = {[1] = {["id"] = 29012,},[2] = {["id"] = 33652,},[3] = {["id"] = 33655,},[4] = {["id"] = 33658,},},
  5.     [1] = {[1] = {["id"] = 32719,},[2] = {["id"] = 33662,},[3] = {["id"] = 33665,},[4] = {["id"] = 33668,},},
  6.     [2] = {[1] = {["id"] = 32715,},[2] = {["id"] = 33671,},[3] = {["id"] = 33675,},[4] = {["id"] = 33679,},},
  7.     },["at"] = ABILITY_TYPE_ULTIMATE,},


And with passive they can add unlimited #amount of passives ranks.

So yes, there is not real proper way to do it, you'll need to check at each new DLC.

SnowmanDK 03/22/16 02:02 PM

Quote:

Originally Posted by Ayantir (Post 26544)
Lua Code:
  1. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  2.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  3.     if skillLineName == GetString(DESTINATIONS_DLC_SKILLLINE) then
  4.         local GetNumSkillAbilities(SKILL_TYPE_GUILD, i)
  5.         -- etc.
  6.         break
  7.     end
  8. end


DESTINATIONS_DLC_SKILLLINE =

de = "Diebesgilde"
fr = "Guilde des voleurs"
en = "Thieves Guild"

You code returns the number of abilities in a skill line, not the level ;)
But it got me started, and I ended up with this:

Lua Code:
  1. local skillLineLevel, DLC_TG_SkillLine = nil, nil
  2. if localLanguage == "de" then
  3.     DLC_TG_SkillLine = "Diebesgilde"
  4. elseif localLanguage == "fr" then
  5.     DLC_TG_SkillLine =  "Guilde des voleurs"
  6. else
  7.     DLC_TG_SkillLine = "Thieves Guild"
  8. end
  9. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  10.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  11.     if skillLineName == DLC_TG_SkillLine then
  12.         _, skillLineLevel = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  13.         break
  14.     end
  15. end
Thanks for the tips. Case closed :)


All times are GMT -6. The time now is 04:51 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI