Closed Mythalar closed 8 months ago
For the strings, you'll want to wrap the string in curly braces, like so:
local S1passives = {
pasive = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Type = "PassivesAdded",
Strings = {
"DualCasting",
"SculptSpells",
"WrathOfTheStorm",
}
}
}
I messed up in the documentation, it's fixed there now :) Looking into the Selector issue further - can you widen your console window before hitting new game? It may show a bit more information. I think I've fixed it in 2.4.2, but will be good to make sure.
So same syntax than spell lists, makes sense ^^ I change it to this (just changing payload) :
local S1passives = {
SorcererP1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Type = "PassivesAdded",
Strings = {
"DualCasting",
"SculptSpells",
"WrathOfTheStorm",
}
},
}
But with the same kind of error I think ?
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/Utils/StringUt..."]:2: bad argu)stack traceback:
[C++ Code]: in function 'string.find'
SubclassCompatibilityFramework/Utils/StringUtils.lua:2: in field 'IsInString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:9: in upvalue 'stripDupli'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:24: in upvalue 'AddString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:34: in global 'HandleProg'
SubclassCompatibilityFramework/API/StringApi.lua:8: in field 'InsertStrings'
SubclassCompatibilityFramework/API/StringApi.lua:36: in field 'InsertPassives'
BG3H/BootstrapServer.lua:77: in function <BG3H/BootstrapServer.lua:75>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
Will make a try by swapping functions to see if selectors are fixed with new version!
Well an error again, I guess I messed somewhere -_-
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/CompatibilityS..."]:103: Cannottstack traceback:
[C++ Code]: in metamethod '__index'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:103: in upvalue 'IsPa'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:120: in upvalue 'AddS'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:128: in global 'Handl'
SubclassCompatibilityFramework/API/SelectorApi.lua:7: in field 'InsertSelectors'
BG3H/BootstrapServer.lua:77: in function <BG3H/BootstrapServer.lua:75>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
Usually I learn directly by looking into some mods that do the same thing but I don't know some that would?
Since I'm on it, how would you insert this in progression with CLCF ?
<attribute id="AllowImprovement" type="bool" value="true"/>
Or something similar? Just a seletor with the entire feat list?
Feats are not done through selectors. I am on my phone, so give me a moment to get the correct syntax.
Feats are not done through selectors. I am on my phone, so give me a moment to get the correct syntax.
Really no rush, I'm just cleaning my personal mod using CLCF instead of barging through all class progressions and spell lists, nothing vital ^^
PS : I uploaded my Bootstrap if simpler to read
For the record, here is the entire error for InsertPassives (I guess I made some syntax mistake?) LUA config file
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/Utils/StringUt..."]:2: bad argument #2 to 'find' (string expected, got no value)
stack traceback:
[C++ Code]: in function 'string.find'
SubclassCompatibilityFramework/Utils/StringUtils.lua:2: in field 'IsInString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:9: in upvalue 'stripDuplicates'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:24: in upvalue 'AddString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:34: in global 'HandleProgressionString'
SubclassCompatibilityFramework/API/StringApi.lua:8: in field 'InsertStrings'
SubclassCompatibilityFramework/API/StringApi.lua:36: in field 'InsertPassives'
BG3H/BG3H_CLCF.lua:256: in function <BG3H/BG3H_CLCF.lua:254>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
And for Selectors :
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/CompatibilityS..."]:103: Cannot get property: resource::Progression::Spell.UUID - property does not exist
stack traceback:
[C++ Code]: in metamethod '__index'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:103: in upvalue 'IsPayloadInSelector'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:120: in upvalue 'AddSelector'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:128: in global 'HandleSelector'
SubclassCompatibilityFramework/API/SelectorApi.lua:7: in field 'InsertSelectors'
BG3H/BG3H_CLCF.lua:256: in function <BG3H/BG3H_CLCF.lua:254>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
I can't help to think the new mod update can be related to my questions and/but I'm so glad it's a thing ! This will consume all my free time...but you are the bests :)
A last question then, before you close this post, the new json file has to be beside the Bootstrap files?
The Boolean part was, specifically - I probably should have added that a while ago, but knowing it's something that's needed raised the priority on it π
Still looking into the String and Selector issues, though, fwiw. Hopefully it was just syntax, but I want to make sure I didn't break anything at some point. One thing, if you're using the API, any field that is blank, you'll want to leave out - the Framework should set up defaults, so for example this:
local DruidspelltoSorcerer = {
DS1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Function = "SelectSpells",
Overwrite = "0",
Params = {
Guid = DruidSL1,
Amount = "5",
Prepared = "0",
SelectorId = "",
CastingAbility = "",
ActionResource = "",
PrepareType = "",
CooldownType = ""
}
},
Can be reduced to this:
local DruidspelltoSorcerer = {
DS1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Function = "SelectSpells",
Overwrite = "0",
Params = {
Guid = DruidSL1,
Amount = "5",
Prepared = "0"
}
},
If the selector piece here still gives trouble, does it work if you change Guid
to UUID
? I thought I set up handling to support both but that may have slipped my mind
The new json file would be in the folder above the Bootstrap files, so structure would look something like this:
Mods/ModName/ScriptExtender/
CompatibilityFrameworkConfig.json
Lua/
BootstrapServer.lua
BootstrapClient.lua
Ah, and for the Strings one, I just noticed - for HBPassives
, using the API you'll want to make sure you add a FileType
field that's either "Feat" or "Progression"
Will check and try this tomorrow, before testing with JSON file.
Have to be quick this morning but I tried to trim code to the bare minimum to avoid syntax errors :
local CLCF ="67fbbd53-7c7d-4cfa-9409-6d737b4d92a9"
local BG3H = "143ed971-72c8-4d11-a749-2d01a9badaff"
-- Sorcerer
local S1 = "42af9bda-9ac0-4564-920b-f9ca1588d6ee"
-- Druid
local DruidSL1 = "2cd54137-2fe5-4100-aad3-df64735a8145"
if Ext.Mod.IsModLoaded(CLCF) then
local DruidspelltoSorcerer = {
DS1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Function = "SelectSpells",
Overwrite = "0",
Params = {
UUID = DruidSL1,
Amount = "5",
Prepared = "0",
}
},
};
local function OnSessionLoaded()
Mods.SubclassCompatibilityFramework.API.InsertSelectors(DruidspelltoSorcerer)
end
Ext.Events.SessionLoaded:Subscribe(OnSessionLoaded)
end
But yet again the same error :
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/CompatibilityS..."]:103: Cannot get property: resource::Progression::Spell.UUID - property does not exist
stack traceback:
[C++ Code]: in metamethod '__index'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:103: in upvalue 'IsPayloadInSelector'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:120: in upvalue 'AddSelector'
SubclassCompatibilityFramework/CompatibilitySupport/SelectorSupport/_SelectorAddition.lua:128: in global 'HandleSelector'
SubclassCompatibilityFramework/API/SelectorApi.lua:7: in field 'InsertSelectors'
BG3H/BG3H_CLCF.lua:27: in function <BG3H/BG3H_CLCF.lua:26>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
I'll drop the full log file (I'll try without the mod that spam it :p ) Extender Runtime 2023-10-24 07-14-02.log
I'm cursed :p
With a brand new CombatibilityFrameworkConfig.json I have this error :
[string "SubclassCompatibilityFramework/JsonLayer/_Jso..."]:30: Unable to parse JSON: * Line 12, Column 22
Missing '}' or object member name
stack traceback:
[C++ Code]: in field 'Parse'
SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:30: in function <SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:28>
[C++ Code]: in function 'xpcall'
SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:43: in global 'LoadConfigFiles'
SubclassCompatibilityFramework/Init/_InitDefaults
[Extender Runtime 2023-10-24 16-17-38.log](https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/files/13121017/Extender.Runtime.2023-10-24.16-17-38.log)
.lua:2: in function <SubclassCompatibilityFramework/Init/_InitDefaults.lua:1>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
Edit : To be sure I also tried to add just the passives with the API (without lists and so on), same way as the selectors this morning, and I cannot make it to work either... (with just the lists it works without issue though)
Json looks like it's throwing a syntax error, missed curly brace. Can you post the Json you attempted with? I might be able to help with that piece π EDIT: The docs had a missed closing bracket before the last curly brace - I just fixed that, wonder if that was causing the syntax error
In the meantime, I'm investigating the Selector API. What was the error you were getting with the Passives this morning?
The passive error was this :
Error while dispatching event SessionLoaded: [string "SubclassCompatibilityFramework/Utils/StringUt..."]:2: bad argument #2 to 'find' (string expected, got no value)
stack traceback:
[Comp
[CompatibilityFrameworkConfig.json](https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/files/13126012/CompatibilityFrameworkConfig.json)
atibilityFrameworkConfig.json](https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/files/13125997/CompatibilityFrameworkConfig.json)
[C++ Code]: in function 'string.find'
[CompatibilityFrameworkConfig.json](https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/files/13125911/CompatibilityFrameworkConfig.json)
SubclassCompatibilityFramework/Utils/StringUtils.lua:2: in field 'IsInString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:9: in upvalue 'stripDuplicates'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:24: in upvalue 'AddString'
SubclassCompatibilityFramework/CompatibilitySupport/StringSupport/_StringAddition.lua:34: in global 'HandleProgressionString'
SubclassCompatibilityFramework/API/StringApi.lua:8: in field 'InsertStrings'
SubclassCompatibilityFramework/API/StringApi.lua:36: in field 'InsertPassives'
BG3H/BG3H_CLCF.lua:25: in function <BG3H/BG3H_CLCF.lua:24>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
The LUA was just this :
local CLCF ="67fbbd53-7c7d-4cfa-9409-6d737b4d92a9"
local BG3H = "143ed971-72c8-4d11-a749-2d01a9badaff"
-- Sorcerer
local S1 = "42af9bda-9ac0-4564-920b-f9ca1588d6ee"
if Ext.Mod.IsModLoaded(CLCF) then
local HBPassives = {
SorcererP1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Type = "PassivesAdded",
Strings = {
"RDM_Dual_Casting_Passive",
"SculptSpells",
"WrathOfTheStorm",
}
},
};
local function OnSessionLoaded()
Mods.SubclassCompatibilityFramework.Api.InsertPassives(HBPassives)
end
Ext.Events.SessionLoaded:Subscribe(OnSessionLoaded)
end
Will check the braces, was quite sur I check them but well^^
Edit : posted the json, I don't see any missing brace and checks them again with BracketsCheck on notepad ++
I should have a fix up shortly
2.4.6 Should fix the issues you're running into π
Well, you will hate me...but I cannot seem to use the last version since it's automatically inactive in BG3 mod manager at each launch, never had this with any mod -_-
Might need to export/save the load order again, or fully uninstall the mod then reinstall - sometimes that's the only way I can get some mods to work after an update
Fully uninstalled, reloaded, reloaded the mod list, even loaded just this mod but each time it goes back to inactive.
It does not even appear in the SE console on launch So I guess it's time for a little break ^^.
I just checked : the meta file of the new version does not have UUID string anymore, so I guess that's why it is ignored
Good catch! Updated to 2.4.8. Not sure how I missed that
Ok so finally :
There is also this (don't know if it' anything meaningful):
bg3se::ExtensionStateBase::LuaLoadGameFile(): Script file could not be opened: Mods/SubclassCompatibilityFramework/ScriptExtender/Lua/API/RaceApi.lua
And then time to sleep x)
In the console, if you hit enter and then type _D(Ext.StaticData.Get("42af9bda-9ac0-4564-920b-f9ca1588d6ee", "Progression")), do the passive entries display in the
PassivesAdded` field of the object it shows?
They are but with a ; at the end :
"PassivesAdded" : "UnlockedSpellSlotLevel1;RDM_Dual_Casting_Passive;SculptSpells;WrathOfTheStorm;",
Perhaps that's the problem? I thought it could be because I let a comma at the end of the third passive here :
local HBPassives = {
SorcererP1 = {
modGuid = BG3H,
Target = S1,
FileType = "Progression",
Type = "PassivesAdded",
Strings = {
"RDM_Dual_Casting_Passive",
"SculptSpells",
"WrathOfTheStorm,"
}
},
};
But removing it does not change anything.
Semicolons are meant to be there - that's how Passives are separated in the PassivesAdded/PassivesRemoved section. That they're being shown is a good sign, that means they've been inserted correctly. Not sure exactly why they wouldn't be showing up though, SculptSpells and WrathOfTheStorm are vanilla passives, right? What happens if you only send through those two?
I tried and nothing change with only the vanilla passives. Does the same thing with config json or API (it shows in SE console but not ingame)
I pointed only the last semicolon of the line since it can mess the progression file IIRC.
Regarding the other functions :
1) Just saw that when I use selectors and SelectSpell (did not try others) there is a weird behaviour
Could not test this with the config json since I cannot make selectors works, I tried
"Selectors": [
{
"Action": "Insert",
"Function": "SelectSpells",
"Overwrite": false,
"UUID": "2cd54137-2fe5-4100-aad3-df64735a8145",
"Params": {
"Amount" : "5",
"Prepared" : "0"
}
}
],
I change the parameters syntax to be the same and not the Amount = "5" form LUA is it right?
Show no error in console but nothing in game except the previously reported one
bg3se::ExtensionStateBase::LuaLoadGameFile(): Script file could not be opened: Mods/SubclassCompatibilityFramework/ScriptExtender/Lua/API/RaceApi.lua
2) The config json Lists do work, very minor issue : the wiki page and example file shows "Type": "Spells, Skills, or Passives", but it's actually SpellList, SkillList, or PassiveList (at least it did not work with "Spells" but does work with "SpellList" for me)
2.4.10 should resolve the issues with Selectors and Strings π€ There was an issue with my table-merging logic, which has been resolved. For Strings to work, you'll also have to switch SessionLoaded out for StatsLoaded - I'll be updating documentation momentarily.
For Selectors, going forward this will be the correct syntax (your example specifically):
"Selectors": [
{
"Action": "Insert",
"Function": "SelectSpells",
"Params": {
"Guid": "2cd54137-2fe5-4100-aad3-df64735a8145",
"Amount": "5",
"Prepared": "0"
}
}
],
It works !!!
Just some random issues with spell lists in game but that's probably more of a problemen with Spell List Combiner (I guess 5e Spells self insertion + your API + Spell List Combiner is a bit much x) )
Last question, a "how to" and not a bug for once :
Regarding selectors if I want to, say, choose 4 spells instead of 2 in the same list I can set "Overwrite": true,
?
But what if the were multiple selectors in this progression Guid, will it overwrite all of them so I have to had them back (without overwrite?) ?
Edit : I lied, here is another one : does the insert Lists function support Guid array or have I to insert lists to each Guid separatly? (using config json)
Overwrite
isn't implemented yet, so at the moment it won't do anything, but the plan is for it to remove all existing Selectors, and then add its own. At the moment there's nothing for modifying the individual amounts for existing Selectors - an eventual removal feature (or just using overwrite) is planned to handle that use case, though
For lists, the UUID field isn't currently set up to handle arrays, but that's on the roadmap, and will likely be in one of the next versions π
Thanks for the clarification, that's why I could not make it work then ^^ Was wondering how it I should code it with multiple selectors, but it' a moot point.
And ok for arrays, that's good news :)
Then I think this Issue can finally be closed, thank you so much !
@NellsRelo Sorry a laaaast point before I spend hours pouring my 2500 lines progression file into the config json... Can I safely add a comment without messing with something?
Something like (or after the uuid?)
"Comment": "Sorcerer 1",
"UUID": "42af9bda-9ac0-4564-920b-f9ca1588d6ee",
Inside progression there is the class/level but not there ^^
Yes, you should be able to - it won't get parsed into anything, so shouldn't break anything
I know there's nothing technically wrong with doing this, but it breaks my heart a little bit, but I guess we are limited by somewhat by UUIDs not being clear indicators.
Why JSON Does Not Support Comments? According to the JSON specification, a JSON document should only contain data structures like arrays and objects and not include comments. This is because JSON is intended to be a simple, easily parsable data format that can be quickly and efficiently processed
Feats are not done through selectors. I am on my phone, so give me a moment to get the correct syntax.
Really no rush, I'm just cleaning my personal mod using CLCF instead of barging through all class progressions and spell lists, nothing vital ^^
PS : I uploaded my Bootstrap if simpler to read
I am SO sorry for not getting back to you about this; I made some changes to my email filtering and I completely missed so much stuff. I haven't caught up on everything that has happened in this issue, but Nells has implemented the feat support in one of the recent releases... amongst 400 other things.
No prob really, I've had time to beta test each release x)
Agree with you about comments, but my progression file go through near every class/level since it adds some feats and spell slots, and it's hard to remember what class you are modding with just UUID ^^
Regarding booleans it was indeed implemented ! But for a change I have an error doing so, I guess it's time for a new post :p
Hey there :)
So I'm a lua newbie so it can very well be the issue but I wanted to try editing spell lists and adding selectors and passives to vanilla classes using CLCF so I would not run in any compatibility issue with other mods.
I set up my personal mod for SE and did BootstrapClient/Server like this (S1 being the UUID of sorcerer lvl1 progression):
Good thing is spell lists are good so it launches (hooray!)
Issue is InsertSelectors and InsertPassives do not... The console logs are :
If I swap InsertSelectors and InsertPassives I have this :
Sorry for the wall of text... all this mainly to be able to :
without having to overwrite the entire progression of all classes (spell list editing is a nice bonus^^)