RimWorld

RimWorld

Thanks For All The Fish
pyrce  [vývojář] 18. říj. 2018 v 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>
< >
Zobrazeno 12 z 2 komentářů
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.
Naposledy upravil Trunken; 28. kvě. 2019 v 17.38
pyrce  [vývojář] 28. kvě. 2019 v 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
< >
Zobrazeno 12 z 2 komentářů
Na stránku: 1530 50