BG3-Community-Library-Team / BG3-Compatibility-Framework

An API-based Driven Compatibility Framework for Baldur's Gate 3 Mods
MIT License
38 stars 13 forks source link

Lists array error #75

Closed Mythalar closed 8 months ago

Mythalar commented 8 months ago

Hey, probably easier to have a distinct topic for each :p

An error regarding UUIs array :

[ERROR]: [string "SubclassCompatibilityFramework/CompatibilityS..."]:15: attempt to index a nil value (local 'list')
stack traceback:
    SubclassCompatibilityFramework/CompatibilitySupport/ListsSupport/_ListCompatibility.lua:15: in global 'AddList'
    SubclassCompatibilityFramework/CompatibilitySupport/ListsSupport/_ListCompatibility.lua:31: in global 'HandleList'
    SubclassCompatibilityFramework/API/ListApi.lua:11: in field 'List'
    SubclassCompatibilityFramework/JsonLayer/ListHandler.lua:6: in global 'ParseAndSubmitLists'
    SubclassCompatibilityFramework/JsonLayer/ListHandler.lua:17: in global 'ListJsonHandler'
    SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:18: in upvalue 'SubmitData'
    SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:36: in function <SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:32>
    [C++ Code]: in function 'xpcall'
    SubclassCompatibilityFramework/JsonLayer/_JsonLoader.lua:47: in global 'LoadConfigFiles'
    SubclassCompatibilityFramework/Init/_InitDefaults.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>

UUIDs does work for cantrip lists but not leveled spell lists.

Edit : Actually seems there is a issus since the insertion does not work for the Magus modded class/list, even cantrips, which is odd since it's loaded and I have no prob inserting spells in (new) modded lists such as Cleric subclasses mod...

Attached config (lists with issues are at line 1517+) and logs

CompatibilityFrameworkConfig.json Extender Runtime 2023-10-27 13-14-31.log

NellsRelo commented 8 months ago

The error is happening because it isn't able to find the List from the game using the supplied UUID, which it should if the mod is activated, that's really weird. Your JSON config appears valid, too.

Going to try to mimic your mod set-up and see if I can dig deeper. In the meantime, I'm uploading a Debug Build that might provide more information on where things are failing There will be a lot of console messages, as a heads up. Does it seem to affect mainly lists where multiple UUIDs are being being provided?

NellsRelo commented 8 months ago

Debug build here

Mythalar commented 8 months ago

Here are the logs Extender Runtime 2023-10-27 19-23-54.log

Odd since it seems to work for bard (cantrip/levelled spells), not at all for wizard/sorcerer nore for warlock, cantrips are there for clerics but not the levelled spells...

NellsRelo commented 8 months ago

Huh, I might have uploaded the wrong build, log should have a lot more in there. So far, I've been able to find two of the lists that aren't found:

    {
      "Action": "Insert",
      "UUID": "c9c328b8-f066-48d9-9a2d-b6cfb62e13d8",
      "Type": "SpellList",
      "Items": [
        "Target_Command_Container",
        "Target_Sleep2e",
        "Shout_FalseLife",
        "Projectile_RayOfSickness",
        "Target_Harm2e",
        "Target_NathairsMischief",
        "Target_HoldPerson",
        "Target_WitherAndBloom",
        "Projectile_RayOfEnfeeblement",
        "Target_FeastOfAshes",
        "Target_BoneShaker",
        "Target_Slow",
        "Target_AnimateDead",
        "Target_VampiricTouch",
        "Target_VampiricTouch2e",
        "Target_Confusion",
        "Target_ResilientSphere",
        "Target_Blight",
        "Target_DeathWard",
        "Shout_ShadowOfMoil",
        "Target_DominatePerson",
        "Shout_DevouringDarkness",
        "Target_Cloudkill",
        "Projectile_NegativeEnergyFlood",
        "Target_Blister"
      ]

and

    {
      "Action": "Insert",
      "UUID": "349c99a9-bb7b-4e3f-860b-c182a06661e7",
      "Type": "SpellList",
      "Items": [
        "Target_Command_Container",
        "Target_Sleep2e",
        "Shout_FalseLife",
        "Projectile_RayOfSickness",
        "Target_Harm2e"
      ]
    },

I'll upload another debug build that might help narrow the cause down in your logs

NellsRelo commented 8 months ago

Debug Build here: https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/releases/tag/2.4.15-DBG-B

Mythalar commented 8 months ago

New logs, will investigate the 2 lists! Extender Runtime 2023-10-27 20-45-38.log

Mythalar commented 8 months ago

Ok those two are spell lists implemented by Cleric Subclasses mod, which sure is loaded since I can choose one of the subclasses :p Same thing for Magus class mod I guess.

That would not explain why spells are not added to, IE, sorcerer cantrip list (I checked the UUID).

NellsRelo commented 8 months ago

Just to make sure, is your mod loading after the others you're adding to? It could be that at that step in the process the other mod's lists don't exist yet.

The entry that prints just before the error will be the one that it can't find the list of, looks like this most recent one is:

{
    "ListItems" : 
    {
        "0" : "Target_Agitate",
        "1" : "Target_DrawIre",
        "2" : "Target_Endure",
        "3" : "Projectile_FriendFetch",
        "4" : "Shout_MageArmor2e",
        "5" : "Projectile_MagicMissile2e",
        "6" : "Target_Sleep2e",
        "7" : "Target_BitingWords",
        "8" : "Zone_ColorSpray2e",
        "9" : "Target_CondordantChoir"
    },
    "ListType" : "SpellList",
    "TargetList" : "073c09e5-ccb9-4153-a210-001225a30cbb",
    "modGuid" : "143ed971-72c8-4d11-a749-2d01a9badaff"
}
Mythalar commented 8 months ago

Oh and something else, you pointed :

    {
      "Action": "Insert",
      "UUID": "349c99a9-bb7b-4e3f-860b-c182a06661e7",
      "Type": "SpellList",
      "Items": [
        "Target_Command_Container",
        "Target_Sleep2e",
        "Shout_FalseLife",
        "Projectile_RayOfSickness",
        "Target_Harm2e"
      ]
    },

actually shows in game for the right subclass x)

NellsRelo commented 8 months ago

Huh, so it errors out but then still works? That's bizarre

Mythalar commented 8 months ago

Just to make sure, is your mod loading after the others you're adding to? It could be that at that step in the process the other mod's lists don't exist yet.

Yes my mod loads after all those that add classes/spells etc...

Mythalar commented 8 months ago

Sooo I'm dumb, looks like I deleted the wrong file earlier, the one that implemented some referenced spell lists.

Now that it's back all lists seem good, so sorry for your time -_- (but the "error that works" was a funny one)

NellsRelo commented 8 months ago

Happy to help 😄

Mythalar commented 8 months ago

Well, with me you can view and review all your code that's for sure...