ProcessDef - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

Think of ProcessDef as a vanilla base game bill / recipe, but for Advanced Resource Processors. It specifies all information necessary to make the building work.

ProcessDefs are linked in CompProperties_AdvancedResourceProcessor.

For examples of several ProcessDefs, you can check out our VFE Medieval 2 mod here

     public List<Ingredient> ingredients = new List<Ingredient>();   // Ingredients needed. What is Ingredient? A container class, defined below!
     public bool destroyIngredientsOnStart = false;                  // Destroy ingredients when started?
     public bool destroyIngredientsDirectly = false;                 // Destroy ingredients as soon as inside processor
     public int ticks = 600;                                         // Produce each X tick(s): Default to 600 ticks (10 sec)
     public List<int> ticksQuality;                                  // A list of seven tick counts for each of the quality levels
     public int wastePackToProduce = 0;                              // Number of wastepack to produce when process end
     public List<ResearchProjectDef> researchPrerequisites;          // Research required to unlock the process

     public List<Result> results = new List<Result>();               // Results produced. What is Result? A container class, defined below!

     public Color finishedColor = new Color(0.9f, 0.85f, 0.2f);      // Bar color when finished
     public Color lowProgressColor = new Color(0.4f, 0.27f, 0.22f);  // Bar color low progress

     public bool isFactoryProcess = false;                           // This just affects precepts from VE Memes
     public bool autoGrabFromHoppers = false;                        // Auto insert from hoppers
     public List<IntVec3> autoInputSlots = null;                     // Position of the input slots for autoGrabFromHoppers
     public bool autoExtract = true;                                 // Auto extract
     public bool manualExtractAllowNet = true;                       // When pawn manually extract, result will try to go in net first
     public int extractTicks = 800;                                  // Manual extract ticks needed (for the extract job)
     public bool spawnOnInteractionCell = false;                     // For manual extracts

     // Variables handling processes being ruined by lack of power, temperature, etc

     public bool temperatureRuinable = false;                        // Can be ruined by wrong temperature
     public float minSafeTemperature;                                // Minimum safe temperature
     public float maxSafeTemperature = 100f;                         // Maximum safe temperature
     public float progressPerDegreePerTick = 1E-05f;                 // Ruining due to incorrect temp progress per tick

     public int rareTicksToDestroy;                                  // This handles the rest of them

     public bool noPowerDestroysProgress = false;                    // Can be ruined by a lack of power
     public string noPowerDestroysMessage = "IP_NoPowerDestroysMessage";
     public string noPowerDestroysInitialWarning = "IP_NoPowerDestroysInitialWarning";

     public bool isLightDependingProcess = false;                    // This defines whether the process is affected by bright light or lack of light
     public float maxLight = 1f;
     public float minLight = 0f;
     public string messageIfOutsideLightRangesWarning = "IP_OutsideLightRange";
     public string messageIfOutsideLightRanges = "IP_SpoiledDueToLight";

     public bool isRainDependingProcess = false;                     // This defines whether the process is affected by rain
     public string messageIfRainingWarning = "IP_ItRains";
     public string messageIfRaining = "IP_SpoiledDueToRain";

     // Variables for temperature-based acceleration
     
     public bool isTemperatureAcceleratingProcess = false;           // This defines whether the process goes faster if temperature is in a given range. UNIMPLEMENTED ATM
     public float maxAccelerationTemp = 1f;                           // The maximum temperature for the acceleration bonus
     public float minAccelerationTemp = 0f;                           // The minimum temperature for the acceleration bonus
     public float accelerationFactor = 1f;                            // The multiplier for ticks when temperature is in the ideal range

     // Variables handling ingredients and their handling

     public bool useIngredients = false;                             // Use ingredients. This refers to ingredients in base game (eg, those in a meal)
     public bool transfersIngredientList = false;                    // Ingredient list of the product will be ingredient list of the input 

     // Variables handling quality

     public bool stopAtQuality = false;                              // Process stops when reaching a given quality
     public QualityCategory quality = QualityCategory.Normal;
     public bool allowExtractAtCurrentQuality;                       // Allow players to stop the process

     // Misc

     public string labelOverride = "";
     public int priorityInBillList = 0;
     public bool hideProgressInInfobox = false;
     public string uiIconPath;                                        // Optional path to the icon used in the UI. If not defined, pipe net resource icon is used if possible.
     public bool disallowMixing;                                      // If true, different ingredients can't be mixed if you use thingCategory in ingredients

     // Sound handling

     public bool sustainerWhenWorking = false;
     public SoundDef sustainerDef;

Container classes used by the def:

     public class Ingredient
     {
         // Input ingredients can be pipenets, thingdefs or a category!
         public PipeNetDef pipeNet;
         public ThingDef thing;
         public ThingCategoryDef thingCategory;
         // Amount needed to produce result
         public float countNeeded;
         public bool nutritionGetter = false;
     }

     public class Result
     {
         public PipeNetDef pipeNet;                          // Result as a piped resource
         public ThingDef thing;                              // Result as a thing
         public Type workerClass;                            // Defines a custom class derived from ResultWorker (see below) that can add logic to how the result is produced (e.g., dynamically change the output thing).
         public int count;                                   // Count to produce
         public IntVec3 outputCellOffset = IntVec3.Invalid;  // Result cell output (offset based on center)
     }
	 
	public class ResultWorker
    {
        public Result result;

        public virtual ThingDef GetResult(Process process)
        {
            return result.thing;
        }
    }
⚠️ **GitHub.com Fallback** ⚠️