Is it possible to sort the spell list by damage type as well as name how would i go about editing the script file to achieve that. not asking you to do it just something i want to do for myself
Spells don't necessarily have just one damage type, and don't define a predominant damage type.
I'm not saying it's impossible to do something like it, but it'd be complicated and flawed. (Heh - good traits in a fictional character, bad in sorting criteria.)
Immersive Gear together with this mod is giving me a red text in the console. Odd because the aforementioned mod is supposed to be only an equipment mod so I'm unsure what's going on here. The console puts this out as the offender and I can consistently get it to spit this out by just having Immersive Gear and Spell List Sorter.
bg3se::lua::stats::LuaStatGetAttribute(): Stat object '(null)' has no attribute named 'Level' Error while dispatching event StatsLoaded: [string "SpellListSorter/SpellListSorter.lua"]:40: Property does not exist: stats::Object::Level - property does not exist stack traceback: [C++ Code]: in metamethod '__index' SpellListSorter/SpellListSorter.lua:40: in upvalue 'DWE_SortSpellList' SpellListSorter/SpellListSorter.lua:89: in function <SpellListSorter/SpellListSorter.lua:77> [C++ Code]: in function 'xpcall' builtin://Libs/Events/SubscribableEvent.lua:162: in method 'Throw' builtin://Libs/Events/EventManager.lua:24: in method 'ThrowEvent' builtin://Libs/Events/EventManager.lua:116: in function <builtin://Libs/Events/EventManager.lua:115> Any idea of why this is happening would be appreciated.
From taking a look now, that mod is very poorly made and contains multiple instances of just plain broken data.
There's no good reason it should interact with Spell List Sorter, and it doesn't happen for me... so presumably you have yet another poorly made mod adding broken data to spell lists.
This mod will not add or remove spells to/from spell lists, only sort the lists.
Spell List Combiner will add all the spells that either the base game or any installed mod has in a spell list to that list, even if it was deliberately omitted in a later mod.
(This is not a bug or "issue" with Spell List Combiner - it's what it's meant to do... but it's not a good thing to do. It's largely redundant, since most mods that want to add spells today do in better ways than just by containing modified spell lists. And it works against any mod that tries to remove a spell from any spell list.)
Right yeah I thought so ty for the clear explanation!
Is there any chance you'd make a version that sorts just the spell level and not alphabetically? Sometimes it's easier to see which mod has gone wrong if a spell is missing or not behaving as it should based on load order and spell list order, but also mods like Not Enough Elemental Spells sort of group theirs together and it actually looks somewhat more organised when they're left alone.
Unless you could just omit certain spells somehow? Chromatic spells by Shivero is a similar kinda thing. This may sound stupid but it also looks prettier left as a rainbow formation lol no worries if not I'm just being a pain in the butt :D
Seems a little tedious, not necessarily on your side but also having to unpack the original mods too and find multiple spell UUIDs. It's a shame most authors don't just add them to the description of their mods but I guess most have no reason to. If it ends up bothering me enough I'll keep it in mind but I think I've given myself enough work lately trying to debug a highly modded setup :')
can you elaborate "mods that want to add spells today do in better ways than just by containing modified spell lists" further? so spell list combiner is obsolete now or what?
@wesslen If one wanted to easily separate vanilla spells from moded spells, then without being able to disable sorting by alphabet they would need to blacklist ALL the moded spells, which is more or less the same as not using this mod at all. However if it was possible to disable just the alphabetical sorting then the within the level's segments vanilla content would end up at the begining of the segment and moded would be at the end of it. Which would help separate them while still keeping the spells on the list grouped into levels.
@YOhowho I was lead to believe that yes, it's mostly obsolete. No promises though, as I'm not an expert. It's definitely build around a problem that has later then been solved in a better way. But I suspect it's still needed for the mods that didn't implement the later solution.
Quick question: is there an error in the current Script Extender requirement? Or is it an error on my side, not updating the SE mod or displaying the wrong version?
Is there anything that could be added to the SpellListSorter.lua to account for spells that mods may not have a level to and just have a ""? Causes an error sometimes. Not sure on if it would crash though. The current lua seems to recognize spell list levels and a 0 below.
local displayName = spell.DisplayName local sortName = displayName and (Ext.Loca.GetTranslatedString(displayName) .. "~" .. spellName) or spellName local level = tonumber(spell.Level) or 0 local spellTemp = { spellName, sortName, level, n }
Not experienced enough to know what would be added aside from an or "" on the 3rd line.
hmm i'll have to troubleshoot some more then it just says the below:
bg3se::lua::stats::LuaStatGetAttribute(): Stat object 'Interrupt_HellishRebuke' has no attribute named 'Level' Error while dispatching event StatsLoaded: [string "SpellListSorter/SpellListSorter.lua"]:40: Property does not exist: stats::Object::Level - property does not exist stack traceback: [C++ Code]: in metamethod '__index' SpellListSorter/SpellListSorter.lua:40: in upvalue 'DWE_SortSpellList' SpellListSorter/SpellListSorter.lua:89: in function <SpellListSorter/SpellListSorter.lua:77> [C++ Code]: in function 'xpcall' builtin://Libs/Events/SubscribableEvent.lua:124: in method 'Throw' builtin://Libs/Events/EventManager.lua:17: in method 'ThrowEvent' builtin://Libs/Events/EventManager.lua:107: in function <builtin://Libs/Events/EventManager.lua:106>
not sure what hellish rebuke is doing and think its linked to rebalance or warcaster but the 2nd one popped up recently and seems to be an echo knight thing. can't find out the problem causer though.
Yeah, same kind of thing as before - Interrupt_HellishRebuke is not a spell and should not be added to spell lists (the actual spell is "Target_HellishRebuke"), but you apparently have some mod that adds it.
"Sorted 0" doesn't mean it didn't work, somewhat confusingly perhaps... The lists will be sorted multiple times, and only the first time is likely to make big changes to the order. Those log messages just mean that the lists were already in order.
Not all UI respects the sorted order - they will be in order when you select spells to learn at level up, but not when selecting spells to have memorized during gameplay.
The sorting happens at the underlying data level, not in the UI. Some UI (spell prepration) doesn’t use the sorted results, while some (level up spell selection) does. I haven’t tested with controller, but would guess it’s similar.
53 comments
I'm not saying it's impossible to do something like it, but it'd be complicated and flawed.
(Heh - good traits in a fictional character, bad in sorting criteria.)
bg3se::lua::stats::LuaStatGetAttribute(): Stat object '(null)' has no attribute named 'Level'
Error while dispatching event StatsLoaded: [string "SpellListSorter/SpellListSorter.lua"]:40: Property does not exist: stats::Object::Level - property does not exist
stack traceback:
[C++ Code]: in metamethod '__index'
SpellListSorter/SpellListSorter.lua:40: in upvalue 'DWE_SortSpellList'
SpellListSorter/SpellListSorter.lua:89: in function <SpellListSorter/SpellListSorter.lua:77>
[C++ Code]: in function 'xpcall'
builtin://Libs/Events/SubscribableEvent.lua:162: in method 'Throw'
builtin://Libs/Events/EventManager.lua:24: in method 'ThrowEvent'
builtin://Libs/Events/EventManager.lua:116: in function <builtin://Libs/Events/EventManager.lua:115>
Any idea of why this is happening would be appreciated.
There's no good reason it should interact with Spell List Sorter, and it doesn't happen for me... so presumably you have yet another poorly made mod adding broken data to spell lists.
I'd strongly recommend uninstalling that mod.
The phrasing of this is what throws me off. This mod will keep some spells de-listed whereas SLCR won't? Or vice versa?
Spell List Combiner will add all the spells that either the base game or any installed mod has in a spell list to that list, even if it was deliberately omitted in a later mod.
(This is not a bug or "issue" with Spell List Combiner - it's what it's meant to do... but it's not a good thing to do. It's largely redundant, since most mods that want to add spells today do in better ways than just by containing modified spell lists. And it works against any mod that tries to remove a spell from any spell list.)
Is there any chance you'd make a version that sorts just the spell level and not alphabetically? Sometimes it's easier to see which mod has gone wrong if a spell is missing or not behaving as it should based on load order and spell list order, but also mods like Not Enough Elemental Spells sort of group theirs together and it actually looks somewhat more organised when they're left alone.
Unless you could just omit certain spells somehow? Chromatic spells by Shivero is a similar kinda thing. This may sound stupid but it also looks prettier left as a rainbow formation lol no worries if not I'm just being a pain in the butt :D
If one wanted to easily separate vanilla spells from moded spells, then without being able to disable sorting by alphabet they would need to blacklist ALL the moded spells, which is more or less the same as not using this mod at all.
However if it was possible to disable just the alphabetical sorting then the within the level's segments vanilla content would end up at the begining of the segment and moded would be at the end of it. Which would help separate them while still keeping the spells on the list grouped into levels.
@YOhowho
I was lead to believe that yes, it's mostly obsolete. No promises though, as I'm not an expert.
It's definitely build around a problem that has later then been solved in a better way. But I suspect it's still needed for the mods that didn't implement the later solution.
Quick question: is there an error in the current Script Extender requirement? Or is it an error on my side, not updating the SE mod or displaying the wrong version?
EDIT: problem solved
local displayName = spell.DisplayName
local sortName = displayName and (Ext.Loca.GetTranslatedString(displayName) .. "~" .. spellName) or spellName
local level = tonumber(spell.Level) or 0
local spellTemp = { spellName, sortName, level, n }
Not experienced enough to know what would be added aside from an or "" on the 3rd line.
Sounds like you have something else going on. There was an earlier case where some mods added non-spells to spell lists, for example.
bg3se::lua::stats::LuaStatGetAttribute(): Stat object 'Interrupt_HellishRebuke' has no attribute named 'Level'
Error while dispatching event StatsLoaded: [string "SpellListSorter/SpellListSorter.lua"]:40: Property does not exist: stats::Object::Level - property does not exist
stack traceback:
[C++ Code]: in metamethod '__index'
SpellListSorter/SpellListSorter.lua:40: in upvalue 'DWE_SortSpellList'
SpellListSorter/SpellListSorter.lua:89: in function <SpellListSorter/SpellListSorter.lua:77>
[C++ Code]: in function 'xpcall'
builtin://Libs/Events/SubscribableEvent.lua:124: in method 'Throw'
builtin://Libs/Events/EventManager.lua:17: in method 'ThrowEvent'
builtin://Libs/Events/EventManager.lua:107: in function <builtin://Libs/Events/EventManager.lua:106>
not sure what hellish rebuke is doing and think its linked to rebalance or warcaster but the 2nd one popped up recently and seems to be an echo knight thing. can't find out the problem causer though.
The lists will be sorted multiple times, and only the first time is likely to make big changes to the order. Those log messages just mean that the lists were already in order.
Not all UI respects the sorted order - they will be in order when you select spells to learn at level up, but not when selecting spells to have memorized during gameplay.