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

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

Conditional list insert #76

Closed Mythalar closed 11 months ago

Mythalar commented 11 months ago

Asking this after the previous insert list issue (missing spell lists), and for PF2e mod : Is it possible to insert spells to a targeted list only if a specific mod is loaded, so there would not be errors ?

As of now the insert is done with config JSON, but could be doable with API instead?

Mythalar commented 11 months ago

Non related other question (but i probably should not create 10 topics/day) : Is it planned for booleans to support uuid arrays ? That would be such a time saver but by no means mandatory

NellsRelo commented 11 months ago

I should probably update the docs, but yes - you would provide a modGuid field, like so:

{
  "FileVersion": 1,
  "Lists": [
    {
      "Action": "Insert",
      "UUID": "UUID of List",
      "UUIDs": ["UUID of List", "Another UUID of a List"]
      "Type": "SpellList, SkillList, or PassiveList",
      "Items": ["Name of Spell/Passive/etc", "additional spell/passive/etc name"]
      "modGuid": "UUID of required mod"
    }
  ]
}

This value defaults to the mod providing the json configuration, but can be set to another mod. It doesn't support multiple UUIDs though, which would be pretty neat and I'll try to figure out eventually.

For the second question, not currently, but that would be pretty useful, I'll work on adding it in for the next version :)

Mythalar commented 11 months ago

Very useful as it is thank you!

Mythalar commented 11 months ago

And just one modGui is quite enough since you could duplicate the objects for each separate mod so well... Problem solved ;)

Mythalar commented 11 months ago

Oh yes a question related to this though since it led to a lot of testing : when inserting into a list created by a mod, does the mod load order actually matter if compatibility framework is loaded last? I think I did not have any issue by having the new class mod after or before the spell mod but wanted to be sure