[1.0] Swimming Kit

Started by Pyrce, October 21, 2018, 08:45:52 PM

Previous topic - Next topic


[1.0] Swimming Kit

A RimWorld mod which adds swimming attribute for pawns to change speeds while in water tiles.

The mod acts as a toolkit for adding swimming statistics to the game. It makes pawns respect a new SwimSpeed baseStat for both moving through water and for planning pathing through water.

In working on another mod it took the better part of a long weekend to get all the various places that needed changing correct, so to save other modders time and to enable adding actual aquatic gear / pawns I put the changes together in this mod.

Change in Terrain

This mod makes Ocean and DeepWater tiles accessible. Normal pawns will move very very slow through ocean, but it is possible for pawns and items to now be in Ocean. If a pawn has SwimSpeed it will travel much quicker through ocean tiles.


How to Use

Adding the `SwimSpeed` to any `ThingDef`'s `statBases` will apply swim speed when in water tiles.

<ThingDef ParentName="AnimalThingBase" ADogSaidBody="Tail">
    <description>A tortoise that likes water</description>
        <!-- This makes turtle have a base speed of 4 in water -->

If you want to conditionally set a SwimSpeed only if this mod is present you can do the following:

// Dynamically set the SwimSpeed to avoid requiring SwimmingKit
StatDef swimDef = DefDatabase<StatDef>.GetNamed("SwimSpeed", false);
if (swimDef != null)
    ThingDef turtle = ThingDef.Named("Turtle");
    turtle.SetStatBaseValue(swimDef, 4.0f);

You can also effect SwimSpeed by modifying equipment.

<ThingDef ParentName="ArmorMachineableBase">
    <label>hydro plate armor</label>
    <description>Augmented power armor with built-in water-jets for fast traversal underwater.</description>

Code issues / questions also welcome on the SwimmingKit Github page.

License (MIT)

If you're a modder and want to use or extend this mod I ask only that you let me know (here or on steam). Otherwise feel free to use the mod in the making of further mods.


Icon Graphic Base
Powered by Harmony Patch Library


Alright! I've been looking for something like this. Will "drowning" and "water rescue" ever be added?


Wow this is very cool.

Quote from: 中村ジロ on November 15, 2018, 09:21:22 AM
Alright! I've been looking for something like this. Will "drowning" and "water rescue" ever be added?
i like this idea. Maybe a variation of space refugee, a castaway too?



can i swim in the ocean with this?
man we really need boats


if the authors of yes vehicles ever figure out how to add vehicles(waiting on jecrells tools to update last i heard), it may be possible to do the same for boats