pub fn save_campaign(
api: &LuaApi,
scripts: &LuaScripts,
options: &LuaTestOptions,
boot_events: &[&str],
) -> Result<LuaSave>Expand description
This function boots a campaign and saves it, like the game does when it builds the campaign’s startpos.
§Arguments
api- API of the game, whose docs type the engine objects.scripts- Scripts of the game and of the packs.options- Campaign to boot, and the keys of the game’s factions and regions.boot_events- Events triggered after loading the scripts, before saving.
§Returns
The saved values, and the errors raised by the scripts.
§Errors
Returns an error if the game’s scripts are missing or fail to load, or if the Lua runtime fails.