Skip to content

Ext.Stats.GetStats() can't return SpellSet #563

@Fuyou1066

Description

@Fuyou1066

I have attempted solutions to common problems

Yes

I have checked that my game version is supported

Yes

OS

Windows 11

Platform

Steam

Description

I create a function

function ShortRestOverhaul_RegainHP()
    print("ShortRestOverhaul_RegainHP called")
    for _, name in pairs(Ext.Stats.GetStats("SpellSet")) do
        if name == "CommonPlayerActions" then
            local spellSet = Ext.Stats.Get(name)
            if spellSet then
                local spells = spellSet.Spells
                if not string.find(spells, "Shout_SRO_RegianHP", 1, true) then
                    if spells == "" then
                        spellSet.Spells = "Shout_SRO_RegianHP"
                    else
                        spellSet.Spells = spells .. ";Shout_SRO_RegianHP"
                    print("Added Shout_SRO_RegianHP to CommonPlayerActions")
                    end
                end
            end
        end
    end
end

Then when I load my save, I see the following text in console. And the function can't work as intended.

ShortRestOverhaul_RegainHP called
bg3se::lua::stats::FetchStatEntries(): Unknown stats entry type: SpellSet

Api.md says

Ext.Stats.GetStats(type: string): string[]
Returns a table with the names of all stat entries. When the optional parameter type is specified, it'll only return stats with the specified type. The following types are supported: StatusData, SpellData, PassiveData, Armor, Weapon, Character, Object, SpellSet, EquipmentSet, TreasureTable, TreasureCategory, ItemGroup, NameGroup

So I report this as a bug.

Indications

No response

Diagnostic Files

No response

Steps to Reproduce

No response

Expected Behavior

No response

Actual Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions