CompAdvancedResourceProcessor - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

The CompAdvancedResourceProcessor class is the heart of the Advanced Resource Processor code. You add it in XML to the comps tag of a Building, and you can define all its variables there. A lot of possible machine combinations are possible. We copy here all this code so it can serve as a reference.

Note that all the values shown here are the defaults, and they are overriden by anything fed through XML, for example <showBufferInfo>false</showBufferInfo> would override the "true".

For an example of how to use all this, you can take a look at our VFE Medieval 2 mod here

        // Show inspect string?
        public bool showBufferInfo = true;

        // Translation key:
        public string notWorkingKey;

        // All possible processes
        public List<ProcessDef> processes;

        // Sound when working
        public SoundDef soundAmbient;

        // Progress bar
        public bool showProgressBar = true;
        public Vector3 progressBarOffset = Vector3.zero;
        public bool alwaysShowProgressBar = false;

        // Wastepack bar
        public bool showWastepackBar = true;
        public Vector3 wastepackBarOffset = Vector3.zero;
        public bool stopWhenWastepackFull = false;

        // Result icon
        public bool showResultItem = false;
        public Vector3 resultItemOffset = Vector3.zero;
        public Vector3 resultItemSize = new Vector3(0.5f, 1, 0.5f);

        // Time required to put item inside processor
        public int ticksToFill = 200;

        // Heat push
        public bool heatPushWhileWorking = false;

        // Building image changing
        public string inProgressTexture="";
        public string finishedTexture="";

How do I use this code?

You will need to add this comp to the comps tag of a building. For example, this is the mead fermenting barrel in VFE Medieval 2:

<comps>
	<li Class="PipeSystem.CompProperties_AdvancedResourceProcessor">
		<notWorkingKey>VFEM2_MeadFermentingBarrelNotWorking</notWorkingKey>
		<processes>
			<li>VFEM2_HoneyToMead</li>
		</processes>
		<progressBarOffset>(0,0,-0.5)</progressBarOffset>
		
	</li>
</comps>

Further considerations

  • The building needs:
<inspectorTabs>
	<li>PipeSystem.ITab_Processor</li>
</inspectorTabs>

To show a tab to choose the active process

  • If you want a progress bar in your building, or any other type of graphic changing, it will need
<drawerType>MapMeshAndRealTime</drawerType>
⚠️ **GitHub.com Fallback** ⚠️