RimWorld

RimWorld

Vanilla Outposts Expanded: Additional Outposts
This topic has been locked
BanDHMO 12 Jul, 2023 @ 7:09am
How I added my own outpost through XML
The most simple and common outpost types produce some item from a list of choices, at a fixed rate per skill point of the pawns working there. For example: hospital, restaurant, etc. More such outposts can be added to your game with just XML. I know many people here have ideas for what new outposts could produce. So I will share how I created one for myself.

First, I created a new mod where my changes will be, so that they don't get overwritten whenever MrHydralisk releases a new version of XMLs. It's easy to do this by simply copying and modifying this mod itself.

This mod is located in C:\Program Files (x86)\Steam\steamapps\workshop\content\294100\2873841790 and the custom unpublished mods should be in C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods, so that's where I copied it. I then renamed 2873841790 to my mod's name additional_outposts_more_capital.

Then I opened that new mod folder and went through every file, deleting everything that was not directly related to a production outpost like medical center, which I used as a base for my new outpost. This left me with just a few files:

C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\additional_outposts_more_capital\Defs\WorldObjectDefs\Outposts.xml

The About folder.

And finally the C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\additional_outposts_more_capital\Textures\WorldObjects folder.

Then I went through each file and made the edits to turn the old medical outpost XML into XML for my new outpost, which is a mechanized farm producing corn, rice, hay or cotton based on plants and construction skills of the pawns.

Textures is where the outpost icons are. If you have a good enough image editor software, you can make something fancy. I just took an existing picture of the farming outpost from the parent mod and slapped a "2" on it with Paint 3D (regular Paint seems too primitive to keep background transparency). I named it OutpostFarming2.png

The About folder has files that describe the mod, give it a unique name, and list dependencies. I've added dependency on MyHydralisk's mod, of course, but also on the Vanilla Outposts Extended, because I wanted to simply get the outpost layout for battles from there. I don't use outpost battles myself and didn't want to spend the time to figure out how all that stuff works, so I just took the line from the original farming outpost and copied it to mine.

About.xml and Manifest.xml describe the mod, it's unique name, dependencies on other mods by their names, etc. I kept and edited these. Preview.png is the mod page picture. I just butchered it a bit with Paint to tell my mod apart from the original. Everything else in this folder I removed.

The Outposts.xml is where the outpost is actually described. I changed the skills required, items produced, and how much it produces, as well as name, description, world icon, and combat layout.

And that was it. Now I could boot up RimWorld and select my new mod. After a bunch of troubleshooting errors caused by things like me screwing up and missing a < in one place, and me using wrong names for some of the outputs (it's "RawRice" not "Rice"), the mod was loading successfully, could be built in my ongoing save (backed it up first, obviously), and showed the right product selection/output.

I'm not planning to put the mechanized farm specifically up on workshop, since it's not particularly valuable for how most players play. Frankly, I'm not even sure if I'll be using it myself. It's the structure of how to add the new outpost that I want to share. The XMLs will be in the next post, though, to illustrate exactly what it looks like.
< >
Showing 1-4 of 4 comments
BanDHMO 12 Jul, 2023 @ 7:22am 
Outposts.xml
---------------------


<?xml version="1.0" encoding="utf-8"?>
<Defs>

<WorldObjectDef ParentName="OutpostBase">
<defName>Outpost_Field_MechanizedFarm</defName>
<label>Mechanized Farm</label>
<description>Places an autonomously-led farm that specializes in producing mass row crops using heavy machinery. The specialized machinery used limits crop choices. It also requires pawns capable of maintaining the equipment as well as growing plants.</description>
<worldObjectClass>VOEAdditionalOutposts.Outpost_ChooseResultFloat</worldObjectClass>
<expandingIconTexture>WorldObjects/OutpostFarming</expandingIconTexture>
<modExtensions>
<li Class="Outposts.OutpostExtension_Choose">
<RequiredSkills>
<Plants>4</Plants>
<Construction>12</Construction>
</RequiredSkills>
<TicksPerProduction>900000</TicksPerProduction>
<TicksToSetUp>120000</TicksToSetUp>
<ProvidedFood>MealFine_Veg</ProvidedFood>
<DisplaySkills>
<li>Plants</li>
<li>Construction</li>
</DisplaySkills>
<ChooseLabel>Choose a crop to grow</ChooseLabel>
<ChooseDesc>Choose which plants the outpost will grow</ChooseDesc>
</li>
<li Class="VOEAdditionalOutposts.OutpostExtension_ChooseFloat">
<AdditionalDisplaySkills>
<li>Construction</li>
</AdditionalDisplaySkills>
<ResultOptions>
<li>
<Thing>RawRice</Thing>
<AmountsPerSkills>
<Plants>100</Plants>
<Construction>50</Construction>
</AmountsPerSkills>
</li>
<li>
<Thing>RawCorn</Thing>
<AmountsPerSkills>
<Plants>120</Plants>
<Construction>60</Construction>
</AmountsPerSkills>
</li>
<li>
<Thing>Hay</Thing>
<AmountsPerSkills>
<Plants>150</Plants>
<Construction>75</Construction>
</AmountsPerSkills>
</li>
<li>
<Thing>Cloth</Thing>
<AmountsPerSkills>
<Plants>100</Plants>
<Construction>50</Construction>
</AmountsPerSkills>
</li>
</ResultOptions>
</li>
<li Class="KCSG.CustomGenOption">
<chooseFromlayouts>
<li>Outpost_Struct_Farming</li>
</chooseFromlayouts>
<fullClear>true</fullClear>
</li>
</modExtensions>
</WorldObjectDef>

</Defs>
BanDHMO 12 Jul, 2023 @ 7:22am 
About.xml
-----------------------


<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Vanilla Outposts Expanded: More Capital</name>
<author>BanDHMO</author>
<packageId>BanDHMO.VOEAdditionalOutpostsMoreCapital</packageId>
<supportedVersions>
<li>1.4</li>
</supportedVersions>
<description>Tier 2 outposts for Vanilla Outposts Expanded</description>
<modDependencies>
<li>
<packageId>OskarPotocki.VanillaFactionsExpanded.Core</packageId>
<displayName>Vanilla Expanded Framework</displayName>
<steamWorkshopUrl>https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1854607105</steamWorkshopUrl>
</li>
<li>
<packageId>vanillaexpanded.outposts</packageId>
<displayName>Vanilla Outposts Expanded</displayName>
<steamWorkshopUrl>https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1854607105</steamWorkshopUrl>
</li>
<li>
<packageId>MrHydralisk.VOEAdditionalOutposts</packageId>
<displayName>Additional Outposts</displayName>
<steamWorkshopUrl>https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2873841790</steamWorkshopUrl>
</li>
</modDependencies>
<loadAfter>
<li>Ludeon.RimWorld</li>
<li>Ludeon.RimWorld.Ideology</li>
<li>Ludeon.RimWorld.Biotech</li>
<li>brrainz.harmony</li>
<li>OskarPotocki.VanillaFactionsExpanded.Core</li>
<li>vanillaexpanded.outposts</li>
</loadAfter>
<incompatibleWith>
</incompatibleWith>
</ModMetaData>
BanDHMO 12 Jul, 2023 @ 7:23am 
Manifest.xml
--------------------


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>BanDHMO.VOEAdditionalOutpostsMoreCapital</identifier>
<version>1.0.0.0</version>
<dependencies>
<li>OskarPotocki.VanillaFactionsExpanded.Core</li>
<li>vanillaexpanded.outposts</li>
<li>MrHydralisk.VOEAdditionalOutposts</li>
</dependencies>
<suggests>
<li>MrHydralisk.VOEPowerGrid</li>
</suggests>
<showCrossPromotions>true</showCrossPromotions>
</Manifest>
[Zerg03] MrHydralisk  [developer] 14 Jul, 2023 @ 5:23pm 
Congrats on success
< >
Showing 1-4 of 4 comments
Per page: 1530 50