Modules
One of my goals for Beyond New Horizons is to make the game even more modding-friendly, both in terms of making modifications, but also in terms of sharing your modifications with the rest of the community. To achieve this, I’m introducing “Modules”.The game will soon come with a new modules folder (different from the old MODULES folder in Pirates of the Caribbean). This folder will have a core module, which will - in time - contain all the base game content. And yes, users will be able to create their own modules containing their own modifications and content. These modules can then easily be shared with others: drop them in the modules folder to install, delete them from the modules folder to uninstall.
How it works
The engine has been enhanced with full TOML (TOML: Tom's Obvious Minimal Language) support, able to read TOML config files directly from scripts. Most configuration will happen through TOML config files going forward.Every module will need to have a module.toml file in the root directory (ex.: /modules/<my_mod>/module.toml), containing all the basic information about the mod.
The core module config looks something like this:
Code:
name = "core"
version = [15, 0, 0]
enabled = true
description = "New Horizons core module. Contains required files for the base game to run."
authors = [
"PiratesAhoy!",
]
Configuration files
To make modding (and development) of the game easier, while at the same time reducing possible conflicts between mods, we are moving most of the game data and configuration out of the script files and into TOML files.
Code:
[storyline.free_play]
dir = "FreePlay"
[storyline.free_play.start]
location = "Tutorial_Deck"
port = "QC_port"
model = "47_JRMMSub"
first_name = "Julian"
last_name = "McAllister"
nation = "england"
player_type = "rebel"
difficulty = "seadog"
pirate_flag = 5
personal_flag = 30
ship = "BrigRoyal"
ship_name = "Defiance"
[storyline.free_play.start.date]
hour = 13
min = 20
sec = 33
day = 14
month = 5
year = 1682
[storyline.free_play.variables]
CHANGING_RELATIONS = 1
ISLA_DE_MUERTE = 0
Currently only the basic storyline information has been migrated to module configs, but over time more and more content will be converted.
Example mod
Let’s say you want to create a very simple mod that replaced the default starting ship for the free-play storyline. All you need to do is create a new mod, and override the storyline.free_play.ship value./modules/brigantine-start/module.toml:
Code:
name = "brigantine-start"
version = [1, 0, 0]
enabled = true
depends = ["core"]
description = "Example mod"
authors = ["PiratesAhoy!"]
/modules/brigantine-start/config/storyline/brigantine_start.toml:
Code:
storyline.free_play.ship = "Brigantina1"
That’s it! Launch the game, start a new free-play game, and see how the brigantine is now the default selected ship.
To share your newly created mod, just zip the brigantine-start folder and share it. Never been easier!