Mutations - osirisOfGit/BG3_Absolutes_Laboratory GitHub Wiki
Mutations are the bread and butter of Lab - these allow you to make targeted, convenient changes to entities using as much specificity and randomness, or lackthereof, as you desire.
Mutations are comprised of two aspects:
Think of these as a type of query language for entities - you have AND, OR, and NOT queries based on varying criteria that can be composed to be make as advanced a query as you need.
General Rules:
- If a selector option has multiple checkboxes, like Race, and none of those checkboxes are selected, Lab will check if the entity is that parent value or is a child of that parent (for example, setting a Humanoid Race Selector will find all Humanoids and all subraces of Humanoid)
- Selectors are processed in the order defined - groups are formed at each AND/OR Boundary
The Dry Run button will preview the results of your selectors based on what was indexed by the Entity Scanner in the Inspector.
Walkthrough
Let's start with the below:
This shows using a Nested query - in DB Query Terms, this might look like:
SELECT *
FROM ENTITIES
WHERE
(
RACE IS IN ('Blight', 'Myconid', 'Shambling Mound')
AND (FACTION = 'ACT1_UND_Myconids')
)
if we were to uncheck the Inclusive checkbox from the Race selector (making it Exclusive), this would turn into
...
WHERE
(
RACE IS NOT IN ('Blight', 'Myconid', 'Shambling Mound')
AND (FACTION = 'ACT1_UND_Myconids')
)
That checkbox you see next to the Faction is available for any resources that have children inheriting from them. Shift-click on the checkbox to see the hierarchy:
For this faction, you can see BroodingMyconid is the only child, so if the checkbox was checked that faction would also be included in the query, turning it into
WHERE
(
RACE IS NOT IN ('Blight', 'Myconid', 'Shambling Mound')
AND (FACTION IS IN ('ACT1_UND_Myconids', 'ACT1_UND_Myconids_BroodingMyconid'))
)
Finally, we can add another selector at the same level as the first:
This adds an AND
clause, specifying that entities much match the above criteria AND also have Myconid_Adult_WhiteSpores
as a CharacterStat, turning the query into
SELECT *
FROM ENTITIES
WHERE
(
RACE IS IN ('Blight', 'Myconid', 'Shambling Mound')
AND (FACTION = 'ACT1_UND_Myconids')
)
AND STAT = 'Myconid_Adult_WhiteSpores`
Choosing OR
instead would have the expected effect - either the first or second 'clause' must match for the entity to be selected.
If a And/Or is not chosen between two selectors, AND
is the assumed operation.
Demo
bg3_dx11_0kkn7R5mRS.mp4
These are what actually change, or mutate, NPCs. Mutators adhere to the following philosophies:
- All entities can be mutated in a safe manner - users should not have to account for any individual entity's weirdness to avoid breaking other entities
- All mutations should be completely reversable without the user having to reload to save before the mutations were applied
- All mutation results should be visible and understandable in the Inspector
Given the complex and distinct nature of each Mutation, there isn't much else that can be summarized about them. See Profiles for more info about the nuances of loading Mutations