Skip to content

Destroy This Item

juanosarg edited this page Jan 25, 2021 · 1 revision

CompDestroyThisItem is a comp class that is added to an item, not an animal, and adds a configurable button to the item's commands bar that queues a (Hauling) job for colonists to approach the item and destroy it. This can be used to allow the player to get rid of unwanted animal products that aren't otherwise easy to get rid of.

    //The comp class itself only needs configuration for button images, labels and descriptions

    public string buttonLabel = "";
    public string buttonDesc = "";
    public string buttonIcon = "";

    public string buttonCancelLabel = "";
    public string buttonCancelDesc = "";
    public string buttonCancelIcon = "";

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag of the item you want to be able to be destroyed by the player. For example, this allows Phoenix Eggs in Magical Menagerie to be targeted for destruction:

<comps>
	<li Class="AnimalBehaviours.CompProperties_DestroyThisItem">
		<buttonLabel>MM_DestroyEggsLabel</buttonLabel>
		<buttonDesc>MM_DestroyEggsDesc</buttonDesc>
		<buttonIcon>UI/MM_DestroyPhoenixEgg</buttonIcon>
		<buttonCancelLabel>MM_CancelDestroyEggsLabel</buttonCancelLabel>
		<buttonCancelDesc>MM_CancelDestroyEggsDesc</buttonCancelDesc>
		<buttonCancelIcon>UI/MM_CancelDestroyPhoenixEgg</buttonCancelIcon>
	</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