Skip to content

Temperature Transforms

SokyranTheDragon edited this page Jun 2, 2026 · 2 revisions

<- Back

CompProperties_TempTransforms makes an item transform into a different one if a certain temperature is reached

        public float minSafeTemperature;
        public float maxSafeTemperature = 100f;
        public float progressPerDegreePerTick = 1E-05f;
        public string thingToTransformInto = "";
        public bool preserveHp = true;
        public bool keepForbidden = true;
        public bool keepQuality = true;
        public bool keepRottableProgress = true;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. It is used for example in Vanilla Cooking Expanded's grills, that turn into "ruined" versions of themselves if frozen, or in vanilla Brewing Expanded's Hot coffee, that turns into Iced coffee when frozen.

<comps>
	<li Class="VEF.Cooking.CompProperties_TempTransforms">
		<minSafeTemperature>10</minSafeTemperature>
		<maxSafeTemperature>75</maxSafeTemperature>
		<progressPerDegreePerTick>0.00003</progressPerDegreePerTick>
		<thingToTransformInto>VCE_RuinedSimpleGrill</thingToTransformInto>
		<!-- If the new item should have the same HP percentage (rounded up). For example, a 50/100 HP item may turn into a 25/50 one. -->
		<preserveHp>true</preserveHp>
		<!-- If the new item should be kept forbidden if the original one was. If false, it'll always be unforbidden. -->
		<keepForbidden>true</keepForbidden>
		<!-- If the new item should preserve quality and/or art of the old item, if any. -->
		<keepQuality>true</keepQuality
		<!-- If the new item should keep spoiling progress percentage (CompRottable) of the old one. If the old item was 50% of the way towards being spoiled, the new one will be as well. -->
		<keepRottableProgress>true</keepRottableProgress
	</li>
</comps>

Clone this wiki locally