Skip to content

Plants Def Extensions

juanosarg edited this page Sep 8, 2022 · 2 revisions

The VanillaPlantsExpanded module of Vanilla Expanded Framework adds a single Def Extension, DualCropExtension. This def allows plants to produce a secondary output.

public class DualCropExtension : DefModExtension
    {     
        public ThingDef secondaryOutput;
        public int outPutAmount;
        public bool randomOutput = false;
        public List<ThingDef> randomSecondaryOutput;
    }

How do I use this code?

Def Extensions are added to the ThingDef of the plant you want to add them to.

If you aren't sure if the def ALREADY has an extension (for example, if you think another mod will add their own), always use XPATH (xml patching) to add an extension, as there is already a PatchOperationAddModExtension to ensure they don't collide.

For example, this makes Barley in Vanilla Plants Expanded - More Plants to produce flour and hay

<modExtensions>
	<li Class="VanillaPlantsExpanded.DualCropExtension">
		<secondaryOutput>Hay</secondaryOutput>
		<outPutAmount>20</outPutAmount>
	</li>
</modExtensions>

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