CompProperties_ConvertThingToResource - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

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;

⚠️ **GitHub.com Fallback** ⚠️