RimWorld
Thanks For All The Fish
pyrce  [pengembang] 18 Okt 2018 @ 9:38pm
How to Mod the Mod
Ok so here's a working example for how to add Shallow Water as a fishable location.

In your (not TFATF) mod add a "Patches/FishingPatch.xml" file. Then add these contents to the file:

<Patch> <Operation Class="PatchOperationSequence"> <success>Always</success> <operations> <li Class="PatchOperationTest"> <xpath>*/TerrainDef[defName = "WaterShallow"]/tags</xpath> <success>Invert</success> </li> <li Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterShallow"]</xpath> <value> <tags/> </value> </li> </operations> </Operation> <Operation Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterShallow"]/tags</xpath> <value> <li>Fishable</li> </value> </Operation> <Operation Class="PatchOperationSequence"> <success>Always</success> <operations> <li Class="PatchOperationTest"> <xpath>*/TerrainDef[defName = "WaterOceanShallow"]/tags</xpath> <success>Invert</success> </li> <li Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterOceanShallow"]</xpath> <value> <tags/> </value> </li> </operations> </Operation> <Operation Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterOceanShallow"]/tags</xpath> <value> <li>Fishable</li> </value> </Operation> <Operation Class="PatchOperationSequence"> <success>Always</success> <operations> <li Class="PatchOperationTest"> <xpath>*/TerrainDef[defName = "WaterMovingShallow"]/tags</xpath> <success>Invert</success> </li> <li Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterMovingShallow"]</xpath> <value> <tags/> </value> </li> </operations> </Operation> <Operation Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterMovingShallow"]/tags</xpath> <value> <li>Fishable</li> </value> </Operation> </Patch>

This adds the "Fishable" tag to each of the 3 types of shallow water.

The "PatchOperationSequence" section is required because some definitions inherit the tags section, so we need to explicitly add it to the xml if they don't make thier own tags. It effectively checks if there's a "tags" element and adds it if it's missing before we do the "PatchOperationAdd".

If you want to turn off fishing in one of the default terrain types. Add the tag "NonFishable" to the given water tile (you won't see the "Fishable" tag in the definition until a map is loaded for compatability reasons).

<Patch> <Operation Class="PatchOperationSequence"> <success>Always</success> <operations> <li Class="PatchOperationTest"> <xpath>*/TerrainDef[defName = "WaterMovingChestDeep"]/tags</xpath> <success>Invert</success> </li> <li Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterMovingChestDeep"]</xpath> <value> <tags/> </value> </li> </operations> </Operation> <Operation Class="PatchOperationAdd"> <xpath>*/TerrainDef[defName = "WaterMovingChestDeep"]/tags</xpath> <value> <li>NonFishable</li> </value> </Operation> </Patch>
< >
Menampilkan 1-2 dari 2 komentar
Trunken 26 Mei 2019 @ 9:08am 
Hello Pyrce,
is there a way to add different fish for me to use in my mod? i would really like to implement this for my food recipes and recipeusers.

Kind Regards

Edit: Using Fish Corpses, when your mod is found atm.
Terakhir diedit oleh Trunken; 28 Mei 2019 @ 5:38pm
pyrce  [pengembang] 28 Mei 2019 @ 9:19pm 
You'll want to replace the

See Overwriting defs section xpath example[rimworldwiki.com] to update the CatchFish recipe's products list.

I do something similar with a different operator in https://github.com/MSeal/RimworldThanksForTheFish/blob/master/Patches/RecipePatch.xml
< >
Menampilkan 1-2 dari 2 komentar
Per halaman: 1530 50