Exporting buildings - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

To start with the generation code, you will need to export buildings you created in-game. To do this, there are two export tools you can use. Before doing so, I recommend enabling "Verbose logging" under "Custom Structure Generation" on the first page of the Vanilla Framework Expanded settings. This will output useful information and warn you about missing symbols (if any) at startup.

Export tools

You need to enable dev-mode to see the tools below:

  • The "Export" tool. Used for square buildings (max size of 51*51). Everything in the export square will be exported.
  • The "Export from area" tool. Used when you don't want to export a square (without size limitation).

Export tools

Export window

After using one of the export tool, the window below will show up :

Export window

Options and what they do, in order :

  • The defName for this structure (don't add the prefix here, there is another input field for it).
  • Set the exported structure as a stockpile, this is only useful if you plan on using the structure within a SettlementDef.
  • By default, power conduit are spawned under all impassable buildings and doors (only for industrial+ factions). Disable it if you want to manually place conduits.
  • Filth isn't exported by default, it can be enabled here.
  • Natural terrains aren't exported by default, it can be enabled here.
  • If you want to always generate the exported roof no matter what, enable this.
  • If you want the structure to be spawned on places without a roof, this is only useful if you plan on using the structure within a SettlementDef.
  • defName prefix field is required. Prefix is an identifier (for example, VFEM_ for Vanilla Faction Expanded Mechanoid).
  • You can also add tags to a structure, this is only needed if you plan on using the structure within a SettlementDef. Simply use the input field and then press "Add tag". All added tags will be displayed, with the option to remove them.

You can now copy the structure layout, paste it in a file inside your mod Defs folder, and do the same for the symbols. It is possible that no new symbols are needed, that's because all vanilla symbols are already exported automatically.

XML output

Here is the output of exporting one of the map ruin :

<KCSG.StructureLayoutDef>
  <defName>Wiki_TestExport</defName>
  <layouts>
    <li>
      <li>.,.,ChunkMarble,.,ChunkMarble,.,.,.,.</li>
      <li>.,ChunkMarble,ChunkMarble,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
      <li>.,.,.,.,.,.,.,.,.</li>
    </li>
    <li>
      <li>Concrete,Concrete,Concrete,Concrete,Concrete,Concrete,Concrete,Concrete,.</li>
      <li>Concrete,.,Concrete,Concrete,.,.,.,.,.</li>
      <li>Concrete,Concrete,Concrete,Concrete,Concrete,Concrete,.,Concrete,.</li>
      <li>Concrete,.,Concrete,Concrete,Concrete,Concrete,.,Concrete,.</li>
      <li>Concrete,Concrete,Concrete,.,Concrete,.,Concrete,.,.</li>
      <li>Concrete,Concrete,Concrete,Concrete,Concrete,Concrete,.,.,.</li>
      <li>Concrete,Concrete,Concrete,Concrete,.,.,Concrete,.,.</li>
      <li>Concrete,Concrete,Concrete,Concrete,.,Concrete,Concrete,.,.</li>
      <li>Concrete,Concrete,Concrete,Concrete,Concrete,.,Concrete,.,Concrete</li>
    </li>
    <li>
      <li>Wall_BlocksLimestone,Wall_BlocksLimestone,.,Wall_BlocksLimestone,.,Wall_BlocksLimestone,Wall_BlocksLimestone,.,.</li>
      <li>Wall_BlocksLimestone,.,.,Wall_BlocksLimestone,.,Plant_Dandelion,Plant_Grass,Plant_TallGrass,.</li>
      <li>Wall_BlocksLimestone,.,.,Door_BlocksLimestone,.,.,.,.,Wall_BlocksLimestone</li>
      <li>Wall_BlocksLimestone,Door_BlocksLimestone,Wall_BlocksLimestone,Wall_BlocksLimestone,.,Wall_BlocksLimestone,.,.,.</li>
      <li>Wall_BlocksLimestone,.,.,Wall_BlocksLimestone,.,Plant_Bush,.,Plant_TallGrass,AncientFence</li>
      <li>Wall_BlocksLimestone,.,.,Wall_BlocksLimestone,.,.,Plant_TreePoplar,.,.</li>
      <li>Wall_BlocksLimestone,.,.,Wall_BlocksLimestone,.,Plant_Grass,.,Plant_Grass,AncientFence</li>
      <li>Wall_BlocksLimestone,.,.,Door_BlocksLimestone,.,.,.,Plant_Grass,Plant_Grass</li>
      <li>Wall_BlocksLimestone,Wall_BlocksLimestone,Wall_BlocksLimestone,.,AncientFence,AncientFence,.,AncientFence,.</li>
    </li>
  </layouts>
  <roofGrid>
    <li>.,.,.,.,.,.,.,.,.</li>
    <li>.,.,.,.,.,.,.,.,.</li>
    <li>.,.,.,.,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
    <li>1,1,1,1,.,.,.,.,.</li>
  </roofGrid>
  <modRequirements>
    <li>ludeon.rimworld.ideology</li>
  </modRequirements>
</KCSG.StructureLayoutDef>

modRequirements is added and filled automatically. Here the ancient fences require the Ideology DLC. If you want, you can remove the requirement, if the user don't have Ideology, the fences will simply be skipped. If your export contains corpses, make sure to replace the "Corpse_xxxx" with a custom symbol.

And symbols would look like this (examples from VFE Medieval):

  <KCSG.SymbolDef>
    <defName>VFEM_CobblestoneWall_ChunkGranite</defName>
    <thing>VFEM_CobblestoneWall</thing>
    <stuff>ChunkGranite</stuff>
  </KCSG.SymbolDef>

  <KCSG.SymbolDef>
    <defName>VFEM_LowRockWall_ChunkGranite</defName>
    <thing>VFEM_LowRockWall</thing>
    <stuff>ChunkGranite</stuff>
  </KCSG.SymbolDef>

  <KCSG.SymbolDef>
    <defName>VFEM_WineBarrel_North</defName>
    <thing>VFEM_WineBarrel</thing>
    <rotation>North</rotation>
  </KCSG.SymbolDef>
⚠️ **GitHub.com Fallback** ⚠️