RimWorld

RimWorld

Not enough ratings
Rimworld Terra Project Mod: Stop Puddles from destroying your base
By Benz10wheel
Rimworld Terra Project Mod
This guide aim is to stop those pesky puddles, floods from destroying your base by mean of editing xml files.
   
Award
Favorite
Favorited
Unfavorite
Stop the puddles!
For any one who want to prevent those walls and structures from getting destroy by those pesky puddles you can use xml editing (in notepad++).

.
There are 2 important things you need to understand which are, Terrains and Structures.

1. Terrains includes all buildable floor, soil, mud, gravel, tilled soil, water tiles.
<affordances> field in Terrain.xml specify what type of thing that terrain(floor) can support.

2. Structure include things that are build on the terrain, Wall, fence, furniture, workbench and etc.
Each structure have <terrainAffordanceNeeded> field which define types of terrain its allowed to build on.

Terra Project introduce more structure tags which are the water proof version. (The default wall is patched by Terra Project to be <li>MediumAll</li> waterproof)
<li>LightAll</li> - Buildable on light terrain and waterproof
<li>MediumAll</li> - Buildable on medium terrain and waterproof
<li>HeavyAll</li> - Buildable on heavy terrain and waterproof

The reason structures from other mods are not waterproof because they use the default vanilla tag below.
<li>Light</li> - Buildable on light terrain not waterproof
<li>Medium</li> - Buildable on medium terrain not waterproof
<li>Heavy</li> - Buildable on heavy terrain not waterproof

In the other word Terra Project classified structures as waterproof and not waterproof version.

In Terra Project case, when water floods or puddles are formed it change that tile to shallow water terrain type. Which by default does not support many walls and furnitures (especially one added by other mods) this in turn make the' light rain' weather turn into your nightmare. The result in the game mechanic where structure takes continuos damage from being on the wrong terrain until it is destroyed.

To prevent thing from getting destroy by puddle you'll need The right structure on the right terrain.

1. Terrains

First we need to change the basic buildable floor to support new structure types so go to Terrain def folder usually at....
C:\Program Files(x86)\Steam\steamapps\common\RimWorld\Mods\Core\Defs\TerrainDefs

Edit the Terrain_Floors.xml add in 3 line in the <affordance> field, This will make most buildable vanilla floors able to support waterproof walls.
<li>LightAll</li>
<li>MediumAll</li>
<li>HeavyAll</li>

From....


<TerrainDef Name="FloorBase" Abstract="True">
<layerable>true</layerable>
<affordances>
<li>Light</li>
<li>Medium</li>
<li>Heavy</li>
</affordances>
<designationCategory>Floors</designationCategory>
<fertility>0</fertility>
<constructEffect>ConstructDirt</constructEffect>
<acceptTerrainSourceFilth>True</acceptTerrainSourceFilth>
<terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
</TerrainDef>

to something like this...


<TerrainDef Name="FloorBase" Abstract="True">
<layerable>true</layerable>
<affordances>
<li>Light</li>
<li>Medium</li>
<li>Heavy</li>
<li>LightAll</li>
<li>MediumAll</li>
<li>HeavyAll</li>
</affordances>
<designationCategory>Floors</designationCategory>
<fertility>0</fertility>
<constructEffect>ConstructDirt</constructEffect>
<acceptTerrainSourceFilth>True</acceptTerrainSourceFilth>
<terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
</TerrainDef>

Also if you use mod like Stuffed Floor or Extended Wood Working which add new types of floor you'll need to go into that mod folder and edit the Terrains.xml <affordances> field like above as well. usually mod authors would name the folder and xml file with 'Terrain' for easy recognition anyway. This will prevent those walls that are generated when you create new map or attacking an enemy base/outpost from getting slowly destroy (Since with out editing the new added floor will not support the waterproof version of the wall).

Next in the Terrain_Water.xml scroll down to shallow section and add the 3 lines to the....

.

<TerrainDef Abstract="True" Name="WaterShallowBase" ParentName="WaterBase">
<pathCost>30</pathCost>
<affordances>
<li>ShallowWater</li>
<li>Bridgeable</li>
<li>LightAll</li>
<li>MediumAll</li>
<li>HeavyAll</li>
</affordances>
</TerrainDef>


Unlike buildable floor that support both type of structures, this make it so shallow water only support the waterproof version of walls and structures. It will still damage furniture or structure without the above tag. You can also simply add <li>Light</li><li>Medium</li><li>Heavy</li> to make shallow water deal no damage to all other structures, presumably including one added from other mods. However this reduce the customizability since everything will be immune to shallow water. (You want those floor rugs to be damage by shallow water right? right??)

You can customize other terrain type by editing other terrain xml in Terra Project mod folder (TerrainDefs folder) though this require some logic/program understanding but its not that hard if you follow the example above.

2. Structures

Next if you use mod that add new type of walls, fences(eg. Gloomy furniture), embrasure and etc You must also change the field <terrainAffordanceNeeded> of those structures.

.
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
to
<terrainAffordanceNeeded>LightAll</terrainAffordanceNeeded>

So it become the waterproof version. Usually this is locate in the mod folder with file name like Building_###.xml or something similar.

Bridges

The way how bridge work in Terra Project is it increase that tile Elevation, once a tile elevation is lower than water surface level it is considered submerge. I think if the water level exceed certain level then the bridge will be destroy.

To make bridge from other mod have elevation value you will need to add the field below to the xml. (you can change the elevation gain in the bridgeHeight tag)

<modExtensions>
<li Class="Terra.ModExt_Terrain_Bridge">
<bridgeHeight>1.4</bridgeHeight>
</li>
</modExtensions>

You also need to add LightAll>HeavyAll tag so walls/structures can be build on the bridge.
<affordances>
<li>Light</li>
<li>Medium</li>
<li>Heavy</li>
<li>LightAll</li>
<li>MediumAll</li>
<li>HeavyAll</li>
</affordances>
you can simply remove Heavy and HeavyAll tag for lighter bridge that can not support heavy structures.

Finally make sure to change
<terrainAffordanceNeeded>BridgeableAny</terrainAffordanceNeeded>
from those mod bridges into...
<terrainAffordanceNeeded>Bridgeable</terrainAffordanceNeeded>

Below is an example for Concrete bridge from Road of the Rim mod.

.

Finally thanks for reading the guide and hope you will be able to customize what terrain should support what structures.
1 Comments
NotaBear 30 Jun, 2024 @ 9:06pm 
or just use a mod