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:
local function ArmoryBuildLoaded(_, result, buildIndex)
if result ~= ARMORY_BUILD_RESTORE_RESULT_SUCCESS then
d("Armory Load Failed")
return false
end
ArmoryStyle.savedVariables.currentBuildIndex = buildIndex
for collectibleType, id in pairs(ArmoryStyle.savedVariables.builds[buildIndex].collectibles) do
local eqippedCollectible = GetActiveCollectibleByType(collectibleType, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
if eqippedCollectible ~= id then
if id ~= 0 then
if IsCollectibleUnlocked(id) and IsCollectibleUsable(id, GAMEPLAY_ACTOR_CATEGORY_PLAYER) and IsCollectibleValidForPlayer(id) then
UseCollectible(id, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
else
d("Error occurred Setting Collectible")
end
else
if eqippedCollectible ~= 0 then
-- If a collectible is already equipped then we want to 'un-use' the current one
UseCollectible(eqippedCollectible, GAMEPLAY_ACTOR_CATEGORY_PLAYER)
end
end
end
end