How to implement new trees?

I’ve been trying to implement a new biome with some new trees. However, when I tried adding the custom trees, I got this error on the map screen:

release-843 (x64)[M]
...arth/services/server/world_generation/landscaper.lua:452: attempt to index local 'size_data' (a nil value)
stack traceback:
[C]: ?
...arth/services/server/world_generation/landscaper.lua:452: in function '_get_tree_size'
...arth/services/server/world_generation/landscaper.lua:430: in function 'mark_trees'
...server/world_generation/world_generation_service.lua:157: in function 'fn'
...onehearth/services/server/world_generation/timer.lua:13: in function 'measure'
...server/world_generation/world_generation_service.lua:140: in function 'set_blueprint'
...vices/server/game_creation/game_creation_service.lua:157: in function 'create_new_world'
...vices/server/game_creation/game_creation_service.lua:178: in function 

Here’s my .smod file for reference:
ems_biome_rckymtns.smod (40.7 KB)

I’m pretty new to modding, so I’m probably missing something obvious, but the error isn’t really helpful except that it seems to be pointing to tree size. As far as I can tell, my tree sizes section in the biome generation is fine, though…

Also, I have put my file through JSONLint, and it came out without any errors, so it’s not that.

You are saying that the fir tree should spawn at the foothills step/elevation 3, but you set your foothill to only have 2 steps. So the game is trying to spawn trees in an non-existent elevation. Either remove the tree spawning at that elevation, or add more steps to foothills.


Oh, so that’s what that setting means. I couldn’t really figure out what that was for (thought it was just the frequency of each size or something).

Anyway, that worked. Thanks!

EDIT: I did also find another culprit: I had used an underscore instead of a colon somewhere…