Thread Tools Display Modes
11/29/15, 11:19 PM   #1
@tinydog
 
@tinydog's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2015
Posts: 9
Question Determine character's crafting improvement skill

Greetings. I need a reliable and language/localization-independent way to determine the character's item improvement ability rank (Temper Expertise, etc.). I'm currently using GetSkillAbilityUpgradeInfo(skillType, skillIndex, abilityIndex). For my crafting add-on, the skillType is always the global constant SKILL_TYPE_TRADESKILL. The skillIndex refers to the order in which the different trade skills (Alchemy, Blacksmithing...) appear in the Skills dialog. Similarly, the abilityIndex refers to the order in which the selected trade skill's passive abilities (such as Temper Expertise) appear in the Skills dialog.

Refer to the following screenshot: http://imgur.com/Zpg38VZ

The problem is that not all editions of the game display the trade skills in the same order.
For EN/US players, the crafting skills appear in the following order:
  1. Alchemy
  2. Blacksmithing
  3. Clothing
  4. Enchanting
  5. Provisioning
  6. Woodworking
For German players, the crafting skills appear in a slightly different order:
  1. Alchemy
  2. Blacksmithing
  3. Clothing
  4. Woodworking
  5. Provisioning
  6. Enchanting

Woodworking and Enchanting are swapped. Unfortunately this difference isn't just aesthetic - it prevents the GetSkillAbilityUpgradeInfo function from working properly for German (and possibly other) users.

I've looked into various possible solutions, including:
  • My first thought is that there must be a global constant or function that indicates which crafting skill occupies which skill tree index, just as there are globals that represent the crafting skills themselves (e.g., CRAFTING_TYPE_BLACKSMITHING). However, I was unable to find any such global or function.

  • The equipment crafting skills (Blacksmithing, Clothing, Woodworking) all have 6 passive abilities, but Enchanting only has 5. I could assume that if skill index 6 only contains 5 passives, that it is Enchanting - and that Woodworking is at index 4. This seems kludgey to me though. I'd prefer a solution that uses the game's built-in constants and functions.

  • There are global constants called NON_COMBAT_BONUS_BLACKSMITHING_BOOSTER_BONUS (and equivalent for CLOTHIER and WOODWORKING). However, it's just a LUA table index number constant, not an actual ability rank number. The only known use of these constants is in smithing_common.lua, where they are used to define entries in the global-scoped SMITHING_BONUSES table. All of these table entries get set to true. You can see this value by executing this command in-game:
    /script d(SMITHING_BONUSES[NON_COMBAT_BONUS_BLACKSMITHING_BOOSTER_BONUS])

  • There's also a function ZO_SharedSmithingImprovement_GetBoosterChartStringForCraftingType(craftingType), but all it does is return a number such as 3555 that gets applied to a "BoosterContainerHeader" something-or-other control.

  • There are other functions that pertain to crafting skills, but they are dependent upon the player actually selecting a skill in the Skills dialog. My add-on can be run any time, anywhere, and doesn't rely upon other dialogs being active.
Any ideas?
  Reply With Quote
11/30/15, 12:23 AM   #2
Wandamey
Guest
Posts: n/a
skillType,skillIndex = GetCraftingSkillLineIndices(CRAFTING_TYPE_PROVISIONING) etc...
currentlvl, maxlevel = GetSkillAbilityUpgradeInfo(skillType,skillIndex ,abilityIndex)

should do it if the abilityIndex keeps the order.
  Reply With Quote
11/30/15, 03:31 AM   #3
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
How about:

* GetNonCombatBonus(*[NonCombatBonusType|#NonCombatBonusType]* _nonCombatBonus_)
** _Returns:_ *integer* _bonusValue_

* EVENT_NON_COMBAT_BONUS_CHANGED (*integer* _nonCombatBonus_, *integer* _oldValue_, *integer* _newValue_)
  Reply With Quote
11/30/15, 06:49 AM   #4
@tinydog
 
@tinydog's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2015
Posts: 9
Thumbs up

Originally Posted by Wandamey View Post
skillType,skillIndex = GetCraftingSkillLineIndices(CRAFTING_TYPE_PROVISIONING) etc...
Aha, perfect! Thank you! Not sure why I didn't see that before.

Thank you both for your help!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Determine character's crafting improvement skill


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