Extending Configs
This guide will explain how to use the API to add new features to New Horizons.
How Extending Works
Addon developers will add a key to the extras
object in the root of the config
Your mod will then use the APIs QueryBody
method to obtain the myCoolExtensionData
object.
It’s up to the addon dev to list your mod as a dependency!
Extending Planets
You can extend all planets by hooking into the OnBodyLoaded
event of the API:
In order to get your extra module, first define the module as a class:
Then, use the QueryBody
method:
Extending Systems
Extending systems is the exact same as extending planets, except you use the QuerySystem
method instead.
Accessing Other Values
You can also use the QueryBody
method to get values of the config outside your extension object