Changing Graphic Render Nodes - KonradHeinser/EBSGFramework GitHub Wiki

These render node classes will allow you to make the graphics change periodically based on the interval you set. This currently only works for render nodes attached to genes. These are most of the things required for this render node:

        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <renderNodeProperties>
            <li Class="EBSGFramework.PawnRenderNodeProperties_EBSG">
                <changing>True</changing>
                <texPaths>
                    <li>PathA</li>
                    <li>PathB</li>
                </texPaths>
                <interval>15</interval>
            </li>
        </renderNodeProperties>
        <modExtensions>
            <li Class="EBSGFramework.EBSGBodyExtension">
                <interval>15</interval>
            </li>
        </modExtensions>

You will also need one of these two nodeClasses:

                <nodeClass>EBSGFramework.PawnRenderNode_EBSGAttachmentHead</nodeClass>
                <nodeClass>EBSGFramework.PawnRenderNode_EBSGAttachmentBody</nodeClass>

What does this stuff mean?

The easiest part to explain is the gene class and the intervals in the extension and the node. Normally, Rimworld doesn't like to update pawn textures once it figures out what they look like. The class and extension are there to force Rimworld to rerender the pawn based on the interval (the interval is in ticks). The interval in the render node is there to prevent other rerendering things from forcing the node to keep changing the graphics outside of the normal tick interval. The interval listed in the extension should be equal to or greater than the interval in the render node.

Next up is the other options within the render node properties:

  • changing : Default (False) : Tells the nodeClass that the list of texPaths you give it is for periodically changing stuff
  • texPaths : A list of paths to find textures on
  • random : Default (False) : When true, instead of going directly down the list, a random one will be picked every time
  • multi : Default (False) : Tells the render node if it should use Graphic_Multi instead of Graphic_Single
  • cutoutComplex : Default (False) : Tells the render node to use the cutout complex shader instead of the default the node would choose

The final note is on the nodeClass you want to choose. As the names imply, one is intended for head attachments while the other is for body attachments. PawnRenderNode_EBSGAttachmentHead inherits from PawnRenderNode_AttachmentHead while PawnRenderNode_EBSGAttachmentBody inherits from the standard PawnRenderNode because there is not a unique one for body attachments. This means that most of the things you could do with PawnRenderNode_AttachmentHead and PawnRenderNode are still available.


This very simplistic example puts the fire texture over the pawn's face. It doesn't look pretty since that's not what the texture was for, but does function:

    <GeneDef>
        <defName>FireFace</defName>
        <label>fire face</label>
        <description>Slap a fire on that face.</description>
        <iconPath>Things/Special/Fire/FireA</iconPath>
        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <iconColor>(0.75, 0.75, 0.75)</iconColor>
        <displayOrderInCategory>1000</displayOrderInCategory>
        <statOffsets>
            <ComfyTemperatureMin>-10</ComfyTemperatureMin>
        </statOffsets>
        <biostatCpx>1</biostatCpx>
        <biostatMet>-1</biostatMet>
        <renderNodeProperties>
            <li Class="EBSGFramework.PawnRenderNodeProperties_EBSG">
                <nodeClass>EBSGFramework.PawnRenderNode_EBSGAttachmentHead</nodeClass>
                <workerClass>PawnRenderNodeWorker_FlipWhenCrawling</workerClass>
                <changing>True</changing>
                <texPaths>
                    <li>Things/Special/Fire/FireA</li>
                    <li>Things/Special/Fire/FireB</li>
                    <li>Things/Special/Fire/FireC</li>
                </texPaths>
                <interval>15</interval>
                <cutoutComplex>True</cutoutComplex>
                <colorType>Custom</colorType>
                <overrideMeshSize>(1, 1)</overrideMeshSize>
                <parentTagDef>Head</parentTagDef>
                <rotDrawMode>Fresh, Rotting</rotDrawMode>
                <drawData>
                    <scaleOffsetByBodySize>true</scaleOffsetByBodySize>
                    <defaultData>
                        <layer>80</layer>
                    </defaultData>
                    <dataNorth>
                        <layer>10</layer>
                    </dataNorth>
                </drawData>
            </li>
        </renderNodeProperties>
        <modExtensions>
            <li Class="EBSGFramework.EBSGBodyExtension">
                <interval>15</interval>
            </li>
        </modExtensions>
    </GeneDef>
⚠️ **GitHub.com Fallback** ⚠️