ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Has anyone found the collectibleId's for companions (https://www.esoui.com/forums/showthread.php?t=9788)

Wulfrun 06/12/21 05:12 PM

Has anyone found the collectibleId's for companions
 
I want to make a slash command to toggel my companions. The following was mostly a guess on my part.

I found:
COLLECTIBLE_CATEGORY_TYPE_ASSISTANT = 8
COLLECTIBLE_CATEGORY_TYPE_COMPANION = 27
from https://esoapi.uesp.net/100035/globals.txt (2021-06-02 15:04:20). Line 83625.

Then I used GetCollectibleCategoryType(n) with n from 1 to 6000 and displayed in chat any n value with a return of 8 OR 27. All 5 of the type 8 (assistants) were returned but no type 27's were found. The assistant value was just a check to be sure it was working.

Has anyone found the correct Id or know what I might try to find the code?

Happy Trails

FYI my code:
for n = 1,6000,1 do
rdN = GetCollectibleCategoryType(n)
if rdN == (8 or 27) then
df("|c008FCCn= %d N= %d", n, rdN)
end
end

Calamath 06/12/21 05:28 PM

The number 6,000 is too small, so if you set it to 30,000, you will probably find it. :p

Baertram 06/12/21 05:28 PM

Dunno anymore how I found them but it was somehow via merTorchbug ingame I guess and using the API given for the companion collectibles.

Code:

local companionInfo = {
    [1] = 9245,    -- Bastian Helix, companionDefId 1,
    [2] = 9353,    -- Mirri Elendis, companionDefId 2,
}


ExoY 06/12/21 05:31 PM

"Mirri Elandis" id = 9353
"Bastian Hallix" id = 9245

I use those ID's in combination with the function "UseCollectible( *id* ) to summon and unsommon the companions.


for future references: this is the function I wrote to find collectible Ids:

Lua Code:
  1. function Development.FindCollectibles( str, limit) 
  2.   local output = false
  3.   for id=1,type(limit)=="number" and limit or 10000 do
  4.     local collectible = string.lower( GetCollectibleName(id) )
  5.     if string.find(collectible, string.lower(str)) then
  6.       d( zo_strformat("<<1>> <<2>>", id, collectible) )
  7.       output = true
  8.     end
  9.   end
  10.   if not output then d("no collectible found") end
  11. end

Calamath 06/12/21 05:40 PM

I will share with you the special code I use in Calamath's Shortcut Pie Menu add-on.

Lua Code:
  1. for index = 1, GetTotalCollectiblesByCategoryType(COLLECTIBLE_CATEGORY_TYPE_COMPANION) do
  2.     local collectibleId = GetCollectibleIdFromType(COLLECTIBLE_CATEGORY_TYPE_COMPANION, index)
  3.     d(collectibleId)
  4. end

good luck.

- Calamath

Wulfrun 06/12/21 11:38 PM

Thanks all, very much appreciated


All times are GMT -6. The time now is 02:35 PM.

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