Skip to content

CompProperties_ResourceProcessor

KylianB edited this page Oct 6, 2022 · 3 revisions

Take input from net, can process input and spawn thing or fill a net.

Basic

Below, an example of the comp, the building need to tick (🟢 mean it default to true).

<li Class="PipeSystem.CompProperties_ResourceProcessor">
  <pipeNet>VCHE_ChemfuelNet</pipeNet>
  <!-- Ttrue to see the fill percent in the inspect tab-->
  <showBufferInfo>false</showBufferInfo> 🟢
  <!-- The possible results, if only one is available, no choice gizmo will be added -->
  <results>
    <li>
      <!-- Amount needed to start the process -->
      <countNeeded>1</countNeeded>
      <!-- Ticks to finish process -->
      <eachTicks>300</eachTicks>
      <!-- Output to net -->
      <net>AnotherNet</net>
      <!-- Amount to output -->
      <netCount>3</netCount>
      <!-- It will always try to output to net first. 
           If the net have more than two buildings but no capacity, process stop -->
      <!-- Produced thing -->
      <thing>Chemfuel</thing>
      <!-- Stack size of produced thing -->
      <thingCount>3</thingCount>
    </li>
  </results>
  <!-- Ambient sound -->
  <soundAmbient>VCHE_RefineryAmbient</soundAmbient>
  <!-- Translation key for when there is no capacity -->
  <notWorkingKey>VCHE_CantRefine</notWorkingKey>
</li>

In this example, process can be outputted to net. In that case, we need to add the CompProperties_Resource. Repeat this as many time as needed.

<li Class="PipeSystem.CompProperties_Resource">
  <pipeNet>AnotherNet</pipeNet>
</li>

You will also need to add to your def:

  • <tickerType>Normal</tickerType>

Advanced usage

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

public float Storage
public bool Working
public Result ChoosedResult

/// <summary>
/// Push resource to processor. Return amount used.
/// </summary>
public float PushTo(float amount)

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

Genes

Apparel

Cuisine

Furniture

Plants

Deprecated

Clone this wiki locally