Skip to content

For modders: Making your mod compatible with MedPod

Robin Chang edited this page Jul 15, 2023 · 3 revisions

By default, MedPods automatically heal virtually all diseases, injuries and other hediffs considered to be "bad", while ignoring hediffs that give positive effects (such as drug highs).

However, due to the myriad of ways mod authors may (sometimes improperly) design their mods, MedPods may sometimes treat and/or ignore the wrong hediffs. While the MedPod mod is periodically updated with patches for popular third-party mods, it is preferable that mod authors ensure compatibility with MedPod on their end.

Contents

Hediffs

Ignoring a hediff

If your hediff is not a disease, injury or an otherwise "bad" condition, the simplest way to tell MedPods not to remove it from a pawn during treatment is to use RimWorld's built-in <isBad> tag and set it to false:

<HediffDef>
    <defName>NotABadHediff</defName>
    <label>Not a bad hediff</label>
    <description>This isn't a bad hediff, so the MedPod shouldn't remove it during treatment.</description>
    <isBad>false</isBad>

    etc...

</HediffDef>

If <isBad> is not specified, RimWorld will by default assume that your hediff has <isBad>true</isBad>, and thus flag it to be removed by MedPods.

However, if your hediff is supposed to be a "bad" health condition and you still want it to be untreatable, you will need to add the hediff to the MedPod's internal neverTreatableHediffs blacklist in your mod's compatibility patch:

<!-- Example: Prevent MedPod from treating Combat Extended's WearingGasMask hediff -->

<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/neverTreatableHediffs</xpath>
    <value>
        <li>WearingGasMask</li>
    </value>
</li>

Whitelisting a hediff as always treatable

Conversely, you may have an otherwise "good" hediff that you want the MedPod to always treat anyway. You can similarly add the hediff to the MedPod's internal alwaysTreatableHediffs blacklist in your mod's compatibility patch:

<!-- Example: Allow MedPod to treat Combat Extended's Tranquilizer hediff -->

<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/alwaysTreatableHediffs</xpath>
    <value>
        <li>Tranquilizer</li>
    </value>
</li>

Greylisting a hediff as treatable but non-critical

You may also have hediffs that should be treated only at a lower priority, so that your pawns don't immediately run to a MedPod unless they also have more urgent injuries - for example, alcohol and drug highs. These can be specified in the MedPod's internal nonCriticalTreatableHediffs in your mod's compatibility patch:

<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/nonCriticalTreatableHediffs</xpath>
    <value>
        <li>AlcoholHigh</li>
        <li>AlcoholTolerance</li>
    </value>
</li>

Blocking pawns with certain hediffs from using MedPods

If you have a hediff that should stop pawns from using MedPods at all, you can add the hediff to the MedPod's internal usageBlockingHediffs blacklist in your mod's compatibility patch:

<!-- Example: Prevent pawns from being rescued to MedPods if they are unconscious from Android Tier's Surrogate Remote Control hediff -->

<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/usageBlockingHediffs</xpath>
    <value>
        <li>ATPP_InRemoteControlMode</li>
    </value>
</li>

Traits

Whitelisting a trait as treatable

If you have a trait that the MedPod should remove from a pawn during treatment, you can add the trait to the MedPod's internal alwaysTreatableTraits whitelist in your mod's compatibility patch:

<!-- Example: Remove Lush and Stoner traits from Vanilla Traits Expanded once MedPod treatment is completed -->

<li Class="PatchOperationAdd">
	<xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/alwaysTreatableTraits</xpath>
	<value>
		<li>VTE_Lush</li>
		<li>VTE_Stoner</li>
	</value>
</li>

Blocking pawns with certain traits from using MedPods

On the other hand, if you have a trait that should prevent pawns from using MedPods altogether, you can add it to the MedPod's internal usageBlockingTraits blacklist in your mod's compatibility patch:

<!-- Prevent pawns from using or being rescued to MedPods if they have the Warcasket trait from Vanilla Factions Expanded - Pirates -->

<li Class="PatchOperationAdd">
	<xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/usageBlockingTraits</xpath>
	<value>
		<li>VFEP_WarcasketTrait</li>
	</value>
</li>

Races

Blacklisting a race

By default, the MedPod can treat all humanoid pawns, including aliens made using the Humanoid Alien Races framework.

However, if you have a race that should not use MedPods for technical (e.g. robots, droids, androids) or lore (e.g. an primitive tribal alien race that considers advanced technology to be abhorrent to their beliefs) reasons, you can add their race def to the MedPod's internal disallowedRaces blacklist in your mod's compatibility patch:

<!-- Example: Prevent MedPod from treating Androids from Androids Tiers -->
				
<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/disallowedRaces</xpath>
    <value>
        <li>Android1Tier</li>
        <li>Android2Tier</li>
        <li>Android3Tier</li>
        <li>Android4Tier</li>
        <li>Android5Tier</li>
    </value>
</li>

Pawns from blacklisted races will no longer automatically use MedPods when injured, nor can they be forced to use the MedPod using the right-click float menu.

Xenotypes (Biotech DLC only)

Blacklisting a xenotype

By default, the MedPod can treat all humanoid pawns of any xenotype from the Biotech DLC or third-party mods.

However, if you have a xenotype that should not use MedPods for technical (e.g. robots, droids, androids) reasons, you can add their xenotype def to the MedPod's internal disallowedXenotypes blacklist in your mod's compatibility patch:

<!-- Example: Prevent MedPod from treating androids from Vanilla Races Expanded - Androids -->
				
<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[@Name="MedPodBedBase"]/comps/li[@Class="MedPod.CompProperties_TreatmentRestrictions"]/disallowedXenotypes</xpath>
    <value>
        <li>VREA_AndroidAwakened</li>
	<li>VREA_AndroidBasic</li>
    </value>
</li>

Pawns with blacklisted xenotypes will no longer automatically use MedPods when injured, nor can they be forced to use the MedPod using the right-click float menu.

Clone this wiki locally