Skip to content
Matthew Seal edited this page Jul 19, 2020 · 14 revisions

Rimworld Terrain Movement Kit

Version on Steam

A mod for other mods to add terrain specific movement options and restrictions

TMK

Description

This mod is for other mods to use, it has no direct benefit to players without writing additional rules for terrain / pawns based. In short the mod adds the ability to:

  • Set custom StatDefs to moving over certain Terrain faster/slower
  • Customize what terrain pawns can/can't enter
  • Allow gear to modify movement speed in certain Terrains
  • Customize pawn textures when using new movement stats
  • Several other minor movement controls effects from combining extension features

This toolkit is designed to add rules and statistics for managing movement on various terrain types to the game. It makes pawns respect new Speed baseStats for both moving through a type of terrain and for planning pathing through that terrain. It also allows you to specify new pathCost stats to pair with Speed stats in order for pawns with the stat to move at a different speed than pawns without the stat. And finally it adds rules such that pawns can be restricted to certain terrain, or not able to enter other terrain.

Compatibility Warning!

This mod has been testing with a number of other mods that might have conflicts and had no reported issues so far. However, there are some compatibility steps that haven't been taken yet so other mods which manipulate pathing may not work or may disable the terrain kit pathing patches. If you run into one of these please open an issue or report on the steam page.

What's an example of using this mod?

The SwimmingKit mod uses this mod to enable SwimSpeed to affect movement in water. It also add the aquatic tag in a mod extension to make pawns only able to traverse water tiles. This is being used in the Biomes! to support Sharks, Turtles, and other semi-aquatic or fully aquatic animals.

For modded tile types you could also add movement rules. Say you have a lava tile. You can add a Lava Monster who can only move on lava. Then add some special tech armor that lets your pawns walk on lava to go battle it.

How to Use

Check out this working example for how to use the mod. It details the various XML attributes needed to apply the kit. No C# is needed to get terrain specific functionality. Some advanced use-cases are captured in the extended use section.

How to Add to your Mod

The mod can be used as a mod dependency OR as a direct DLL in your mod assemblies by extracting TerrainMovementKit.dll (you only need the DLL). If you use the second option, be advised that you should add the following to your About.xml to help ensure multiple mods using the same kit will load the latest version.

<ModMetaData>
    ...
    <loadAfter>
      <li>pyrce.terrain.movement.modkit</li>
      <li>BiomesTeam.BiomesCore</li>
    </loadAfter>
    ...

If the mods above are not present it will still check for mod load orders of this library DLL and emit an error message (but still load) if it detects a later version lower in the user's mod list.

How it Works

If you're curious about internal details, this is how the change is achieved and what functions it primarily manipulates.

FAQ

The FAQ has answers to some common questions about the library.

Discord

The Biomes! Mod Channel is a good place to ask more in-depth questions, though issues on github are better for reporting bugs.

Clone this wiki locally