Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BA Help API

Add pages to the Big Ambitions in-game Help window from your own mod.

The game builds its help tree from StreamingAssets/helpstructure.json — a file inside the install folder that Workshop mods cannot ship changes to — and exposes no modding hook for it. This library fills that gap. Your pages are merged into the help structure at runtime and re-applied whenever the game rebuilds it, so they behave like base-game pages: they appear in the sidebar, they are searchable, and other pages can link to them.

📖 Documentation · 📦 Steam Workshop · 💾 Releases


What it looks like

A mod that adds a Laundromat business type registers four lines and gets a page filed under the game's own Business Types category, in alphabetical position, cross-linked to its furniture:

HelpApi.RegisterPage("Laundromat", HelpCategories.BusinessTypes,
    slug: "businesstypes-laundromat",
    pageKeyPrefix: "laundromat:businesstype_laundromat");

Install

Players subscribe to the Workshop item; it is a dependency of any mod that uses it and does nothing on its own.

Mod developers:

  1. Subscribe to the Workshop item, or drop BAHelpApi.dll into %LocalAppData%Low/Hovgaard Games/Big Ambitions/ModsLocal/BAHelpApi/.
  2. Reference the BAHelpApi assembly from your mod's .asmdef:
{
  "name": "MyMod",
  "references": ["BAHelpApi"],
  "overrideReferences": true,
  "precompiledReferences": [ /* the usual game DLLs */ ]
}

That reference is the whole dependency declaration. Big Ambitions derives mod dependencies from assembly references, so the loader starts BAHelpApi first, refuses to load your mod if it failed, and checks the two agree on a major version.

Do not copy BAHelpApi.dll into your own Dependencies/ folder. Two copies load as two separate assemblies with separate registration lists, and one set of pages silently never appears.

Quickstart

using BigAmbitions.Modding.Help;

[ModEntryOnInitializationLoad]
public class MyMod : IModBigAmbitions
{
    private const string OwnerId = "MyMod";

    public Task OnLoadAsync(ModContext context)
    {
        HelpApi.RegisterPage(OwnerId, HelpCategories.Furniture,
            slug: "furniture-mymodwidget",
            pageKeyPrefix: "mymod:itemname_widget");

        return Task.CompletedTask;
    }

    public Task OnUnloadAsync()
    {
        HelpApi.UnregisterOwner(OwnerId);
        return Task.CompletedTask;
    }
}

Then add the text to your mod's Locales/en.json:

{
  "mymod:itemname_widget": "Widget",
  "help_mymod:itemname_widget_content": "**Widget** does something useful.\n\nSee also: [Laundromat](businesstypes-laundromat)"
}

A page carries no text of its own — it is addressed entirely by localisation keys, so it follows the player's language automatically. Reusing an item's existing name key as the prefix, as above, gives the page the item's localised name for free.

If a key is missing the library says so in the log rather than rendering a blank page:

[HelpApi] Page 'furniture-mymodwidget' from 'MyMod' is missing localisation for
'help_mymod:itemname_widget_content' (page body). Add the keys to your mod's Locales/*.json
or the page will render blank.

API at a glance

Member Purpose
RegisterPage(owner, category, slug, prefix, order) Add one page
RegisterPages(owner, category, pages, order) Add several to one category
UnregisterPage(owner, slug) / UnregisterOwner(owner) Remove pages
PageExists(slug) Does a slug resolve — base-game or modded
OpenPage(slug) Open the help window at a page
PagesApplied Event, raised after pages are merged in
IsSupported False if a game update broke the reflection
HelpCategories.* The 14 base-game category keys
HelpLinks.Page/Address/ContentKey Build correct Markdown links

Full reference: API documentation · Complete mod: worked example.

Stability

This reaches into private members of the game's help system by reflection, because there is no public hook. Every failure path is non-fatal by design:

  • If a game update renames what it depends on, IsSupported turns false, one warning is logged, and calling mods keep working without help pages.
  • Registering while unsupported is a no-op, not an exception.
  • Pages are re-applied automatically after a language change or scene reload.

If Hovgaard Games ever add a first-party help hook, this library should become a thin wrapper over it, and mods using it would not need to change.

Steam Workshop

The Workshop item is a library mod. It ships no content and adds nothing on its own — it exists so every mod that adds help pages shares one assembly.

Licence

MIT. See LICENSE.

Big Ambitions is a trademark of Hovgaard Games. This project is an unofficial community library and is not affiliated with or endorsed by Hovgaard Games.

About

Add pages to the Big Ambitions in-game Help window from your mod. A shared library for mod authors.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages