Issues with GearScore+ in WoW SoD

Hi everyone,

I have an issue with the Addon GearScore+ which i am using in WoW SoD. After I tried out ElvUI and switching back to the „normal“ UI (meaning deactivating ElvUI), I have some trouble with said addon. Everytime I mouse over a bag I get this error message:

Message: Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua:144: attempt to index field ‚?‘ (a nil value)
Time: Fri Feb 16 10:07:43 2024
Count: 1
Stack: Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua:144: attempt to index field ‚?‘ (a nil value)
[string „@Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua“]:144: in function <Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua:139>
[string „@Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua“]:280: in function <Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua:277>
[string „=[C]“]: ?
[string „=[C]“]: ?
[string „=[C]“]: ?
[string „=[C]“]: ?
[string „=[C]“]: in function SetInventoryItem' [string "@Interface/FrameXML/MainMenuBarBagButtons.lua"]:130: in function BagSlotButton_OnEnter’
[string „*MainMenuBarBagButtons.xml:86_OnEnter“]:1: in function <[string „*MainMenuBarBagButtons.xml:86_OnEnter“]:1>

Locals: itemLink = „[Large Blue Sack]“
_ = „Large Blue Sack“
_ = „[Large Blue Sack]“
itemRarity = 1
itemLevel = 25
_ = 0
_ = „Container“
_ = „Bag“
_ = 1
itemEquipLoc = „INVTYPE_BAG“
(*temporary) = nil
(*temporary) = „INVTYPE_BAG“
(*temporary) = 133641
(*temporary) = 2500
(*temporary) = 1
(*temporary) = 0
(*temporary) = 0
(*temporary) = „attempt to index field ‚?‘ (a nil value)“
itemTypeInfo =

{
INVTYPE_RANGEDRIGHT =
{
}
INVTYPE_SHIELD =
{
}
INVTYPE_WEAPONOFFHAND =
{
}
INVTYPE_RANGED =
{
}
INVTYPE_WEAPON =
{
}
INVTYPE_2HWEAPON =
{
}
INVTYPE_WRIST =
{
}
INVTYPE_TRINKET =
{
}
INVTYPE_NECK =
{
}
INVTYPE_CLOAK =
{
}
INVTYPE_BODY =
{
}
INVTYPE_THROWN =
{
}
INVTYPE_HOLDABLE =
{
}
INVTYPE_TABARD =
{
}
INVTYPE_LEGS =
{
}
INVTYPE_ROBE =
{
}
INVTYPE_FEET =
{
}
INVTYPE_FINGER =
{
}
INVTYPE_WAIST =
{
}
INVTYPE_HAND =
{
}
INVTYPE_RELIC =
{
}
INVTYPE_CHEST =
{
}
INVTYPE_SHOULDER =
{
}
INVTYPE_HEAD =
{
}
INVTYPE_WEAPONMAINHAND =
{
}
}
rarityModifiers =
{
0 = 3.500000
2 = 2.500000
3 = 1.760000
1 = 3
4 = 1.600000
5 = 1.400000
}
GetEnchantIDFromItemLink = defined @Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua:133
GS_ENCHANT_MODIFIER = 1.050000
GLOBAL_SCALE = 1.700000


I tried to find the cause of that but was lost in the different XMLs and LUAs.
I also reinstalled the game twice as well as deleting the addon. As I recognized that the players info is stored in the cloud, reinstalling the game does not help as it gets downloaded again and again.

Does anybody know how to fix this? Thanks.

Du befindest dich hier im deutschen Forum, also darfst du gerne auch auf Deutsch schreiben. Alternativ kannst du natürlich jederzeit das passende Forum verwenden…

A similar error is already reported @ https://github.com/gk646/GearScoreClassic/issues/4

1. Open

Interface/AddOns/GearScoreClassic+/GearScoreCalc.lua

and go to line 49 which says

    ["INVTYPE_TABARD"] = { 0, false },

2. Add a new line below that and paste/insert the following line
    ["INVTYPE_BAG"] = { 0, false },
    ["INVTYPE_AMMO"] = { 0, false },


The updated itemTypeInfo should look like this

local itemTypeInfo = {
    ["INVTYPE_RELIC"] = { 0.3164, false },
    ["INVTYPE_TRINKET"] = { 0.5625, false },
    ["INVTYPE_2HWEAPON"] = { 2.000, true },
    ["INVTYPE_WEAPONMAINHAND"] = { 1.0000, true },
    ["INVTYPE_WEAPONOFFHAND"] = { 1.0000, true },
    ["INVTYPE_RANGED"] = { 0.3164, true },
    ["INVTYPE_THROWN"] = { 0.3164, false },
    ["INVTYPE_RANGEDRIGHT"] = { 0.3164, false },
    ["INVTYPE_SHIELD"] = { 1.0000, true },
    ["INVTYPE_WEAPON"] = { 1.0000, true },
    ["INVTYPE_HOLDABLE"] = { 1.0000, false },
    ["INVTYPE_HEAD"] = { 1.0000, true },
    ["INVTYPE_NECK"] = { 0.5625, false },
    ["INVTYPE_SHOULDER"] = { 0.7500, true },
    ["INVTYPE_CHEST"] = { 1.0000, true },
    ["INVTYPE_ROBE"] = { 1.0000, true },
    ["INVTYPE_WAIST"] = { 0.7500, false },
    ["INVTYPE_LEGS"] = { 1.0000, true },
    ["INVTYPE_FEET"] = { 0.75, true },
    ["INVTYPE_WRIST"] = { 0.5625, true },
    ["INVTYPE_HAND"] = { 0.7500, true },
    ["INVTYPE_FINGER"] = { 0.5625, false },
    ["INVTYPE_CLOAK"] = { 0.5625, true },
    ["INVTYPE_BODY"] = { 0, false },
    ["INVTYPE_TABARD"] = { 0, false },
    ["INVTYPE_BAG"] = { 0, false },
    ["INVTYPE_AMMO"] = { 0, false },
}



A better solution would be to not processing said item types at all but that’s up to the author.

e.g. via

local function CalculateItemScore(itemLink)
    if not itemLink then
        return 0, 0
    end
    local _, _, itemRarity, itemLevel, _, _, _, _, itemEquipLoc = GetItemInfo(itemLink)
    if not itemTypeInfo[itemEquipLoc] then
        return 0, 0
    end
    local slotModifier = itemTypeInfo[itemEquipLoc][1] or 1
    local rarityModifier = rarityModifiers[itemRarity] or 1

    local enchantID = GetEnchantIDFromItemLink(itemLink)
    -- Check for enchantment
    local enchantModifier = enchantID and enchantID > 0 and GS_ENCHANT_MODIFIER or 1

    -- Double item level for two-handed weapons
    local adjustedItemLevel = itemLevel
    if itemEquipLoc == "INVTYPE_2HWEAPON" then
        adjustedItemLevel = itemLevel * 2
    end

    -- Calculate score for this item
    return (itemLevel / rarityModifier) * slotModifier * enchantModifier * GLOBAL_SCALE, adjustedItemLevel
end

Entschuldigung für die Zeit die dir mein Fehler dir gekostet hat ;(.
Danke für die netten und ausführlichen Antworten die das Problem gut erklären. Dachte nicht das hier über Addons diskutiert wird.
War nur ein kleiner Fehler den ich im nächsten Update gefixt habe.

Wenn du deinen Fehler nächstes Mal im offiziellen Issue Tracker postest (https://github.com/gk646/GearScoreClassic/issues) sehe ich ihne schneller und kann darauf antworten.

Beiträge und Wünsche sind auch gerne erwünscht!

english
Sorry for the time my mistake cost you ;(.

Thanks for the nice and detailed answers that explain the problem well. Didn’t think that addons would be discussed here.

It was just a small bug that I fixed in the next update.

If you post your bug next time in the official issue tracker (https://github.com/gk646/GearScoreClassic/issues) I will see it faster and can answer it.

Contributions and wishes are also welcome!

1 Like

Dieses Thema wurde automatisch 180 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Nachrichten mehr erlaubt.