Thread Tools Display Modes
Prev Previous Post   Next Post Next
06/13/24, 01:20 PM   #1
RicAlmighty
Join Date: Jun 2024
Posts: 2
At my wits end. UseCollectible doesn't work for just one character

Hello all. An add-on that I used all the time (Armory Style Manager) has broken after the Gold Road update, so I went in to simplify and fix it. I am completely baffled though because the code works fine except for one of my characters (I have 8). When the add-on was working, it worked for all of my characters and honestly I did not change much in this specific area.

For some reason the call to
Code:
UseCollectible(id, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
results in a "COLLECTIBLE IS NOT READY YET" error for this one character, but not any of the others. For background, the failing character has 4 Armory Builds, and the others range from 2 to 3. It doesn't matter which build I switch to though as it fails every time with this character, but works with others.

For example, I will set a specific mount and personality for one Armory Build. The code fires after the event EVENT_ARMORY_BUILD_RESTORE_RESPONSE and iterates over the currently equipped items and attempts to replace the current items with the ones saved in my SavedVariables. I've triple checked the SavedVariables and they are fine. The code that saves the items works perfectly even for the character that is failing, it's only when I call UseCollectible() that I get the error for this one character.

At this point, I have no idea what else to do here. Perhaps there is just something borked with this one character? Did Gold Road change how this works in some way? I cannot understand why the same code works for the others but not for this one. I'd appreciate any insight or suggestions. Thanks

Relevant Code:

Lua Code:
  1. local function ArmoryBuildLoaded(_, result, buildIndex)
  2.     if result ~= ARMORY_BUILD_RESTORE_RESULT_SUCCESS then
  3.         d("Armory Load Failed")
  4.         return false
  5.     end
  6.  
  7.     ArmoryStyle.savedVariables.currentBuildIndex = buildIndex
  8.  
  9.     for collectibleType, id in pairs(ArmoryStyle.savedVariables.builds[buildIndex].collectibles) do
  10.         local eqippedCollectible = GetActiveCollectibleByType(collectibleType, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
  11.         if eqippedCollectible ~= id then
  12.             if id ~= 0 then
  13.                 if IsCollectibleUnlocked(id) and IsCollectibleUsable(id, GAMEPLAY_ACTOR_CATEGORY_PLAYER) and IsCollectibleValidForPlayer(id) then
  14.                     UseCollectible(id, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
  15.                 else
  16.                     d("Error occurred Setting Collectible")
  17.                 end
  18.             else
  19.                 if eqippedCollectible ~= 0 then
  20.                     -- If a collectible is already equipped then we want to 'un-use' the current one
  21.                     UseCollectible(eqippedCollectible, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
  22.                 end
  23.             end
  24.         end
  25.     end
  Reply With Quote
 

ESOUI » AddOns » AddOn Help/Support » At my wits end. UseCollectible doesn't work for just one character


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