Thread Tools Display Modes
12/10/14, 09:34 PM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Crafting Station Bug

Ug, I spent an hour trying to find a bug in an addon I'm working on & its not in my addon. Looks like a game bug, can anyone confirm?
  1. Go to a clothier crafting station
  2. Reload your UI to reset all of the games variables
  3. Open the crafting station
  4. Click on the creation tab (nothing else)
  5. Go to blacksmithing crafting station and open it.
  6. Click on the deconstruction tab (nothing else)
  7. Go back to the clothier crafting station & open it.
  8. Click on the Creation tab


It seems to happen no matter which stations you do it at as long as you only click those buttons in that order.
  Reply With Quote
12/10/14, 11:36 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
In my opinion this is a bug on ZOS side which was introduced in patch 1.5.6 because of changes in crafting UI.

Unfortunately this error occurs in local function, so it will be a bit difficult to fix by addon.

I'd probably try to redefine GetMaterialQuantity function, something like:
Lua Code:
  1. function ZO_SharedSmithingCreation:GetMaterialQuantity(patternIndex, materialIndex)
  2.     local quantity
  3.     if self.selectedMaterialCountCache[patternIndex] then
  4.         quantity = self.selectedMaterialCountCache[patternIndex][materialIndex]
  5.     end
  6.     if quantity == nil then
  7.         local _, _, stack = GetSmithingPatternMaterialItemInfo(patternIndex, materialIndex)
  8.         self:SetMaterialQuantity(patternIndex, materialIndex, stack)
  9.         quantity = stack
  10.     end
  11.     return quantity or 0
  12. end

Or if you want to redefine just instance of this class, you are looking for function:
Code:
SMITHING.creationPanel:GetMaterialQuantity(patternIndex, materialIndex)

Last edited by Garkin : 12/10/14 at 11:41 PM.
  Reply With Quote
12/11/14, 02:53 AM   #3
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
i cant reproduce it without any addons! you sure about it?

US client? i use liveeu

P.S. - the same with all my addons, i have 112
no errors so far

Last edited by QuadroTony : 12/11/14 at 02:59 AM.
  Reply With Quote
12/11/14, 06:07 AM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Hello,

Your order list isn't good

The bug is

- Go on a smithing station (wood/blacksmith/clothier)
- Open creation tab
- leave
- Go on another smithing station of same type
- Go on creation tab
- bug

It will be reproduced with any smithing station
and yes as garkin said, we can't do anything at all

let's zos fix their bugs ?
  Reply With Quote
12/11/14, 08:52 AM   #5
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
I'll take a look at it today to see if I can reproduce it.
  Reply With Quote
12/11/14, 09:12 AM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by ZOS_ChipHilseberg View Post
I'll take a look at it today to see if I can reproduce it.
Everywhere, where are you using method :GetMaterialQuantity is a check if return value exists. But in the SetupFunction in :InitializeMaterialList is this check missing. There should probably be something like this:

Lua Code:
  1. local function SetupFunction(control, data, selected, selectedDuringRebuild, enabled)
  2.  
  3.     --original code here
  4.  
  5.     local currentSelectedQuantity = self:GetMaterialQuantity(data.patternIndex, data.materialIndex)
  6.     --added check if return value exists:
  7.     if not currentSelectedQuantity then
  8.         self:SetMaterialQuantity(data.patternIndex, data.materialIndex, data.min)
  9.         currentSelectedQuantity = data.min
  10.     end
  11.  
  12.    --rest of the original code
  13.  
  14. end
  Reply With Quote
12/11/14, 02:02 PM   #7
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
We were able to reproduce it. A fix will likely be in the next patch.
  Reply With Quote
12/11/14, 02:18 PM   #8
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Ayantir View Post
Hello,

Your order list isn't good

The bug is

- Go on a smithing station (wood/blacksmith/clothier)
- Open creation tab
- leave
- Go on another smithing station of same type
- Go on creation tab
- bug

It will be reproduced with any smithing station
and yes as garkin said, we can't do anything at all

let's zos fix their bugs ?
Strange if the order I listed didn't work for you, it works for me every time. That was just the sequence of events that I managed to figure out would reproduce it every time. I don't doubt there is more than one way to reproduce it. I tried to find out where it was being caused in the code, but it 'might' be in something not available to use (or I may have missed it, I couldn't find it).
  Reply With Quote
12/11/14, 02:21 PM   #9
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by QuadroTony View Post
i cant reproduce it without any addons! you sure about it?

US client? i use liveeu

P.S. - the same with all my addons, i have 112
no errors so far
Strange, I removed all addons, reloadedUI, logged completely out & back in, restarted my computer (all in case something was somehow remaining between reloadUI's). It happens every time.
  Reply With Quote
12/11/14, 02:23 PM   #10
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
In my opinion this is a bug on ZOS side which was introduced in patch 1.5.6 because of changes in crafting UI.

Unfortunately this error occurs in local function, so it will be a bit difficult to fix by addon.

I'd probably try to redefine GetMaterialQuantity function, something like:
Lua Code:
  1. function ZO_SharedSmithingCreation:GetMaterialQuantity(patternIndex, materialIndex)
  2.     local quantity
  3.     if self.selectedMaterialCountCache[patternIndex] then
  4.         quantity = self.selectedMaterialCountCache[patternIndex][materialIndex]
  5.     end
  6.     if quantity == nil then
  7.         local _, _, stack = GetSmithingPatternMaterialItemInfo(patternIndex, materialIndex)
  8.         self:SetMaterialQuantity(patternIndex, materialIndex, stack)
  9.         quantity = stack
  10.     end
  11.     return quantity or 0
  12. end

Or if you want to redefine just instance of this class, you are looking for function:
Code:
SMITHING.creationPanel:GetMaterialQuantity(patternIndex, materialIndex)
Thanks for looking into it Garkin. Even though I removed all addons, logged out & back in, its nice to know its not just me.
  Reply With Quote
12/11/14, 02:29 PM   #11
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by ZOS_ChipHilseberg View Post
We were able to reproduce it. A fix will likely be in the next patch.
Thanks for looking into it Chip !
  Reply With Quote
01/13/15, 06:59 AM   #12
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Garkin View Post
Everywhere, where are you using method :GetMaterialQuantity is a check if return value exists. But in the SetupFunction in :InitializeMaterialList is this check missing. There should probably be something like this:

Lua Code:
  1. local function SetupFunction(control, data, selected, selectedDuringRebuild, enabled)
  2.  
  3.     --original code here
  4.  
  5.     local currentSelectedQuantity = self:GetMaterialQuantity(data.patternIndex, data.materialIndex)
  6.     --added check if return value exists:
  7.     if not currentSelectedQuantity then
  8.         self:SetMaterialQuantity(data.patternIndex, data.materialIndex, data.min)
  9.         currentSelectedQuantity = data.min
  10.     end
  11.  
  12.    --rest of the original code
  13.  
  14. end
This code was added to EsoUI source in patch 1.5.8. ;-)
  Reply With Quote
01/15/15, 07:20 AM   #13
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
You can call yourself official unoffical ZOS developer now ^^
  Reply With Quote
01/15/15, 08:58 AM   #14
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
With the amount of effort Garkin puts into add-ons and the add-on community he was already an unofficial ZOS developer =P.
  Reply With Quote
01/15/15, 01:48 PM   #15
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
True, skip the "now" from my last post then ;-)
  Reply With Quote
01/25/15, 11:28 AM   #16
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
By the way do you know what causes current crafting staions bug (material quantity resets to its default value)? It's a typo in this added code ("currentSelectedQuality" instead of "currentSelectedQuantity"):

Lua Code:
  1. local currentSelectedQuantity = self:GetMaterialQuantity(data.patternIndex, data.materialIndex)
  2.  
  3. if currentSelectedQuality == nil then --here
  4.     self:SetMaterialQuantity(data.patternIndex, data.materialIndex, data.min)
  5.     currentSelectedQuantity = data.min
  6. end

Easy solution for this issue is creating global variable currentSelectedQuality and update it every time when you call GetMaterialQuantity method:
Lua Code:
  1. local originalGetMaterialQuantity = ZO_SharedSmithingCreation.GetMaterialQuantity
  2. function ZO_SharedSmithingCreation:GetMaterialQuantity(...)
  3.     currentSelectedQuality = originalGetMaterialQuantity(self, ...)
  4.     return currentSelectedQuality
  5. end

Last edited by Garkin : 01/25/15 at 12:19 PM.
  Reply With Quote
01/26/15, 09:08 AM   #17
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
This typo will be fixed in the next patch.
  Reply With Quote
01/29/15, 10:40 AM   #18
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
btw Garkin mby you know it MultiCraft addon bug, or related not only to multicraft, but some errors in the game itself?

- this bug happends every time
- its because i hit Cancel while process previous crafting alchemy routine
- or because of MultiCraft addon
- look at the glowing around reagents, looks like it stuck from previous routine, when ingredients glowing one by one to make one potion
- reloadui helps

i can change the combinations, but i cannot craft it. also i cannot craft by hotkey too. And if i close the addon, original UI locked with gray colors
Happends after one craft route, im using MultiCraft addon





  Reply With Quote
01/31/15, 05:55 PM   #19
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
The gray color means that the item is locked by the game's UI. Probaly MultiCraft called the function to craft a potion and if you cancel it the items won't get unlocked again. It's the same as dragging an item from your iventory somwhere else but you would never drop it. The item will be grayed out as long as you drag it.
You need to relog (/reloadui alone won't help).

To test if it is MultiCraft:
Try to disable MultiCraft and do the same to craft your potions, and hit cancel then. Are the items still grayed out?
  Reply With Quote
01/31/15, 06:58 PM   #20
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
we figure out it already)) need some additional fixes to multicraft


The "craft completed" animation and sound is still running/playing while the next potion is crafted. If you interrupt it, the animation is stucked and the buttons are hidden.

The solution is to call this in the EVENT_CRAFTING_STATION_INTERACT.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Crafting Station Bug

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