RimWorld

RimWorld

Compressed Raid(Abandoned)
 This topic has been pinned, so it's probably important
ryouta#503PogoLegend  [developer] May 10, 2021 @ 8:34am
How to patch Compressed Raid (to "Add Drug Effects" feature)
* The content of this thread is aimed at mod developers. *
* This page has been created by DeepL machine translation. It may contain expressions that are difficult to understand or may not be accurate. *

Common Matters
Please use "miyamiya.compressedraid.latest" for "IfModActive" in "LoadFolders.xml".
You may be concerned about the possibility of the "latest" part being changed, but it will never change from "latest", and we have no plans to release any other version.

Simple Q & A
  • Q. What are the conditions for Compressed Raid to identify an item as a drug in the first place?
  • A. Compressed Raid identifies ThingDefs that satisfy all of the following conditions as drugs that should be handled and puts them on the lottery table.
    1. ThingDef/ingestible/drugCategory is not None.
    2. There are elements in ThingDef/ingestible/outcomeDoers for which Class="IngestionOutcomeDoer_GiveHediff" is set, and one or more of them satisfy the following conditions.
    3. The isBad of hediffDef is False, which has the effect of improving abilities directly related to combat.

  • Q. If I apply the exclusion patch, will the excluded drugs no longer appear in the game?
  • A. No, it just excludes them from the drug lottery table that Compressed Raid automatically grants to raiders.

  • Q. I don't know if I applied the patch successfully. Do you have a better idea other than calling the raid multiple times to debug it?
  • A. Yes. If the patch has been applied, it will be reflected in the line [Compressed Raid] Infomation:... in the debug log output when the game starts.

Drug exclude patch Creation Guidelines
A patch to exclude certain drugs added by your mod from the lottery table should be created in the following manner.
  • Use PatchOperationAdd.
  • Patch target: <xpath>*/CompressedRaid.ExcludeDrugDef[defName="CR_ExcludeDrug_Any"]/drugs</xpath>
  • Elements to add: <li>The defName of your mod's drug</li>

Drug negative effects forcible Patch Creation Guidelines
A patch that enforces drug negative effects when giving raiders a drug to be added by your mod should be created in the following manner.
  • Use PatchOperationAdd.
  • Patch target: <xpath>*/CompressedRaid.MustNegativeEffectDef[defName="CR_MustNegativeEffect_Any"]/drugs</xpath>
  • Elements to add: <li>The defName of your mod's drug</li>