-
Notifications
You must be signed in to change notification settings - Fork 37
Furniture Comp Classes
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
They are all comp classes, so you just add them in XML in the tag. Check any of the examples to see.
- QuestNode_GetFaction
- Expandable projectiles
- Faction Def Extension
- Toggable patches
- Recipes Inheritance
- Adding new backstories
- Spawning things on new generated maps
- ThoughtExtensions
- WeatherLetterExtensions
- WeatherOverlayExtension
- WeatherEffectsExtension
- ThingDefExtension
- Stuff commonality extension
- Biome extension
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Update to KCSG 2.0
- Exporting buildings
- Customizing symbols
- Debug helpers options
- Custom faction settlement
- Custom structure and scenarios
- Custom structure in quests
- Custom structure in WorldObjects
- Biome based structures
- Spawning world object(s) at world generation
- Prevent settlement spawning for nomadic factions
- Animal Behaviours Basics
-
Animal Behaviours Comp Classes
- Acid Attacks and Acid Immunity
- Animal Resources
- Animal Resources On Caravan
- Apply Hediff When Bound
- Asexual Reproduction
- Auto Nutrition
- Blink
- Build Periodically
- Cause Incident
- Change Def if Not Unique
- Change Weather
- Corpse Decayer
- Destroy This Item
- Die After Period
- Die And Change Into Another Def
- Dig Periodically
- Dig When Hungry
- Disease Event Immunity
- Disease Immunity
- Diseases After Period
- Doesn't flee
- Draftability
- Drop on Death
- Eat Weird Food
- Electrified
- Enrage Other Pawns
- Exploding Hatcher
- Extreme Xenophobia
- Fertilizer
- Filth Producer
- Fixed Gender
- Floating
- Gas Producer
- Give Thoughts On Caravan
- Graphic by Style
- Graphic by Terrain
- Hediff Effecter
- Hediff When Fleeing
- Highly Flammable
- Infecter
- Initial Ability
- Initial Hediff
- Initial Mental State
- Last Stand
- Light Sustenance
- Metamorphosis
- Mind Effecter
- Nearby Effecter
- No Taming Decay
- Passive Regenerator
- Pawn Overlay
- Produces no filth
- Refueling
- Regeneration
- State After Health Loss
- Summon On Spawn
- Swallow Whole
- Thought Effecter
- Untameable
- Animal Behaviours Hediff Comp Classes
- Animal Behaviours Damage Workers
- Animal Behaviours Def Extensions
- Animal Behaviours Extra Defs
- Animal Behaviours Misc