Thread Tools Display Modes
08/25/21, 01:59 PM   #1
Leonardo1123
AddOn Author - Click to view addons
Join Date: Aug 2021
Posts: 19
Question Issue with Equip Outfit? Only equipping the first slot.

Here's my code, and the following is the chat output when entering combat.

My other outfits are identical to "No Outfit" except for the dye channels, could it possibly be that they're technically null as a "style?"

Edit: I was able to rule that out as the reason.
Edit: So for more specifics, EquipOutfit() is behaving the same as EquipOutfit(-1) the same as ..(1) same as ..(2).

Thanks for any and all help! First addon.

Code:
Lua Code:
  1. function LeonardosWardrobeManager.OnPlayerCombatState(event, inCombat)
  2.     -- The ~= operator is "not equal to" in Lua.
  3.     if inCombat ~= LeonardosWardrobeManager.inCombat then
  4.         -- The player's state has changed. Update the stored state...
  5.         LeonardosWardrobeManager.inCombat = inCombat
  6.  
  7.         -- ...and then announce the change.
  8.         if inCombat then
  9.             d("Entering combat.")
  10.             EquipOutfit(3)
  11.             d("Equipped Outfit: " .. GetOutfitName(3))
  12.             d("Outfit Index: " .. GetEquippedOutfitIndex())
  13.         else
  14.             d("Exiting combat.")
  15.             UnequipOutfit()
  16.         end
  17.  
  18.     end
  19. end

Output:
Code:
[2:57PM] Entering combat.
[2:57PM] Equipped Outfit: Paladin // outfit 3 is "not" named paladin
[2:57PM] Outfit Index: 1
Outfits:

Last edited by Leonardo1123 : 08/25/21 at 02:33 PM.
  Reply With Quote
08/26/21, 04:26 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
You should use the outfit manager to equip the outfit.

Outfit_Manager:EquipOutfit(actorCategory, outfitIndex)
As Outfit_Manager is the class you need to use the object for it:
ZO_OUTFIT_MANAGER

So ZO_OUTFIT_MANAGER:Outfit_Manager:EquipOutfit(actorCategory, outfitIndex)
See file esoui/ingame/outfits/outfit_manager.lua


The function EquipOutfit needs the same 2 parameters btw, not only an index! 1st param is actorCategory
EquipOutfit(actorCategory, outfitIndex)

Every function where a companion could be involved needs this actorCategory now!

actorCategory is of this type:
GAMEPLAY_ACTOR_CATEGORY_COMPANION = 1
GAMEPLAY_ACTOR_CATEGORY_PLAYER = 0


Edit:
You need to check the API documentation of the MOST CURRENT ApiVersion (see here for the live server, or use the PTS version for the PTS
https://wiki.esoui.com/APIVersion#live_API_version
and then check the linked ApiDocumentation .txt file) and not anything you find which maybe outdated of older APIversions!
The ESOUI Wiki is not updated in total. Always check at the top of the main page (functions, events, constants, etc.) which APIversion it was updated with last and compare it to the current live version.

Last edited by Baertram : 08/26/21 at 04:29 AM.
  Reply With Quote
08/26/21, 11:36 AM   #3
Leonardo1123
AddOn Author - Click to view addons
Join Date: Aug 2021
Posts: 19
Thank you very very much!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Issue with Equip Outfit? Only equipping the first slot.

Thread Tools
Display Modes

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