Skip to content

Die And Change Into Another Def

juanosarg edited this page Feb 3, 2022 · 1 revision

CompDieAndChangeIntoOtherDef adds a gizmo that the player can use if the creature is tamed that destroys the animal and spawns a different thing in the same position. Basically a controllable metamorphosis

    //A comp that displays a gizmo if the animal is tamed. When clicked, it destroys the animal and turns it into a different def

    public bool needsDiggableTerrain = false;
    public ThingDef defToChangeTo;
    public bool mustBeTamed = true;
    public string gizmoImage;
    public string gizmoLabel;
    public string gizmoDesc;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this allows Awakened Nectarmaker dryads to turn into palms in VIE - Dryads

<comps>
	<li Class="AnimalBehaviours.CompProperties_DieAndChangeIntoOtherDef">
		<needsDiggableTerrain>true</needsDiggableTerrain>
		<gizmoImage>Things/Building/AmbrosiaPalm/AmbrosiaPalmA</gizmoImage>
		<gizmoLabel>VDE_TurnIntoPalm</gizmoLabel>
		<gizmoDesc>VDE_TurnIntoPalmDesc</gizmoDesc>
		<defToChangeTo>VDE_AmbrosiaPalm</defToChangeTo>
	</li>
</comps>

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