Skip to content

Thing Producer

Neronix17 edited this page Mar 21, 2023 · 1 revision

This code simply allows a building to build up an internal supply of a defined thing, which can be extracted using a right click menu with a pawn selected. Just change the thingClass to TabulaRasa.Building_ThingProducer and use this modExtension to give it the info:

<modExtensions>
    <li Class="TabulaRasa.DefModExt_ThingProducer">
        <!-- The def of the item to be produced. -->
        <thingDef>ThingyWingy</thingDef>
        <!-- Ticks it takes for one thing to be produced. 
             60k = 1 day -->
        <productionTime>1000</productionTime>
        <!-- The internal limit of how many it holds till it stops producing. -->
        <maxThings>1</maxThings>
        <!-- The translation key used in the context menu. 
             e.g. <TakeItemFromProducerLabel>Take {0} from producer.</TakeItemFromProducerLabel> -->
        <retrievalString>TakeItemFromProducerLabel</retrievalString>
        <!-- Whether or not producing needs power provided. -->
        <requiresPower>false</requiresPower>
    </li>
</modExtensions>

Clone this wiki locally