Regenerating Things - KonradHeinser/EBSGFramework GitHub Wiki

This comp causes things and items that use those things as stuffing to regenerate over time. It is important to note that this will require the things(or things made from them) to use tickerType normal due to how Rimworld thingcomps trigger. As a result, using it as stuffing isn't recommended unless you're really confident you want to do it, and plan on testing on a variety of things that you want to have capable of regenerating. The basic comp looks like this:

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

There are only two tags available for this comp, the amount and the frequency:

  • regenerationAmount : Default (1) : The change in hit points. Can technically be negative, but must always be an integer
  • regenerationInterval : Default (60) : The number of ticks between regenerationAmounts. There are 60 ticks per second

Normal ticker tag:

        <tickerType>Normal</tickerType>

This example just takes all of the normal fabrication bench stuff, and makes it a regenerating variant

    <ThingDef ParentName="BenchBase">
        <defName>RegeneratingFabricationBench</defName>
        <label>regenerating fabrication bench</label>
        <description>Description.</description>
        <thingClass>Building_WorkTable</thingClass>
        <altitudeLayer>Building</altitudeLayer>
        <passability>PassThroughOnly</passability>
        <tickerType>Normal</tickerType>
        <pathCost>50</pathCost>
        <statBases>
          <MaxHitPoints>300</MaxHitPoints>
          <WorkToBuild>5000</WorkToBuild>
          <Flammability>1.0</Flammability>
        </statBases>
        <minifiedDef />
        <thingCategories Inherit="false" />
        <size>(5,2)</size>
        <costList>
          <Steel>200</Steel>
          <ComponentIndustrial>12</ComponentIndustrial>
          <ComponentSpacer>2</ComponentSpacer>
        </costList>
        <comps>
          <li Class="CompProperties_AffectedByFacilities">
            <linkableFacilities>
              <li>ToolCabinet</li>
            </linkableFacilities>
          </li>
          <li Class="CompProperties_Power">
            <compClass>CompPowerTrader</compClass>
            <basePowerConsumption>250</basePowerConsumption>
            <shortCircuitInRain>true</shortCircuitInRain>
          </li>
          <li Class="CompProperties_Flickable"/>
          <li Class="CompProperties_Breakdownable"/>
          <li Class="EBSGFramework.CompProperties_Regenerating" />
        </comps>
        <recipes>
          <li>Make_ComponentIndustrial</li>
          <li>Make_ComponentSpacer</li>
        </recipes>
        <graphicData>
          <texPath>Things/Building/Production/FabricationBench</texPath>
          <graphicClass>Graphic_Multi</graphicClass>
          <shaderType>CutoutComplex</shaderType>
          <drawSize>(7,4)</drawSize>
          <damageData>
            <cornerTL>Damage/Corner</cornerTL>
            <cornerTR>Damage/Corner</cornerTR>
            <cornerBL>Damage/Corner</cornerBL>
            <cornerBR>Damage/Corner</cornerBR>
          </damageData>
        </graphicData>
        <castEdgeShadows>true</castEdgeShadows>
        <staticSunShadowHeight>0.20</staticSunShadowHeight>
        <inspectorTabs>
          <li>ITab_Bills</li>
        </inspectorTabs>
        <building>
          <spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
        </building>
        <fillPercent>0.5</fillPercent>
        <interactionCellOffset>(0,0,-1)</interactionCellOffset>
        <hasInteractionCell>true</hasInteractionCell>
        <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
        <designationCategory>Production</designationCategory>
        <uiOrder>2530</uiOrder>
        <surfaceType>Item</surfaceType>
        <designationHotKey>Misc12</designationHotKey>
        <constructionSkillPrerequisite>6</constructionSkillPrerequisite>
        <placeWorkers>
          <li>PlaceWorker_ShowFacilitiesConnections</li>
          <li>PlaceWorker_PreventInteractionSpotOverlap</li>
        </placeWorkers>
        <researchPrerequisites>
          <li>Fabrication</li>
        </researchPrerequisites>
      </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️