边缘世界 RimWorld

边缘世界 RimWorld

Better Trees
 此主题已被置顶,因此可能具有重要性
Enrico  [开发者] 8 月 10 日 下午 8:42
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!
最后由 Enrico 编辑于; 8 月 30 日 上午 4:29