Thread Tools Display Modes
03/03/16, 08:03 AM   #1
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
[outdated] ActionBar data for SlotSkillAbilityInSlot

Is it possible, to add data to the action bar slots which provides this three indexes for this function in addition to the SkillID.

SlotSkillAbilityInSlot(number SkillType skillType, number skillLineIndex, number abilityIndex, number slotIndex)

Last edited by @AlphaLemming : 03/03/16 at 03:29 PM.
 
03/03/16, 08:19 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
The slot control already has the necessary data. Otherwise I couldn't do this in one of my addons:
Lua Code:
  1. local abilityId = GetSkillAbilityId(control.skillType, control.lineIndex, control.index)
Control is the object passed to ZO_Skills_AbilitySlot_OnClick.
 
03/03/16, 08:33 AM   #3
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Thanks sirinsidiator, but i need not the ID ... i need the TypeIndex, LineIndex, SkillIndex from the action bar, not out of the skill window ... or miss i something, have found no data there.
 
03/03/16, 09:39 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
That's exactly what I am saying. The action bar buttons (not in the skill window) do have these 3 values stored on the button control.
 
03/03/16, 09:41 AM   #5
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Strange, ok and thanks, i will try this.
 
03/03/16, 03:25 PM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
After some testing together with AlphaLemming, we arrived at the conclusion that something really fishy is going on.
Lua Code:
  1. local abilityId = GetSkillAbilityId(1,1,1)
  2. local hasProgression, progressionIndex = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  3. if(hasProgression) then
  4. local skillType, skillIndex, abilityIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
  5. local abilityId2 = GetSkillAbilityId(skillType, skillIndex, abilityIndex)
  6. df("%d == %d => %s", abilityId, abilityId2, tostring(abilityId == abilityId2))
  7. end
This code prints to chat that abilityId is the same as abilityId2 on my client, but on AlphaLemmings client abilityId2 is 0 for any skill.
Maybe someone has an idea what is going on? Chip? Anyone?
 
03/03/16, 03:51 PM   #7
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
What the state of the skill for alphalemming ? It should have been unlocked and pexed at least one time in order to get some results.
 
03/03/16, 04:08 PM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
We tried it with different skills and also with skills in the action bar, which had to be unlocked in order to be placed:
Lua Code:
  1. local abilityId = ActionButton3Button.actionId
  2. local hasProgression, progressionIndex = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  3. if(hasProgression) then
  4. local skillType, skillIndex, abilityIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
  5. local abilityId2 = GetSkillAbilityId(skillType, skillIndex, abilityIndex)
  6. df("%d == %d => %s", abilityId, abilityId2, tostring(abilityId == abilityId2))
  7. end
 
03/03/16, 04:23 PM   #9
Wandamey
Guest
Posts: n/a
I tried the functions before the ability2 def and it seems that :
progressionIndex is the order you learn your skills, is it? seems like it. (hmm maybe not... just the unlocked ones in order)

but whatever I enter for GetSkillAbilityIndicesFromProgressionIndex(int) as an int, it returns 0,2,2
even if I feed it a string.

(English client, btw and that is on PTS right now)
GetAbilityProgressionInfo(int) this is fine, gives me the right name/morph/rank...



if it's really broken, only one way to rewrite it as the SKILLS_WINDOW table only fills with current selected skillLine or the last opened with the skill window it seems...

local SkillTable = {}
--(or global, well at least addon level)

On startup and on skill updates : (sorry for the indents but at least it's copypastable)
function addon:RegisterAbilityIdToIndexesTable()

SkillTable = {} -- not sure how ids work with upgrades and all, why not wipe each time

for skillType = 1, GetNumSkillTypes() do
for skillLineIndex = 1, GetNumSkillLines(skillType) do
for abilityIndex = 1, GetNumSkillAbilities(skillType, skillLineIndex) do
SkillTable[GetSkillAbilityId(skillType, skillLineIndex, abilityIndex)] = {skillType, skillLineIndex, abilityIndex}
end
end
end

end
and to get your indexes back :

function addon:GetMyIndexesBack(abilityID)
return SkillTable[abilityID][1], SkillTable[abilityID][2], SkillTable[abilityID][3]
end

Last edited by Wandamey : 03/03/16 at 06:57 PM.
 
03/03/16, 10:55 PM   #10
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I tested that once, I'm not sure but if I remember correctly I think that you have to gain skill in it during that game session/reload before that API will work.

I'm guessing that your doing this just to save/load skills into the skill bar. You don't need skillType, skillLineIndex, LineAbilityIndex. Just use the abilityId to get the real abilityIndex and use it to load the skill:
Lua Code:
  1. local abilityId = GetSlotBoundId(slotNum)
  2. -- save it, then to reload:
  3. local hasProgression, progressionIndex = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  4. --[[ These two steps ensure you load the correct ability because the
  5. abilityId, progressionIndex, and ..a lot of things change every time
  6. an ability ranks up or is morphed. This way even if the saved abilityId
  7. is an "old" lower rank, unmorphed, or different morph the correct ability
  8. will still be loaded.
  9. --]]
  10. local unMorphedName, morphChoice, rank = GetAbilityProgressionInfo(progressionIndex)
  11. local morphedName, texture, abilityIndex = GetAbilityProgressionAbilityInfo(progressionIndex, morphChoice, rank)
  12. -- and note the above abilityIndex is NOT the same abilityIndex as this:
  13. -- local skillType, skillIndex, abilityIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
  14.  
  15.  
  16. CallSecureProtected("SelectSlotAbility", abilityIndex, slotNum)
 
03/04/16, 03:07 AM   #11
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Lua Code:
  1. CallSecureProtected("SelectSlotAbility", abilityIndex, slotNum)

Can i use this without restrictions?? If this works, it would be fine! Never tried...
 
03/04/16, 08:11 AM   #12
Wandamey
Guest
Posts: n/a
out of combat restriction.

I've played around with these values of progressionIndex, the 3 Skill/Line/Index, and that AbilityIndex that can be used alone : only that last one won't make you errors with the different destructions schools. (doesn't make easy to find functions for it when it has the same name as the other one)


I think the Skill/Line/AbilityIndex are reserved to determine the place of the skill in the tree in the skill window the real skill data comes from ProgressionIndex and what circonian wrote.

Only the defaut skills are registered when browsing them like I did (i.e : my frost skills throw a nil error) so you should definitively use Circonian's method.
though if you allow different bars with different weapons, you may consider mixing both methods for the destruction staves.

I've dumped all my skills to see how it works... if hasprogression is false, progressionIndex is 2, the name of the skill is wrong (once it always displayed Mage's Fury, another reload it was lightening splash etc...) but here what can interest you :

Lua Code:
  1. [40964] = -- slotted in the bar as frost skill : id 40967, doesn't appear in the dump, but has  progressionIndex = 8 too. so you can relate both.
  2.                     {
  3.                         [1] = 2,
  4.                         [2] = 5,
  5.                         [3] = 1,
  6.                         ["unMorphedName"] = "Destructive Touch",
  7.                         ["morphChoice"] = 0,
  8.                         ["hasProgression"] = true,
  9.                         ["progressionIndex"] = 8,
  10.                         ["browsercount"] = 71,
  11.                         ["countHasProgressionTrue"] = 9,
  12.                     },

counts were there to try to figure out how the progressionIndex is set, but it seems to have no relation with the skill order.

So to sum up: Circonian's method will work always with no error (as the realAbilityIndex comes from the progressionIndex and they are shared between different forms of the skill, it's the default form that should be stored)

Only problem : if you want to show the right icon in your interface when selected with a different magic school in the set. checking for functions.



OK heads up : This :

GetAbilityIdByIndex(realAbilityIndex)

returns the right skill id (ice / lightening etc) for the currently equipped weapon.

Last edited by Wandamey : 03/04/16 at 10:04 AM.
 
03/05/16, 07:56 AM   #13
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Thanks all for the helpful hints, i have found my way to do it.
 
03/07/16, 03:15 AM   #14
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by @AlphaLemming View Post
Lua Code:
  1. CallSecureProtected("SelectSlotAbility", abilityIndex, slotNum)

Can i use this without restrictions?? If this works, it would be fine! Never tried...
Yes, that is how I do it in SetSwap. If you need code to look at all of the gear & skill swapping code is in the LibSwap library I wrote in my SetSwap addon: SetSwap
 
03/07/16, 03:28 AM   #15
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Wandamey View Post
Only problem : if you want to show the right icon in your interface when selected with a different magic school in the set. checking for functions.

OK heads up : This :
GetAbilityIdByIndex(realAbilityIndex)
returns the right skill id (ice / lightening etc) for the currently equipped weapon.
just fyi
The code I posted above returns the correct icon for whatever rank/morph you currently have (I called it texture):
Lua Code:
  1. local morphedName, texture, abilityIndex = GetAbilityProgressionAbilityInfo(progressionIndex, morphChoice, rank)

Also just for anyone interested the AbilityId, abilityIndex, progressionIndex, and a lot of other things change everytime a skill is ranked or morphed so you have to be careful what you save and how you use it.


Originally Posted by Wandamey View Post
I think the Skill/Line/AbilityIndex are reserved to determine the place of the skill in the tree in the skill window the real skill data comes from ProgressionIndex and what circonian wrote.
Yes "that" abilityIndex is just a reference to the index in the tree. Its confusing that they named two different things abilityIndex in their code.

Originally Posted by Wandamey View Post
Only the defaut skills are registered when browsing them like I did (i.e : my frost skills throw a nil error) so you should definitively use Circonian's method. though if you allow different bars with different weapons, you may consider mixing both methods for the destruction staves.
The method I posted works for the destruction stave skills and other skills that have similar quarks. If you save/load both bars just use:
Lua Code:
  1. GetActiveWeaponPairInfo()
to determine which pair/bar to load/save.
 

ESOUI » Developer Discussions » Wish List » [outdated] ActionBar data for SlotSkillAbilityInSlot

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