Thread Tools Display Modes
08/17/14, 12:55 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
slotIndex of equipped armory always 0? (But ZGOO gives me other results)

Hi, I'm trying to get the slotIndex and bagId of all the equipment slots (only armory).
I think O'm doing some silly mistake but can't get it to work...

I've tried it with the following code:

Code:
	for i=1, ZO_Character:GetNumChildren() do
		equipmentSlotName = ZO_Character:GetChild(i):GetName()
		if(string.find(equipmentSlotName, "ZO_CharacterEquipmentSlots")) then
			--get the control of the current equipment slot
                   equipmentControl = ZO_Character:GetChild(i)
                   d("Slotindex:" .. tostring(equipmentControl.slotIndex))
            end
       end
I get the control this way. I'm able to hide/show it. ZGOO tells me the slotIndex ist e.g. 16.
But the d() function tells me it is 0 always?
  Reply With Quote
08/17/14, 01:16 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
If you need just bagId, slotIndex and not the controls, use BAG_WORN and http://wiki.esoui.com/Globals#EquipSlot constants. Not sure why it tells you 0, maybe you're asking before it's initialized?
  Reply With Quote
08/17/14, 03:00 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
No, I'm trying to read them after a right-click with the mouse on it and choosing a new added menu item.
It works perfetcly for a single slot. But if I want to update all in a for... loop it's not working.

I need the control because another texture control is added to it (by myself) and I want to update it :-(


Argh, as I said the error was sitting in front ot the screen :-(
I used a variable name with a non-capital "i", but it should have been a capital "I" there... Now it works.

Last edited by Baertram : 08/17/14 at 04:00 PM.
  Reply With Quote
08/17/14, 04:04 PM   #4
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
No, I'm trying to read them after a right-click with the mouse on it and choosing a new added menu item.
It works perfetcly for a single slot. But if I want to update all in a for... loop it's not working.

I need the control because another texture control is added to it (by myself) and I want to update it :-(
It might not be as short, but you could use the copy button on zgoo (when you /zgoo the ZO_Character window) and use the control names it gives you. Pick the ones you want, build a table & loop through it doing whatever you want to each control. Thats probably the easiest way & less things to cause problems.
Lua Code:
  1. local ZO_CharacterChildren = {
  2.     [1] =   "ZO_CharacterApparelSection",
  3.     [2] =   "ZO_CharacterPaperDoll",
  4.     [3] =   "ZO_CharacterAccessoriesSection",
  5.     [4] =   "ZO_CharacterWeaponsSection",
  6.     [5] =   "ZO_CharacterEquipmentSlotsHead",
  7.     [6] =   "ZO_CharacterEquipmentSlotsShoulder",
  8.     [7] =   "ZO_CharacterEquipmentSlotsGlove",
  9.     [8] =   "ZO_CharacterEquipmentSlotsLeg",
  10.     [9] =   "ZO_CharacterEquipmentSlotsChest",
  11.     [10] =   "ZO_CharacterEquipmentSlotsBelt",
  12.     [11] =   "ZO_CharacterEquipmentSlotsFoot",
  13.     [12] =   "ZO_CharacterEquipmentSlotsCostume",
  14.     [13] =   "ZO_CharacterEquipmentSlotsNeck",
  15.     [14] =   "ZO_CharacterEquipmentSlotsRing1",
  16.     [15] =   "ZO_CharacterEquipmentSlotsRing2",
  17.     [16] =   "ZO_CharacterEquipmentSlotsMainHand",
  18.     [17] =   "ZO_CharacterEquipmentSlotsOffHand".
  19.     [18] =   "ZO_CharacterEquipmentSlotsBackupMain",
  20.     [19] =   "ZO_CharacterEquipmentSlotsBackupOff",
  21.     [20] =   "ZO_CharacterWeaponSwap",
  22.     [21] =   "ZO_CharacterTitle",
  23. }

I copy & pasted your code, it works for me.

Last edited by circonian : 08/17/14 at 04:16 PM.
  Reply With Quote
08/17/14, 04:22 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Thx for your help.

It works now. It was my fault :-(
I had used a non-captial i inside one of my source code lines, but used a capital I later on to use the variable...
As I said before this must be some silly erro :-(

But I really appreciate all your help here in this forum! Many of your ideas and input is giving me some new ideas and inforamtion how and what can be done.
  Reply With Quote
08/17/14, 04:43 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
Thx for your help.

It works now. It was my fault :-(
I had used a non-captial i inside one of my source code lines, but used a capital I later on to use the variable...
As I said before this must be some silly erro :-(

But I really appreciate all your help here in this forum! Many of your ideas and input is giving me some new ideas and inforamtion how and what can be done.
Yeah and those i & I's always look the same when your trying to find a problem !
  Reply With Quote
08/17/14, 05:22 PM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
So next time don't say it shows 0, but nil just kidding
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » slotIndex of equipped armory always 0? (But ZGOO gives me other results)


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