abilityIndex parameter of GetAbilityIdByIndex()
For the add-on I'm currently developing, I'm using EVENT_EFFECT_CHANGED and I want to compare the 15th parameter (abilityId) to see if that ability is slotted on the users bar (represented by a 2d table). It seems like GetAbilityIdByIndex() is a function I could use to populate the id for each slot on the bar. However, I don't know what the abilityIndex parameter is, or if I can even specify which bar to check (as opposed to function GetSlotBoundId(number actionSlotIndex, number:nilable HotBarCategory hotbarCategory) where you can specify slot and bar)
|
Best advice: If you are unsure "how to" do something check how ZOs is doing it in their code.
Most of the code is located in the "ingame" folder and then in a subfolder having the name of the control or stuff you are currently working on like "actionbar": https://github.com/esoui/esoui/tree/...game/actionbar I cannot find the function GetAbilityIdByIndex anywhere used there so most probably it's not the one you should or could use. And if so jist try it ingame. An index will normally start with 1 in lua (could be 0 as well). So try a script like Lua Code:
These constants values could help as well: https://wiki.esoui.com/Constant_Values Code:
ACTION_BAR_FIRST_NORMAL_SLOT_INDEX = 2 Lua Code:
|
Ok, thanks for those resources. Good to know they exist
|
Last time I checked on it, the index was an integer from 1 to the number of skills in the line to get the skill from the line table. Unfortunately, the line table has the skills indexed in order of names alphabetically sorted, so the index of the skill may be different depending on the language you are running the client in.
|
Ah, thanks for the clarification. So this function is not related to the actionBar but the skills window and skill lines.
|
From the code at ZOs actionbuttons you can use this small function to check a slotNum (index of the slot, see my first post with the slot indices) if it contains an abilityId:
Lua Code:
And if this returns true the slot's actionButton should provide an abilityId in it's variable .button.actionId. See here: https://github.com/esoui/esoui/blob/...utton.lua#L274 And this was determined via this function: Lua Code:
So you should be able to get the abilityId this way. I hope it IS the abilityId :) |
All times are GMT -6. The time now is 11:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI