-
Notifications
You must be signed in to change notification settings - Fork 59
LootableBuilding
juanosarg edited this page Jun 24, 2025
·
4 revisions
LootableBuilding creates lootable buildings that use base game IOpenable interface, which automatically handles the gizmo, the workgivers, the jobdrivers, etc.
First of all, the thingClass of the building needs to be:
<thingClass>VEF.Buildings.LootableBuilding</thingClass>Secondly, you need a mod extension that tells the main class what to pop up when the building is opened. This mod extension is LootableBuildingDetails
public bool randomFromContents = false;
public IntRange totalRandomLoops = new IntRange(1, 1);
public List<ThingAndCount> contents = null;
public ThingDef buildingLeft = null;
public SoundDef deconstructSound = null;
public string gizmoTexture; //Ignored by this class
public string gizmoText; //Ignored by this class
public string gizmoDesc; //Ignored by this class
public string cancelLootingGizmoTexture; //Ignored by this class
public string cancelLootinggizmoText; //Ignored by this class
public string cancelLootinggizmoDesc; //Ignored by this class
public string requiredMod = "";
public string overlayTexture;ThingAndCount is a container class:
public class ThingAndCount
{
public ThingDef thing;
public int count = 1;
}These are the lootable crates from our Quests mods:
<modExtensions>
<li Class="VEF.Buildings.LootableBuildingDetails">
<contents>
<li Name="BasicCarParts">
<thing>ComponentIndustrial</thing>
<count>8</count>
</li>
</contents>
<buildingLeft>VQED_EmptyMilitaryPallet</buildingLeft>
</li>
</modExtensions>Here is a more complex one with random contents:
<modExtensions>
<li Class="VEF.Buildings.LootableBuildingDetails">
<contents>
<li>
<thing>VQED_Gun_Autopistol_Ancient</thing>
<count>1</count>
</li>
<li>
<thing>VQED_Gun_MachinePistol_Ancient</thing>
<count>1</count>
</li>
<li>
<thing>VQED_Gun_PumpShotgun_Ancient</thing>
<count>1</count>
</li>
<li>
<thing>VQED_Gun_LMG_Ancient</thing>
<count>1</count>
</li>
</contents>
<randomFromContents>true</randomFromContents>
<totalRandomLoops>1~1</totalRandomLoops>
<buildingLeft>VQED_EmptyAncientWeaponBox</buildingLeft>
</li>
</modExtensions>- 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