Skip to content

Furniture Comp Classes

juanosarg edited this page Dec 11, 2022 · 13 revisions

The Furniture module of the framework has two comp classes that can be added to any Building to provide special behaviours:

  • CompProperties_SelectBuildingBehind: Adds a command button (called gizmos in the code) to the Building that allows the player to deselect it and select another building that is in the same tile. This is also done in the game by clicking in the same spot several times, so this class is mostly cosmetic. You can set via XML the button's graphic, text and description. For example, we use it with Vanilla Furniture Expanded - Art's holograms, where a button appears on hologram to select the underneath hologram base. You can check an example here

  • CompProperties_RandomBuildingGraphic: Complex enough to deserve its own page. Allows random building graphics.

  • CompProperties_RockSpawner: This is just code for an auto-drill. It selects rocks from the biome it is in.

  • CompProperties_SpawnOtherBuildingWhenPowered: A comp class to detect whether this Building is powered (and flicked ON) and then spawn a different Building on top of it. If the first Building is flicked OFF, or runs out of power, or is moved away, the second Building despawns

This second building needs to have:

    <clearBuildingArea>false</clearBuildingArea>
<building>
	<isEdifice>false</isEdifice>
	<canPlaceOverWall>true</canPlaceOverWall>
</building>

Or it will just delete the first one! Though maybe that's what you want, I won't judge

We use this class with Vanilla Furniture Expanded - Art's holograms. The base spawns the hologram itself. The base has 0 Beauty, but the hologram has variable beauty (depending on quality). This allows us to create a building that only produces Beauty when powered, with very very low lag.

Example of this code in use is here

How do I use this code?

They are all comp classes, so you just add them in XML in the tag. Check any of the examples to see.

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