-
Notifications
You must be signed in to change notification settings - Fork 6
2. Adding processes
Processes are defined in processDefs. Since these defs are not from RimWorld itself you need to add the namespace of the framework to their name. <ProcessorFramework.ProcessDef></ProcessorFramework.ProcessDef>
<ProcessorFramework.ProcessDef>
<defName>Beer</defName>
<thingDef>Beer</thingDef>
<ingredientFilter>
<thingDefs>
<li>Wort</li>
</thingDefs>
</ingredientFilter>
<processDays>6</processDays> <!-- in days, a day is 60,000 ticks -->
<capacityFactor>1.0</capacityFactor>
<efficiency>1.0</efficiency>
<usesTemperature>true</usesTemperature>
<temperatureSafe>-1.0~32.0</temperatureSafe>
<temperatureIdeal>7.0~32.0</temperatureIdeal>
<ruinedPerDegreePerHour>2.5</ruinedPerDegreePerHour> <!-- percent per degree per hour -->
<speedBelowSafe>0.1</speedBelowSafe>
<speedAboveSafe>1.0</speedAboveSafe>
<sunFactor>1.0~1.0</sunFactor>
<rainFactor>1.0~1.0</rainFactor>
<snowFactor>1.0~1.0</snowFactor>
<windFactor>1.0~1.0</windFactor>
<unpoweredFactor>0.0</unpoweredFactor>
<unfueledFactor>0.0</unfueledFactor>
<powerUseFactor>1.0</powerUseFactor>
<fuelUseFactor>1.0</fuelUseFactor>
<filledGraphicSuffix></filledGraphicSuffix>
<usesQuality>false</usesQuality>
<qualityDays>(1, 2, 3, 4, 5, 6, 7)</qualityDays>
<color>(255, 255, 255)</color> <!-- 0-255 or 0.0-1.0 -->
<customLabel></customLabel>
<destroyChance>0.0</destroyChance>
<bonusOutputs>
<Rat>(1.0, 1)</Rat>
</bonusOutputs>
</ProcessorFramework.ProcessDef>The above example is based on the vanilla beer fermentation process, most fields contain the default values. If you don't wish to change a field you can just omit it entirely, the comp will use the default value then. The only required fields are thingDef and ingredientFilter as those define product and ingredients.
defName is used to refer to this processDef in your processor comp
thingDef defines what product is produced when the process is finished
ingredientFilter defines the ingredients that can be used for the process
processDays is the duration in days the product takes to process
capacityFactor is how much space each ingredient takes up
efficiency is the conversion rate, so at a 0.5 (50%) efficiency and 20 maxCapacity you put 20 ingredient items in and get 10 product items out
usesTemperature is either true or false, if false the building will ignore temperature
temperatureIdeal is the same for ideal temperature, in this temperature range the speed will be 100%
temperatureSafe defines the float range of safe temperature, syntax is x~y with x being the minimum safe temperature and y being the maximum safe temperature
ruinedPerDegreePerHour is how fast the product gets ruined by temperature outside the safe temperature range, the value is in percent per degree per hour, so 2.5 means that the product gets ruined 2.5% per degree outside the safe temperature range per hour
speedBelowSafe is the speed the product processes below the safe temperature
speedAboveSafe is the speed the product processes above the safe temperature - between safe and ideal temperature the speed will be interpolated
sun- rain- snow- windFactor are speed factors depending on sunlight, rainfall, snowfall or wind, the value is lerped between the minimum and maximum possible sunlight/rain/snow/wind and the float range you enter. For example, wind can be between 0 and 3, if you enter a float range 0.5-1.0 the process will run at 50% speed when there is no wind (0), 75% at medium wind (1.5) and 100% at maximum wind (3)
unpoweredFactor is a multiplier for speed if the processor uses power and is currently unpowered
unfueledFactor is a multiplier for speed if the processor uses fuel and is currently not fueled
powerUseFactor is a multiplier for power consumption when this process is active, if parallel processes is enabled each process is calculated seperately and then averaged
fuelUseFactor is a multiplier for fuel consumption when this process is active, if parallel processes is enabled each process is calculated seperately and then averaged
filledGraphicSuffix allows you to define a suffix for your building that gets used when it contains ingredients, this can be useful for open structures like drying racks where you want to display visually that it is full
usesQuality set this to true if you want your product to get a quality based on how long it was processed
qualityDays this is a series of seven numbers that define the days needed to reach a quality level, the first number is how long it takes to reach awful quality and thus the time before there is a product, to skip a quality you can set several numbers to the same value, e.g. (3, 3, 3, 6, 9, 12, 15) means after 3 days you will have a normal quality product, good after 6 days, excellent after 12 and so on, lastly - if you use the quality feature processDays will have no effect on the process
colorCoded only works if your building has a texture with a mask and the mask has an area for the second color defined (black = no color, red = first color, green = second color). If true the green area in the mask will be colored when this process is selected - you also need to set
<thingClass>ProcessorFramework.Building_ColorCoded</thingClass>

color the color that is used for this process if colorCoded is set to true
destroyChance is the chance the processor will be destroyed when the the product of this process is retrieved, for things like fertile fields compost bin
bonusOutputs are additional products that can spawn when the the product of this process is retrieved, the list items take the thingDef as node (like costList for example), the first value is the chance the product is created (this will be modified by how full the processor was!) and amount is the number of products (int)
