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

Remove Selector ReplacePassives doesn't work #107

Open arnaudpourbaix opened 2 months ago

arnaudpourbaix commented 2 months ago

I have trying to remove these 2 selectors: ReplacePassives(7f7340a0-faf3-4122-bd3f-37a5434dd6cf,1,TotemWarriorPassiveReplace);SelectPassives(fb9ea4a2-a1ce-4242-a893-84a088ac1145,1,AspectOfTheBeast)

function removeSelector(target, type, uuid) 
    return {
        {
            modGuid = "",
            FileType = "Progression",
            TargetUUID = target,
            Function = type,
            ListUUID = uuid
        }
    }
end

    Mods.SubclassCompatibilityFramework.Api.RemoveSelectors(Mods.RAWaddon.removeSelector("8013e565-55a5-4847-8ebc-e2971e25151e", "ReplacePassives", "7f7340a0-faf3-4122-bd3f-37a5434dd6cf"))
    Mods.SubclassCompatibilityFramework.Api.RemoveSelectors(Mods.RAWaddon.removeSelector("8013e565-55a5-4847-8ebc-e2971e25151e", "SelectPassives", "fb9ea4a2-a1ce-4242-a893-84a088ac1145"))

RemovePassives produces this error: Error while dispatching event StatsLoaded: [string "SubclassCompatibilityFramework/CompatibilityS..."]:101: Property does not exist: resource::Progression::ReplacePassives - property does not exist stack traceback: [C++ Code]: in metamethod '__index' SubclassCompatibilityFramework/CompatibilitySupport/Queue.lua:101: in field 'Commit_SelectorRemoval' SubclassCompatibilityFramework/CompatibilitySupport/Queue.lua:134: in field 'CommitFeatsAndProgressions' SubclassCompatibilityFramework/CompatibilitySupport/Queue.lua:4: in field 'Commit' SubclassCompatibilityFramework/Init/_InitDefaults.lua:4: 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>

It is rather strange because they both share the same syntax. I have added a lot of traces and it seems that ReplacePassives needs UUID instead of ListUUID. However, while it doesn't produce an error, removal is not effective but it produces a strange behavior in game.

With both lines commented: image

ReplacePassives is Change Bestial Heart and SelectPassives is Animal Aspect.

With only removal of SelectPassives: image

It has correctly removed Animal Aspect but Change Bestial Heart is now titled as Class Passives. So it works, but it doesn't seem very clean with these side effects. If I comment SelectPassives and play only with RemovePassives paramters (UUID), I can eventually have an errorless code. But in game, I will still have my replace passive screen, but it will be titled as Class Passives.

It might be related to this issue: https://github.com/BG3-Community-Library-Team/BG3-Compatibility-Framework/issues/102

Removal code seems to overlap with other selectors, although I don't fully understand what can produce this side effect. And there is also this error about ReplacePassives. I have also tried with JSON format, but same issues.