Skip to content
This repository was archived by the owner on Nov 3, 2022. It is now read-only.

CompProperties_ConvertThingToResource

KylianB edited this page Apr 7, 2022 · 1 revision

Allow pawn to haul to the building, thing hauled will be pushed to net.

Basic

Below, an example of the comp, the building need to tick.

<li Class="PipeSystem.CompProperties_ConvertThingToResource">
  <pipeNet>VCHE_ChemfuelNet</pipeNet>
  <!-- ThingDef to take -->
  <thing>Chemfuel</thing>
  <!-- 1 removed is 1*X added in the net -->
  <ratio>X</ratio>
</li>

You will also need to add to your def:

  • <thingClass>Building_Storage</thingClass>
  •  <building>
       <preventDeteriorationOnTop>true</preventDeteriorationOnTop>
       <ignoreStoredThingsBeauty>true</ignoreStoredThingsBeauty>
       <fixedStorageSettings>
         <filter>
           <disallowNotEverStorable>true</disallowNotEverStorable>
           <thingDefs>
             <li>Chemfuel</li>
           </thingDefs>
         </filter>
       </fixedStorageSettings>
       <defaultStorageSettings>
         <priority>Important</priority>
         <filter>
           <disallowNotEverStorable>true</disallowNotEverStorable>
           <thingDefs>
             <li>Chemfuel</li>
           </thingDefs>
         </filter>
       </defaultStorageSettings>
     </building>
  •  <inspectorTabs>
       <li>ITab_Storage</li>
     </inspectorTabs>
  • <surfaceType>Item</surfaceType>
  • <tickerType>Rare</tickerType>

Advanced usage

If your building have this comp. Use the GetComp<CompConvertToResource>() method. Then you have access to:

public bool CanInputNow
public int MaxCanInput
public Thing HeldThing

And everything inherited from CompProperties_Resource;

VFE Core

General Comp classes

General DefModExtensions

Item Processor

PipeSystem

Custom Structure Generation

Multi Verb Combat Framework - MVCF

Animal Behaviours

Apparel

Cuisine

Furniture

Plants

Clone this wiki locally