Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tools

Methods of the tools: optimizer, maps, startpos, animations, glTF export, MyMods and Lua tests.

tools.optimizer_options

Returns the optimizer options, as the server’s settings have them.

Params (GetOptimizerOptions)

Empty object: {}.

Result (OptimizerOptionValues)

NameTypeRequiredDescription
optionsmap of booleanyesIf each optimization is enabled, by name.

tools.optimize

Removes data of an open pack that’s identical to the vanilla one, or unneeded.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (OptimizePack)

NameTypeRequiredDescription
packstringyesKey of the pack.
optionsmap of booleanno, default {}Optimizations to enable or disable, by name. The rest keep the server’s settings. See tools.optimizer_options for the names.

Result (FilesChanged)

NameTypeRequiredDescription
addedarray of stringyesPaths of the added or edited files.
deletedarray of stringyesPaths of the deleted files.

tools.patch_siege_ai

Patches the siege maps of an open pack, so the AI can use them. Warhammer games only.

Params (PatchSiegeAi)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (SiegeAiPatched)

NameTypeRequiredDescription
messagestringyesDescription of what was patched.
deletedarray of stringyesPaths of the files deleted by the patch.

tools.pack_map

Adds the tiles and tile maps of a map exported by Terry to an open pack.

Params (PackMap)

NameTypeRequiredDescription
packstringyesKey of the pack.
tile_mapsarray of stringyesPaths on disk of the tile maps.
tilesarray of MapTileno, default []Tiles to add.

Result (FilesChanged)

NameTypeRequiredDescription
addedarray of stringyesPaths of the added or edited files.
deletedarray of stringyesPaths of the deleted files.

tools.generate_missing_locs

Adds empty loc entries for the localised columns of the tables of the open packs that have none.

Params (GenerateMissingLocs)

Empty object: {}.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

tools.update_anim_ids

Offsets the animation ids of an open pack, like after a game update moves them.

Params (UpdateAnimIds)

NameTypeRequiredDescription
packstringyesKey of the pack.
starting_idintegeryesOnly ids from this one are changed.
id_offsetintegeryesAmount to add to each id.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

tools.anims_by_skeleton

Returns the paths of the animations using a skeleton, in the open packs and the dependencies.

Params (AnimsBySkeleton)

NameTypeRequiredDescription
skeletonstringyesName of the skeleton.

Result (FilePaths)

NameTypeRequiredDescription
pathsarray of stringyesThe paths, sorted.

tools.export_gltf

Exports a RigidModel to a glTF file, with its textures.

Params (ExportGltf)

NameTypeRequiredDescription
fileFileRefyesThe RigidModel.
destinationstringyesPath of the glTF file to write.

Result (Done)

Empty object: {}.

tools.set_video_format

Changes the format of a ca_vp8 video of an open pack.

Params (SetVideoFormat)

NameTypeRequiredDescription
packstringyesKey of the pack.
pathstringyesPath of the video.
formatstringyesNew format: CaVp8 or Ivf.

Result (Done)

Empty object: {}.

tools.live_export

Exports the scripts and UI files of an open pack to the game’s data folder, to test them without saving the pack.

Params (LiveExport)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (Done)

Empty object: {}.

tools.init_mymod

Creates the folder of a new MyMod, with editor configs for Lua scripting.

Params (InitMyMod)

NameTypeRequiredDescription
game_folderstringyesFolder name of the game of the MyMod, like warhammer_3.
namestringyesName of the MyMod.
sublime_supportbooleanno, default falseIf a Sublime Text project is created.
vscode_supportbooleanno, default falseIf a VSCode config is created.
gitignorestring or nullnoIf set, a git repository is created with this .gitignore.

Result (MyModCreated)

NameTypeRequiredDescription
pack_pathstringyesPath of the pack of the MyMod. It doesn’t exist until it’s saved.

lua.run_tests

Runs Lua tests against the scripts of the game and the open packs, outside of the game.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (RunLuaTests)

NameTypeRequiredDescription
codestringyesCode of the Lua test file.
campaignstring or nullnoCampaign whose vanilla scripts to load, like main_warhammer. If not set, only the script libraries and the mods are loaded.

Result (LuaTestResults)

NameTypeRequiredDescription
reportanyyesThe report of the tests: passed and failed tests, with their errors and output.

startpos.campaigns

Returns the campaigns a startpos can be built for.

Params (GetStartposCampaigns)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.

Result (StartposCampaigns)

NameTypeRequiredDescription
campaignsarray of stringyesCampaign keys, sorted.
last_usedstring or nullyesCampaign the last startpos of the pack was built for, if any.

startpos.start

Prepares the Assembly Kit to build a startpos with the tables of an open pack, and launches the game to build it.

When the game is closed, call startpos.finish to import the startpos into the pack.

Params (StartStartpos)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.
campaignstringyesCampaign to build the startpos for.
process_hlp_spd_databooleanno, default falseIf the HLP and SPD data are built too.

Result (Done)

Empty object: {}.

startpos.finish

Imports the startpos built by the game into the pack, or cancels the build, and cleans up the build files.

Params (FinishStartpos)

NameTypeRequiredDescription
cancelbooleanno, default falseIf the build is cancelled instead of imported.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

startpos.validate

Checks the tables a campaign’s startpos is built from, and reports what would make the build fail, hang, or drop data. Works for both ways of building startposes.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (ValidateStartpos)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.
campaignstringyesCampaign to check.

Result (StartposValidation)

NameTypeRequiredDescription
issuesarray of StartposIssueyesThe problems, errors first.

startpos.generate

Generates the startpos of a campaign from the tables of an open pack and the game’s files, and adds it to the pack as campaigns/<campaign>/startpos.esf. Unlike startpos.start, it doesn’t launch the game.

The tables are validated first (see startpos.validate), and the startpos isn’t generated if they have errors.

Experimental, and only available for Attila. The record layouts come from the game’s own startpos of the campaign, or of a campaign on the same map for new ones, completed with a layout merged from all the game’s campaigns, and are cached in the config folder.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (GenerateStartpos)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.
campaignstringyesCampaign to generate the startpos for.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

startpos.extract_tables

Extracts the start_pos_* tables of a campaign from its startpos, the pack’s or the game’s if the pack has none, and adds them to the pack as db/<table>/<campaign>_startpos, with the victory objectives the startpos has as db/victory_objectives.txt (replacing the pack’s). The inverse of startpos.generate.

The startpos doesn’t keep everything: columns the build ignores keep their default value, values the build sums over a province go to one of its regions, row ids other than the factions’ and regions’ are numbered from 1, and loot and raze objectives lose their settlements.

Experimental, and only available for Attila. The record layouts are the ones of startpos.generate.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (ExtractStartposTables)

NameTypeRequiredDescription
packstringyesKey of the pack to add the tables to.
campaignstringyesCampaign whose startpos the tables are extracted from.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

startpos.compare_tables

Extracts the start_pos_* tables of a campaign from its startpos, like startpos.extract_tables, and compares them with the tables of the pack (and the game) the startpos is built from, to find what the build loses or changes. Rows are matched by what they describe, not by their ids.

Experimental, and only available for Attila.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (CompareStartposTables)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.
campaignstringyesCampaign whose startpos is compared.

Result (StartposComparison)

NameTypeRequiredDescription
tablesarray of StartposTableComparisonyesOne comparison per extracted table.

startpos.keep_campaign

Removes the rows of the pack’s start_pos_* tables that don’t belong to a campaign, as the Assembly Kit does before building a startpos, so tables holding several campaigns don’t break the build. Tables left without rows are deleted.

Rows of tables with a campaign column belong to their campaign; other rows belong to it if one of their references to a start_pos_* table points to one of its rows (the game’s and the pack’s rows count). Matches the Assembly Kit on Attila’s main campaign.

Params (KeepStartposCampaign)

NameTypeRequiredDescription
packstringyesKey of the pack with the startpos tables.
campaignstringyesCampaign whose rows are kept.

Result (FilesChanged)

NameTypeRequiredDescription
addedarray of stringyesPaths of the added or edited files.
deletedarray of stringyesPaths of the deleted files.

tools.plugin_scripts

Returns the plugin scripts in the scripts folder of the config.

Params (ListPluginScripts)

Empty object: {}.

Result (PluginScripts)

NameTypeRequiredDescription
scriptsarray of stringyesPaths of the scripts.

tools.run_plugin_script

Runs a plugin script over files of an open pack, reading back the files it changes.

Params (RunPluginScript)

NameTypeRequiredDescription
packstringyesKey of the pack.
scriptstringyesPath of the script.
pathsarray of stringyesPaths of the files and folders passed to the script.

Result (PluginScriptRun)

NameTypeRequiredDescription
editedarray of stringyesPaths of the files read back into the pack.
errorstring or nullyesError message of the script, if it failed.

lua.hovers

Returns the docs of the game’s Lua API for the symbols of a Lua script, to show on hover.

Params (GetLuaHovers)

NameTypeRequiredDescription
sourcestringyesSource of the script.

Result (LuaHovers)

NameTypeRequiredDescription
hoversarray of LuaHoveryesThe hovers.

ceo.traits

Returns the trait CEOs of the Assembly Kit tables.

Params (ListTraitCeos)

Empty object: {}.

Result (TraitCeos)

NameTypeRequiredDescription
traitsarray of [string, string]yesUUID and key of each trait CEO.

ceo.add_entries

Adds CEO entries (armour, career, traits and their locs) to an open pack.

Params (AddCeoEntries)

NameTypeRequiredDescription
packstringyesKey of the pack.
entriesarray of CeoEntryDatayesThe entries.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

ceo.build

Builds ceo_data.ccd in the Assembly Kit from the CEO tables of an open pack, running BOB.

Params (BuildCeo)

NameTypeRequiredDescription
packstringyesKey of the pack.
assembly_kitstringyesRoot folder of the Assembly Kit.
bobstringyesPath of BOB’s executable.

Result (Done)

Empty object: {}.

ceo.import

Imports the ceo_data.ccd built by ceo.build into an open pack.

Params (ImportCeo)

NameTypeRequiredDescription
packstringyesKey of the pack.
assembly_kitstringyesRoot folder of the Assembly Kit.

Result (FilesEdited)

NameTypeRequiredDescription
editedarray of stringyesPaths of the edited files.

Types

Type CeoEntryData

A CEO entry to add.

NameTypeRequiredDescription
namestringyesName of the entry, used to build the keys of its rows.
optionstringyesKind of entry: unique for unique ones.
elementstringyesElement of the entry.
genderstringyesGender of the entry.
traitsarray of [string, string]yesUUID and key of each trait of the entry.
expandedbooleanyesIf the entry also starts with a sword and shield.

Type FileRef

A file in one of the sources.

NameTypeRequiredDescription
sourceFileSourceyesWhere the file is.
pathstringyesPath of the file in its source.

Type FileSource

Where a file is.

One of:

  • { "pack": … }: An open pack, by key.
    • pack (string, yes)
  • "game_files": The vanilla files of the selected game.
  • "parent_files": The files of the parent packs of the open packs.
  • "assembly_kit": The tables of the selected game’s Assembly Kit. Their paths are db/<table_name>/ak_data.

Type LuaHover

Docs of a symbol of a Lua script. Lines and columns are 0-based.

NameTypeRequiredDescription
start_lineintegeryesLine where the symbol starts.
start_columnintegeryesColumn where the symbol starts.
end_lineintegeryesLine where the symbol ends.
end_columnintegeryesColumn where the symbol ends.
docsstringyesThe docs, as rich text.

Type MapTile

A tile of a map.

NameTypeRequiredDescription
pathstringyesPath on disk of the tile.
folderstringyesSubfolder of the pack’s terrain tiles folder to add it to.

Type StartposIssue

A problem in the tables a startpos is built from.

NameTypeRequiredDescription
levelDiagnosticLevelyeserror if the build fails or hangs, warning if it works but drops or ignores data.
tablestringyesTable, without the _tables suffix.
rowstringyesKey values of the row, joined by |, or its position (#n) if the table has no keys.
columnstring or nullyesColumn with the problem, if it’s about one.
messagestringyesWhat’s wrong.

Type DiagnosticLevel

Severity of a result.

One of:

  • "info": A suggestion, or information about the mod.
  • "warning": Something that may be a mistake, or cause problems in some situations.
  • "error": Something that will likely cause problems, like invalid references or malformed data.

Type StartposTableComparison

How the rows of one table extracted from a startpos compare with the original ones.

NameTypeRequiredDescription
tablestringyesTable, without the _tables suffix.
match_rationumberyesShare of the original values the startpos keeps, from 0 to 1.
matched_rowsintegeryesRows found in both.
missing_rowsarray of stringyesKeys of the original rows the startpos doesn’t keep.
extra_rowsarray of stringyesKeys of the extracted rows the original tables lack.
columnsarray of StartposColumnComparisonyesThe compared columns with different values.

Type StartposColumnComparison

How the values of one column of the matched rows compare.

NameTypeRequiredDescription
columnstringyesColumn name.
equalintegeryesMatched rows with the same value.
differentintegeryesMatched rows with a different value.
examplesarray of StartposValueDifferenceyesSome of the differences.

Type StartposValueDifference

A value the startpos keeps differently from its table.

NameTypeRequiredDescription
rowstringyesKey of the row.
originalstringyesValue in the original table.
extractedstringyesValue extracted from the startpos.