Biomes and Seasons


#1

Is anyone else trying to add seasons to their biomes? Are you having any luck? I added the color palettes and the seasons to my .json files and made new models for autumn spring and winter trees. Now the seasons change, the ground changes color, and the weather is correct, but the trees never change. (BTW speaking of Tropic of Unicorn biome). My small_willow_tree.json looks just like SH small_oak_tree.json but they are always the default .qb’s. Any ideas?


#2

You need to edit the tree json to tell the game which model to use in each season. It will not guess only based on your model files.

Here the acacia as an example:

      "model_variants": {
         "default": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_acacia_tree.qb)",
                     "file(small_acacia_tree_2.qb)"
                  ]
               }
            ]
         },
         "autumn": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_acacia_tree_autumn.qb)"
                  ]
               }
            ]
         },
         "spring": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_acacia_tree_spring.qb)",
                     "file(small_acacia_tree_spring_2.qb)"
                  ]
               }
            ]
         },
         "winter": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_acacia_tree_winter.qb)"
                  ]
               }
            ]
         }
      },
      "stonehearth:seasonal_model_switcher": {
         "stonehearth:biome:desert": {
            "spring": "spring",
            "summer": "default",
            "autumn": "autumn",
            "winter": "winter"
         }
      },

#3

Here is my small willow tree .json

{
   "mixins": [
      "stonehearth:mixins:tree",
      "stonehearth:mixins:align_to_grid"
   ],
   "type": "entity",
   "components": {
      "model_variants": {
         "default": {
            "models": [{
               "type": "one_of",
               "items": [
                  "file(small_willow_tree_01.qb)",
                  "file(small_willow_tree_02.qb)",
                  "file(small_willow_tree_03.qb)"
               ]
            }]
         },
         "autumn": {
            "models": [{
               "type": "one_of",
               "items": [
                  "file(small_willow_tree_autumn_01.qb)",
                  "file(small_willow_tree_autumn_02.qb)",
                  "file(small_willow_tree_autumn_03.qb)"
               ]
            }]
         },
         "spring": {
            "models": [{
               "type": "one_of",
               "items": [
                  "file(small_willow_tree_spring_01.qb)",
                  "file(small_willow_tree_spring_02.qb)",
                  "file(small_willow_tree_spring_03.qb)"
               ]
            }]
         },
         "winter": {
            "models": [{
               "type": "one_of",
               "items": [
                  "file(small_willow_tree_winter_01.qb)",
                  "file(small_willow_tree_winter_02.qb)"
               ]
            }]
         },
      "stonehearth:seasonal_model_switcher": {
         "stonehearth:biome:unicorn": {
            "spring": "spring",
            "summer": "default",
            "autumn": "autumn",
            "winter": "winter"
         }
      }
   },
   "stonehearth:resource_node": {
      "resource": "unicorn_biome:resources:wood:willow_log",
      "durability": 8
   },
   "mob": {
      "model_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "region_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "align_to_grid": [
         "x",
         "z"
      ]
   },
   "destination": {
      "region": [{
         "min": {
            "x": -1,
            "y": 0,
            "z": 0
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 4
         }
      }]
   },
   "region_collision_shape": {
      "region": [{
         "min": {
            "x": 1,
            "y": 0,
            "z": 1
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 2
         }
      }]
   }
},
   "entity_data": {
      "stonehearth:evolve_data": {
         "next_stage": "unicorn_biome:entities:trees:willow_tree:medium_willow_tree:medium_willow_tree.json",
         "evolve_time": "2d"
      },
      "stonehearth:catalog": {
         "display_name": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.display_name)",
         "description": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.description)"
      },
      "stonehearth:appeal": {
         "appeal": 2
      }
   }
}

Sorry I don’t know how to paste it so it looks like Sublime Text.
You see I have made models and set it up like the small oak or acacia. I’m sure it’s just a comma somewhere but I have spent hours trying to get it to work.

Thanks for replying, by the way!


#4

That stonehearth:biome:unicorn should be the URI of your biome in your mod, so something like unicorn_biome:biome:unicorn.


#5

I changed that and I’m still getting the default small_willow_01.qb


#6

So far I have:

  • Made madels for small willow for spring, autumn , and winter
  • Added models to small_willow_tree.json
  • Added seasonal weather patterns to unicorn.json
  • Added seasonal palettes to unicorn_generation_data.json

Is there anywhere else I need to edit?

I have NOT done this for the rest of the trees yet. Is that making the small willow not work? I didn’t want to change them all until I knew it would work.

All of that is in the Steam workshop version of my biome if anyone want to look at any other files.


#7

The stonehearth:seasonal_model_switcher block should be outside the model_variants block.


#8

So I have poured over this code for about 5 hours today. I somehow can not make the seasons work! I have changed both things that max99x suggested (thank you so much!!!)
Here is my code as it stands now. It always generates the summer options for trees no matter what season it is. Any help would be appreciated so much. I just want to make this available for everyone on the Steam workshop!

{
   "mixins": [
      "stonehearth:mixins:tree",
      "stonehearth:mixins:align_to_grid"
   ],
   "type": "entity",
   "components": {
      "model_variants": {
         "default": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_01.qb)",
                     "file(small_willow_tree_02.qb)",
                     "file(small_willow_tree_03.qb)"
                  ]
               }
            ]
         },
         "autumn": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_autumn_01.qb)",
                     "file(small_willow_tree_autumn_02.qb)",
                     "file(small_willow_tree_autumn_03.qb)"
                  ]
               }
            ]
         },
         "spring": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_spring_01.qb)",
                     "file(small_willow_tree_spring_02.qb)",
                     "file(small_willow_tree_spring_03.qb)"
                  ]
               }
            ]
         },
         "winter": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_winter_01.qb)",
                     "file(small_willow_tree_winter_02.qb)"
                  ]
               }
            ]
         }
      },
      "stonehearth:seasonal_model_switcher": {
         "unicorn_biome:biome:unicorn": {
            "spring": "spring",
            "summer": "default",
            "autumn": "autumn",
            "winter": "winter"
         }
      },
      "stonehearth:resource_node": {
      "resource": "unicorn_biome:resources:wood:willow_log",
      "durability": 8
      },
      "mob": {
      "model_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "region_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "align_to_grid": [
         "x",
         "z"
      ]
   },
   "destination": {
      "region": [{
         "min": {
            "x": -1,
            "y": 0,
            "z": 0
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 4
         }
      }]
   },
   "region_collision_shape": {
      "region": [{
         "min": {
            "x": 1,
            "y": 0,
            "z": 1
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 2
            }
         }
      ]
   }
   },
   "entity_data": {
      "stonehearth:evolve_data": {
         "next_stage": "unicorn_biome:entities:trees:willow_tree:medium_willow_tree:medium_willow_tree.json",
         "evolve_time": "2d"
      },
      "stonehearth:catalog": {
         "display_name": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.display_name)",
         "description": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.description)"
      },
      "stonehearth:appeal": {
         "appeal": 2
      }
   }
}

#9
"unicorn_biome:biome:unicorn": {
    "spring": "spring",
    "summer": "default",
    "autumn": "autumn",
    "winter": "winter"
}

And if you change the “default” season to something else, does it switch to that as you expect?


#10

Paul,
If I change that specific default to say “winter:default” and I dont change the model variant then no small willow trees appear. The same goes for changing “model variant” from “winter” to “default”. No small willow trees.

Now if I change both “winter:default” and the model variant from “winter” to “default” then small willow trees show up as the winter model no matter what season it is.

It seems as if the “stonehearth:seasonal_model_switcher”: will only point to the default season regardless of which season I choose.


#11

Can you post your manifest?


#12

Here you go:

{
	"info": {
		"name": "Tropic of Unicorn",
		"namespace": "unicorn_biome",
		"version": 3,
		"steam_file_id" : "1390587585"
	},
	"default_locale": "en",
	"aliases": {
	"biome:unicorn": "file(data/biome/unicorn.json)",

	 "resources:wood:maple_log": "file(entities/resources/wood/maple_log)",
	 "resources:wood:willow_log": "file(entities/resources/wood/willow_log)",

	"trees:palm:small": "file(entities/trees/palm_tree/small_palm_tree)",
	"trees:palm:medium": "file(entities/trees/palm_tree/medium_palm_tree)",
	"trees:palm:large": "file(entities/trees/palm_tree/large_palm_tree)",
	"trees:willow:small": "file(entities/trees/willow_tree/small_willow_tree)",
	"trees:willow:medium": "file(entities/trees/willow_tree/medium_willow_tree)",
	"trees:willow:large": "file(entities/trees/willow_tree/large_willow_tree)",
	"trees:maple:small": "file(entities/trees/maple_tree/small_maple_tree)",
	"trees:maple:medium": "file(entities/trees/maple_tree/medium_maple_tree)",
	"trees:maple:large": "file(entities/trees/maple_tree/large_maple_tree)"
	},
	"mixintos": {
		"stonehearth:biome:index" : "file(data/biome/index.json)"
	},
	"overrides": {},
	"components": {},
	"controllers": {}
}

#13

So I got it so the terrain colors change with the seasons, and the weather follows the seasonal patterns, but still no luck with the tree models changing.


#14

Back again!
So what am I missing?! I played through spring, summer, and autumn in one game. The weather and terrain changed with the seasons. As usual, my trees did not. HOWEVER!!.. I have my maple trees drop oak seeds so I can satisy the goblins demands, so I plant Stonehearth stock oak seeds and they grow into Stonehearth stock oak trees. These trees also do not change with the seasons, although all the .json’s and .qb’s and .png’s for oak trees are in the stonehearth folder! My guess is that I am missing a folder, lua file, or other .json somewhere in my mod.
I have altered and put in the code in my :

  • small_willow_tree.json
  • unicorn.json
  • unicorn_generation.json (only for terrain season palettes)

So again… What am I missing? I’ll attach all three files for your perusal!

small_willow_tree.json:

{
   "mixins": [
      "stonehearth:mixins:tree",
      "stonehearth:mixins:align_to_grid"
   ],
   "type": "entity",
   "components": {
      "model_variants": {
         "default": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_01.qb)",
                     "file(small_willow_tree_02.qb)",
                     "file(small_willow_tree_03.qb)"
                  ]
               }
            ]
         },
         "autumn": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_autumn_01.qb)",
                     "file(small_willow_tree_autumn_02.qb)",
                     "file(small_willow_tree_autumn_03.qb)"
                  ]
               }
            ]
         },
         "spring": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_spring_01.qb)",
                     "file(small_willow_tree_spring_02.qb)",
                     "file(small_willow_tree_spring_03.qb)"
                  ]
               }
            ]
         },
         "winter": {
            "models": [
               {
                  "type": "one_of",
                  "items": [
                     "file(small_willow_tree_winter_01.qb)",
                     "file(small_willow_tree_winter_02.qb)"
                  ]
               }
            ]
         }
      },
      "stonehearth:seasonal_model_switcher": {
         "unicorn_biome:data:biome:unicorn": {
            "spring": "spring",
            "summer": "default",
            "autumn": "autumn",
            "winter": "winter"
            }
         },
      "stonehearth:resource_node": {
      "resource": "unicorn_biome:resources:wood:willow_log",
      "durability": 8
      },
      "mob": {
      "model_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "region_origin": {
         "x": 0,
         "y": 0,
         "z": 0
      },
      "align_to_grid": [
         "x",
         "z"
      ]
   },
   "destination": {
      "region": [{
         "min": {
            "x": -1,
            "y": 0,
            "z": 0
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 4
         }
      }]
   },
   "region_collision_shape": {
      "region": [{
         "min": {
            "x": 1,
            "y": 0,
            "z": 1
         },
         "max": {
            "x": 2,
            "y": 4,
            "z": 2
            }
         }
      ]
   }
},
   "entity_data": {
      "stonehearth:evolve_data": {
         "next_stage": "unicorn_biome:entities:trees:willow_tree:medium_willow_tree:medium_willow_tree.json",
         "evolve_time": "2d"
      },
      "stonehearth:catalog": {
         "display_name": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.display_name)",
         "description": "i18n(unicorn_biome:entities.trees.willow_tree.small_willow_tree.description)"
      },
      "stonehearth:appeal": {
         "appeal": 2
         }
      }
   }

unicorn.json:

{
   "type": "biome",
   "alias": "unicorn_biome:biome:unicorn",
   "display_name": "i18n(unicorn_biome:data.biome.unicorn.display_name)",
   "description": "i18n(unicorn_biome:data.biome.unicorn.description)",
   "random_location_names": [
      "i18n(unicorn_biome:data.biome.unicorn.random_location_names.000)",
      "i18n(unicorn_biome:data.biome.unicorn.random_location_names.001)",
      "i18n(unicorn_biome:data.biome.unicorn.random_location_names.002)"
   ],
   "image": "file(images/unicorn_400x300.png)",
   "story_board_image": "file(images/temperate_story_board.png)",
   "game_mode_images": {
      "stonehearth:game_mode:normal": "file(images/temperate_story_normal.png)",
      "stonehearth:game_mode:hard": "file(images/temperate_story_normal.png)"
   },
   "generation_file": "file(unicorn_generation_data.json)",
   "default_starting_season": "summer",
   "seasons": {
      "spring": {
         "display_name": "i18n(stonehearth:data.biome.temperate.seasons.spring.display_name)",
         "description": "i18n(stonehearth:data.biome.temperate.seasons.spring.description)",
         "start_day": 0,
         "weather": [
            {
               "uri": "stonehearth:weather:sunny",
               "weight": 10
            },
            {
               "uri": "stonehearth:weather:cloudy",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:rain",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:rain:sunny",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:foggy",
               "weight": 3
            },
            {
               "uri": "stonehearth:weather:lucky",
               "weight": 2
            }
         ]
      },
      "summer": {
         "display_name": "i18n(stonehearth:data.biome.temperate.seasons.summer.display_name)",
         "description": "i18n(stonehearth:data.biome.temperate.seasons.summer.description)",
         "start_day": 21,
         "weather": [
            {
               "uri": "stonehearth:weather:sunny",
               "weight": 10
            },
            {
               "uri": "stonehearth:weather:windy",
               "weight": 6
            },
            {
               "uri": "stonehearth:weather:cloudy",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:rain",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:rain:sunny",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:lucky",
               "weight": 2
            }
         ]
      },
      "autumn": {
         "display_name": "i18n(stonehearth:data.biome.temperate.seasons.autumn.display_name)",
         "description": "i18n(stonehearth:data.biome.temperate.seasons.autumn.description)",
         "start_day": 42,
         "weather": [
            {
               "uri": "stonehearth:weather:sunny",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:cloudy",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:rain",
               "weight": 6
            },
            {
               "uri": "stonehearth:weather:rain:sunny",
               "weight": 6
            },
            {
               "uri": "stonehearth:weather:thunderstorm",
               "weight": 4
            },
            {
               "uri": "stonehearth:weather:foggy",
               "weight": 1
            },
            {
               "uri": "stonehearth:weather:lucky",
               "weight": 2
            }
         ]
      },
      "winter": {
         "display_name": "i18n(stonehearth:data.biome.temperate.seasons.winter.display_name)",
         "description": "i18n(stonehearth:data.biome.temperate.seasons.winter.description)",
         "start_day": 63,
         "weather": [
            {
               "uri": "stonehearth:weather:sunny",
               "weight": 2
            },
            {
               "uri": "stonehearth:weather:cloudy",
               "weight": 2
            },
            {
               "uri": "stonehearth:weather:windy",
               "weight": 2
            },
            {
               "uri": "stonehearth:weather:snow",
               "weight": 6
            },
            {
               "uri": "stonehearth:weather:snow:sunny",
               "weight": 6
            },
            {
               "uri": "stonehearth:weather:blizzard",
               "weight": 2
            },
            {
               "uri": "stonehearth:weather:lucky",
               "weight": 2
            }
         ]
      }
   }
}

#15

ok, so it won’t let me paste the whole generation_data.json because it is too long. The only thing altered in it is the addition of season color palettes which work.
PLEASE HELP!!!


#16

Just checking in! Has anyone had any luck adding seasons to your custom biomes?