RimWorld
Thanks For All The Fish
pyrce  [開発者] 2018年10月18日 21時38分
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>
< >
1-2 / 2 のコメントを表示
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.
最近の変更はTrunkenが行いました; 2019年5月28日 17時38分
pyrce  [開発者] 2019年5月28日 21時19分 
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
< >
1-2 / 2 のコメントを表示
ページ毎: 1530 50