Advanced Modding

In this section we'll explain advanced modding topics, for those who want to know how to mod parts of the game that involve more programming. We'll be covering Lua files for components, AI, etc. and also the UI files.

Table of Contents

  1. User settings and logging : how to link options declared in user_settings.json for using them in your mod and how to print to the stonehearth.log from your Lua files.
  2. Events : how to trigger and listen to events from Lua files.
  3. Lua scripts : what are saved variables and observers. Lifecycle functions of the Lua scripts.
    1. Components : how to create your own components and component renderers.
    2. Controllers : how to create your own controllers.
  4. AI actions : how AI works in Stonehearth and how to add your own AI actions to the game.
  5. Services : how to add your own services to the game.
  6. Call handlers : what are call handlers and how are they used.
  7. UI : how to create new UI views.
  8. C++ functions : list of C++ components and functions that we can call from Javascript and Lua.