RimWorld

RimWorld

Better Trees
 This topic has been pinned, so it's probably important
Enrico  [developer] 10 Aug @ 8:42pm
Modder’s Guide: Get Your Trees Listed in the Menu
For your mod’s trees to appear in the menu, they must pass the base game’s "isTree?" check.

This check is passed if a plant either:

- Drops wood, or
- Has <forceIsTree>true</forceIsTree> inside its <plant> definition.

Note that simply inheriting TreeBase doesn't pass the check. Most modded trees will automatically pass the requirement simply by dropping wood, but modded fruit trees often fail, because they drop fruit instead of wood.

When creating fruit trees, follow the example set forward by the vanilla Cocoa tree, which contains the forceIsTree tag to ensure it’s recognized as a tree.

I’ve patched several popular modded trees myself, but I hope future tree creators will handle this on their own.

You might ask me, “Why not just check if the plant’s parent is TreeBase to list it in the menu?” Because it’s prone to error. I've even seen popular mods like Vanilla Plants Expanded have small bushes with TreeBase as a parent, causing them to become giant once the global multiplier gets applied!
Last edited by Enrico; 30 Aug @ 4:29am