patching out vanilla biomes ?

Started by A terrible modder, October 21, 2019, 01:04:59 AM

Previous topic - Next topic

A terrible modder

i will keep this simple.
how do i stop the vanilla biomes from generating while letting my working custom mod biome generate ? i tried using patches but they don't seem to work (aka i have no clue how to use patches on biomes or even know if its possible)
roses are red.
violets are blue.
C# biome modding without tutorials is a nightmare.
and maybe xml surgeries to.


Probably currently pulling hair out over mod Project k186F and rimworld C# related shenanigans

Kirby23590

#1
Try reading this https://rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations

Well if i don't like a biome, i would do this for my code.


<Patch>

<Operation Class="PatchOperationRemove">
    <xpath>Defs/BiomeDef[defName="ColdBog"]</xpath>
</Operation>

<Operation Class="PatchOperationRemove">
    <xpath>Defs/BiomeDef[defName="Tundra"]</xpath>
</Operation>

</Patch>


This may or might remove they Cold Bog and the Tundra Biomes, And don't forget to check from the Core Def Folder! For the Biomes if you want keep or remove!

And PatchOperationRemove is one of the easy ones. Other may require more if you wanted to remove else that's harder...

One "happy family" in the rims...
Custom font made by Marnador.



A terrible modder

this patch operation does work and removes the selected biomes (forest, tundra and cold bog) however it seems i'm having a problem with cross reference spam... https://pastebin.com/Ew1N4ZVp
roses are red.
violets are blue.
C# biome modding without tutorials is a nightmare.
and maybe xml surgeries to.


Probably currently pulling hair out over mod Project k186F and rimworld C# related shenanigans

LWM

Search for ColdBog in all the xml files....it's located in a few other places.

A carefully crafted xpath can probably catch most of them at once (<xpath>*[li=ColdBog]</xpath> would probably work?  It'd be inefficient, but it'd probably work?), or you can just go through and get rid of them specifically.  But those are probably what's causing the errors.

For what it's worth, "/Defs/BiomeDef[etc]" is slightly faster than just "Defs/etc" - you can see the analysis I did in the xpath thread.

--LWM