Destroy on Death - KonradHeinser/EBSGFramework GitHub Wiki

Similar to how the death acidifier destroys all equipment on death, this hediff comp will destroy the pawn corpse itself. The most basic version of the comp doesn't require anything else, but there are added options for those interested. The basic comp looks like this:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_DestroyOnDeath">
            </li>
        </comps>

These are the tags available to the comp:

  • extraDeathSound : Creates a sound centered on the dead pawn's location
  • thingSpawn : A single thing to spawn in the pawn's place. Can be an ethereal object that quickly goes away to create special effects
  • thingsToSpawn : List version of thingSpawn

Based on modder feedback, this should probably be at the top of your comps list to avoid having the order mess with things. If you're still having issues with it at the top, try shuffling it around in your list to see if there's a spot that works, and if there isn't, let me know.


It is important to note that of everything in this framework, I rate this second most error risky, with the outgoing damage stat winning first place. I do not say that lightly as I know there's an entire system in this framework for making resource genes without needing to learn C#, which for all I know has massive mod incompatibilities that I haven't found yet. If you use this comp, test thoroughly both in vanilla and modded, and if you have a different, more specialized comp that acts similar to this, that may be the better option.


The example for this is not implemented anywhere, but was just the hediff created when I had an inspiration to make this while working on the Grimworld Necrons mod. When the pawn dies, they "warp" to some distant planet, never to be seen again. In their place, there's a brief green light made to act as the warp effect

    <HediffDef>
        <defName>GW_KoG_Warp</defName>
        <label>test "warp"</label>
        <description>This is a test hediff</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_DestroyOnDeath">
                <thingSpawn>GW_KoG_Warp</thingSpawn>
            </li>
        </comps>
    </HediffDef>
 
    <ThingDef ParentName="EtherealThingBase">
        <defName>GW_KoG_Warp</defName>
        <label>warp</label>
        <thingClass>ThingWithComps</thingClass>
        <tickerType>Normal</tickerType>
        <drawerType>RealtimeOnly</drawerType>
        <drawOffscreen>true</drawOffscreen>
        <category>PsychicEmitter</category>
        <altitudeLayer>MoteOverheadLow</altitudeLayer>
        <graphicData>
            <graphicClass>Graphic_Single</graphicClass>
            <texPath>EBSG/Circle</texPath>
            <shaderType>MoteGlowDistorted</shaderType>
            <color>(0, 255, 0)</color>
            <drawSize>10</drawSize>
            <shaderParameters>
                <_DistortionTex>/Other/Ripples</_DistortionTex>
                <_distortionIntensity>0.05</_distortionIntensity>
                <_DistortionScale>0.7</_DistortionScale>
                <_distortionScrollSpeed>(0.07, 0.07, 0.0)</_distortionScrollSpeed>
            </shaderParameters>
        </graphicData>
        <comps>
            <li Class="CompProperties_Glower">
                <glowRadius>20</glowRadius>
                <glowColor>(5, 105, 5,0)</glowColor>
            </li>
            <li Class="CompProperties_DestroyAfterDelay">
                <delayTicks>30</delayTicks>
            </li>
        </comps>
    </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️