-
Notifications
You must be signed in to change notification settings - Fork 59
Random Building Graphic
juanosarg edited this page Jun 24, 2025
·
3 revisions
CompRandomBuildingGraphic allows you to assign random graphics to any building, except beds and other items that use the medical overlay (like nutrient past dispensers). Works both with Graphic_Single and Graphic_Multi.
//A simple comp class that changes a building's graphic by using reflection
//A list of image paths
public List<string> randomGraphics;
//By default, the building will spawn with an image from randomGraphics chosen at random, but the modder can disable that
public bool startAsRandom = true;
//The modder can also disable the randomize image button from appearing on this building
public bool disableRandomButton = false;
//The modder can also disable the choose image button from appearing on this building
public bool disableGraphicChoosingButton = false;
//And I just noticed that this one is redundant (disables both buttons), but fuck it, I give you options and YOU'LL LIKE IT
public bool disableAllButtons = false;It is a comp class, so you just add it in XML in the tag of the building. For example, this would give a building a graphic at random chosen from two graphics from Vanilla Genetics Expanded. No buttons hidden, and the building will spawn with one of them at random.
<li Class="VanillaFurnitureExpanded.CompProperties_RandomBuildingGraphic">
<randomGraphics>
<li>Things/Building/GR_AnimalEnrichmentCenter</li>
<li>Things/Building/GR_AdvancedGenePod</li>
</randomGraphics>
</li>WARNING: the original graphic of the building needs to be specified in randomGraphics too, or it will not be chosen as one of the alternatives (which might be what the modder wants, in that case don't add it)
- Abilities
- Aesthetic scaling
- Animal Behaviours
- Apparels
- Buildings
- Cooking
- Factions
- Genes
- Global
- Graphics
- Hediffs
- Maps
- Memes
- OptionalFeatures
- Pawns
- Planet
- Plants
- Storyteller
- Things
- Weapons
- Weathers
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Advanced Resource Processor
- 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