How to remove Vanilla Trees

Started by rjord2018, January 22, 2018, 01:44:01 AM

Previous topic - Next topic

rjord2018

I am replacing the vanilla trees in Rimworld with new trees and am looking at how not to have vanilla trees appear when my mod is active.

Is there a way of doing this?



[attachment deleted by admin: too old]

wwWraith

#1
I think the best way would be to add your own biome(s) with only your plants (and probably other things) allowed.

But if you prefer a rough solution, you can patch <wildPlants> sections of vanilla biomes:



<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<Operation Class="PatchOperationReplace">
<xpath>/Defs/BiomeDef[defName = "TemperateForest"]/wildPlants</xpath>
<value>
<wildPlants>
<YourPlant1>0.5</YourPlant1>
<YourPlant2>0.4</YourPlant2>
<YourPlant3>0.8</YourPlant3>
</wildPlants>
</value>
</Operation>

<Operation Class="PatchOperationReplace">
<xpath>/Defs/BiomeDef[defName = "TropicalRainforest"]/wildPlants</xpath>
<value>
<wildPlants>
<YourPlant1>0.2</YourPlant1>
<YourPlant2>0.2</YourPlant2>
<YourPlant3>0.7</YourPlant3>
</wildPlants>
</value>
</Operation>

</Patch>


Though some other mods may add spawning tags in the plants defs rather than biomes, so you may have to get rid of them, too:


<Operation Class="PatchOperationRemove">
<xpath>/Defs/ThingDef[defName = "SomeModdedPlant1"]/allowedBiomes</xpath>
</Operation>
<Operation Class="PatchOperationRemove">
<xpath>/Defs/ThingDef[defName = "SomeModdedPlant1"]/spawnChance</xpath>
</Operation>

<Operation Class="PatchOperationRemove">
<xpath>/Defs/ThingDef[defName = "SomeModdedPlant2"]/allowedBiomes</xpath>
</Operation>
<Operation Class="PatchOperationRemove">
<xpath>/Defs/ThingDef[defName = "SomeModdedPlant2"]/spawnChance</xpath>
</Operation>


https://ludeon.com/forums/index.php?topic=32785 if you are interested in learning more about patching and xpathing.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

rjord2018

#2
Thanks for the reply... I had been looking at creating my own biome for the mod but have not yet found a tutorial on how to do it yet.

Am currently looking at biome def files in the MarsX mod as that mod is what I am trying to achieve