Hotloading mods

What is hotloading?

In the case of Stonehearth, it means activating something at run time, that is, after the game has already initialized everything.

When should I hotload mods?

Well, you might have created a custom kingdom or biome, and want only certain campaigns or other features to be enabled only when that kingdom / biome has been chosen. For instance, when we choose to play with the Rayya's children mod, we override some images so that the UI looks different, and when we choose to play in the Desert biome, we override some models of goblins and other animals, so that they look more desert-like.

In the past we called it "hotloading mods", but in the present it should actually be called "applying manifests", since we're not activating whole mods here.

iconHotloading manifests is only allowed before world generation completes -OR- for 'client_only' manifests from client Lua.

Not everything in applied manifests will work. It's a known issue that certain mixintos won't get applied correctly from a hotloaded manifest, because the game has already cached those values (e.g. adding new crops to the list of initial crops). In most cases you'll have to add those into your main manifest.

The applied/hotloaded manifests are usually inside some subfolder of our mod, and they have the

  "deferred_load": true

flag inside their "info" section.

How can I hotload mods?

In order to hotload the extra manifests we have two options: