Profiles - osirisOfGit/BG3_Absolutes_Laboratory GitHub Wiki
Profiles represent an ordered group of Mutations that should run during the LevelGameplayReady
Osiris Event.
You can have any number of profiles using any number of mutations, but only one profile can be active for a given save. The active Profiles is saved to a ModVar, so it will only be available in saves created once it was activated and afterwards - loading a save before you activated a profile will not have it loaded (unless it's your default profile and you haven't disabled the default for that save)
Mutations are applied in the order specified - later Mutations override earlier ones, but certain mutators have an additive
property. The details of what this means are specified in each applicable mutator's page, but you can allow these mutators to be additive by checking the checkbox next to the mutation - if this is not checked, simple override behavior will be used instead.
!!! Important !!! The ProfileExecutor will undo all non-transient mutators before executing all the mutations every time it runs (each LevelGameplayReady event) - this is for the following reasons:
- The profiles are too complex for any reliable change detection, especially given the random nature of some of the mutators
- Mods added between save loads can affect the outcome of a Mutator (i.e. a mod adding spells to a progression linked to a Spell List mutator), which would be impossible for Lab to track and predict
Users should only really notice this if they save in the middle of combat, then reload, and even then most mutators shouldn't cause any differences an average user would notice. This is an untested theory though, so please provide feedback!
Create your profile by dragging and dropping mutations from the left sidebar into the profile section, onto the buttons - you can do it for blank or populated buttons.
bg3_dx11_Z2BzLiHDDr.mp4
Choosing to export a Profile (not Export For Mod) will create a JSON file under %localappdata%\Larian Studios\Baldur's Gate 3\Script Extender\Absolutes_Laboratory\ExportedProfiles\
, named using the profile name(s), which includes all mutations, mutators, selectors, and lists used in that profile. This file can be reimported immediately by you if you want to check what was exported - Lab will prevent duplication of Mutations and Profile names where necessary by assigning new UUIDs to things that have them, and appending - Imported
or the first 3 characters of the UUID to the Name of the artifact.
Lab will also record any mods used for resources/stats in the packaged mutations in the export itself, validating that these mods are present when the user imports the file. If any are missing, the user is presented with a warning, a detailed report, and the option to continue. If they choose to continue without first loading the mod, Lab will scrub all references to that resource/stat in the relevant selectors/mutators, proactively removing any possible runtime errors - the file itself will be untouched, allowing it to be reimported later (though the original import will need to be deleted via the menu so it isn't renamed on top of the original renaming, causing an - Imported - Imported
situation).
If any mutations from Mods are used (see below), those mutations will not be exported - instead, a dependency on the mod providing those mutations will be recorded, preserving the link to that mod. If you want to package the mutation separately, copy it to your own folder first, use that in your profile, then export.
Choosing the Export For Mod
option will instead create two files in the same location - AbsolutesLaboratory_ProfilesAndMutations.json
and ExportedModMetaLsxDependencies.lsx
.
The .json file is named this way because that is what Lab looks for in every active mod to determine if there're profiles/mutations to load. Simply place this file next to your meta.lsx and you're good to go - see the Example Mod
Profiles/Mutations/Lists loaded by users this way won't be renamed - they're stored separately in-memory from the users ones, so there won't be any kind of conflict. You can use Mod-added mutations/lists in your own profiles, but same rules as above apply: You can't export another mod's mutations/lists without copying it to your machine first (which is usually desirable, in case the original author updates them to work better in relevant circumstances).
The contents of the second file, ExportedModMetaLsxDependencies.lsx
, should be used in the meta.lsx to document your mod's dependency on the relevant mods (including Lab!), allowing those dependencies to show up in Mod Managers for user convenience. Simply copy the contents into your meta.lsx under the Dependencies node, and you're good to go (see the Example Mod again for a full file example). I recommend repeating this process every time you update your mod's export file, as these blocks also contain the versions of the mods you were using when you exported, so copying it over again will update the versions even if the mod list itself hasn't changed.
<node id="Dependencies">
<children>
<node id="ModuleShortDesc">
<attribute id="Folder" type="LSWString" value="Attunement" />
<attribute id="MD5" type="LSString" value="" />
<attribute id="Name" type="FixedString" value="Attunement" />
<attribute id="UUID" type="FixedString" value="7a526492-f5f4-44a0-ab25-ddcc4c6c1e7e" />
<attribute id="Version64" type="int64" value="36451020221448192" />
</node>
<node id="ModuleShortDesc">
<attribute id="Folder" type="LSWString" value="Valkrana's Skeleton Crew Feat" />
<attribute id="MD5" type="LSString" value="" />
<attribute id="Name" type="FixedString" value="Valkrana's Skeleton Crew Feat" />
<attribute id="UUID" type="FixedString" value="d76ff1e5-e09e-4565-a9d2-a035037f6134" />
<attribute id="Version64" type="int64" value="38702811445198848" />
</node>
<node id="ModuleShortDesc">
<attribute id="Folder" type="LSWString" value="Absolutes_Laboratory" />
<attribute id="MD5" type="LSString" value="" />
<attribute id="Name" type="FixedString" value="Absolute's Laboratory" />
<attribute id="UUID" type="FixedString" value="a17a3a3d-5c16-404a-910a-68ae9e47f247" />
<attribute id="Version64" type="int64" value="36028797018963968" />
</node>
</children>
</node>