EBSG Recorder - KonradHeinser/EBSGFramework GitHub Wiki

Basic Additions

The EBSG Recorder is a special def added by the framework that makes it easier for me to create lists of modded genes that are supposed to perform a specific function. For example, want to make a custom bloodfeeder gene? Normally that would require each mod makes a harmony patch on Rimworld's GeneUtility, but with one xml patch you can make the EBSG Framework handle that for you. Add this to your patches file, and replace the InsertListHere with whichever list you're looking to add to, and the InsertRelatedDefNameHere with the defName of the thing you want to add to the list:

    <Operation Class="PatchOperationAdd">
        <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/InsertListHere</xpath>
        <value>
            <li>InsertRelatedDefNameHere</li>
        </value>
    </Operation>

The Lists

  • bloodfeederGenes : Cause the Rimworld's gene utility to flag pawns with any of the genes in this list as bloodfeeders
  • hiddenGenes : Hides genes in the xenotype creation menu. If hiding a gene that is not within your own mod it is recommended to add a conditional to the patch to check if someone else loaded before you is already adding it to the list
  • hiddenTemplates : Hides all genes created from the template in the xenotype creation menu
  • pawnKindsWithoutIntialRelationships : PawnKindDefs added to this list won't generate any initial relationships when they are first made. This won't prevent them from forming new ones

Examples of adding items while also checking to make sure nobody before you has added it already. These examples are specifically for hiddenGenes and hiddenTemplates, and hide the deathless gene and any strong aptitude gene from the xenotype creation menu:

    <Operation Class="PatchOperationConditional">
        <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/hiddenGenes/li[text()="Deathless"]</xpath>
        <nomatch Class="PatchOperationAdd">
            <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/hiddenGenes</xpath>
            <value><li>Deathless</li></value>
        </nomatch>
    </Operation>

    <Operation Class="PatchOperationConditional">
        <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/hiddenTemplates/li[text()="AptitudeStrong"]</xpath>
        <nomatch Class="PatchOperationAdd">
            <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/hiddenTemplates</xpath>
            <value><li>AptitudeStrong</li></value>
        </nomatch>
    </Operation>

Linked Information

Sometimes the recorder requires multiple things that are linked together. When adding to these lists, rather than adding a single defName directly to the item, you will need to add a series of tags with related defNames within them so the Framework knows that they are related to each other. For The List of Items you replace InsertListHere with the first indented item, with each available tag being the items indented one extra time. There is an example of how to use this stuff at the bottom:

    <Operation Class="PatchOperationAdd">
        <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/InsertListHere</xpath>
        <value>
            <li>
                <tagA>InsertDefNameHere</tagA>
                <tagB>InsertOtherDefNameHere</tagB>
            </li>
        </value>
    </Operation>

The List of Items : Maybe I'll get to add an s the list to make it harder to say and more confusing

  • geneEvents : Connects genes to specific events that usually need a hard-coding to connect. Uses the GeneDef for the tag, and the HistoryEventDef for the propagation event

Example for List of Items

If the bloodfeeder propagation event used this framework instead of hard coding, it would be added like this:

    <Operation Class="PatchOperationAdd">
        <xpath>Defs/EBSGFramework.EBSGRecorder[defName="EBSG_Recorder"]/geneEvents</xpath>
        <value>
            <Bloodfeeder>PropagateBloodfeederGene</Bloodfeeder>
        </value>
    </Operation>
⚠️ **GitHub.com Fallback** ⚠️