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

Packs

Methods about the open packs.

pack.info

Returns the details of an open pack.

Params (GetPackInfo)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (PackDetails)

NameTypeRequiredDescription
versionstringyesVersion of the pack format, like PFH5.
compressionstringyesCompression format of the files of the pack, like None or Lz4.
index_encryptedbooleanyesIf the index of the pack is encrypted.
data_encryptedbooleanyesIf the data of the pack is encrypted.
index_includes_timestampbooleanyesIf the index of the pack includes the timestamp of each file.
extended_headerbooleanyesIf the pack has the extended header of some Arena packs.
timestampintegeryesUnix time of the last time the pack was saved.
dependenciesarray of PackDependencyyesPacks this pack depends on, loaded as parent files.
operational_modeanyyesIf the pack is in normal mode ("Normal") or MyMod mode ({"MyMod": [game_folder, mod_name]}).
file_countintegeryesAmount of files in the pack.
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
pathstring or nullyesPath of the pack on disk, if it’s saved there.

pack.new

Creates a new empty pack. It has no path on disk until it’s saved with a path.

Params (NewPack)

NameTypeRequiredDescription
namestring or nullnoFile name of the pack, like my_mod.pack. Defaults to new_pack.pack, numbered if there’s already an open pack with that name.

Result (PackSummary)

NameTypeRequiredDescription
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pathstring or nullyesPath of the pack on disk, if it’s saved there.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
file_countintegeryesAmount of files in the pack.

pack.open

Opens one or more packs from disk, merged into a single one.

Params (OpenPack)

NameTypeRequiredDescription
pathsarray of stringyesPaths of the packs on disk. If there are more than one, the merged pack has no path, and is named after the first one.
lazy_loadingboolean or nullnoIf file data is read from disk only when needed. Defaults to the server’s setting.

Result (PackSummary)

NameTypeRequiredDescription
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pathstring or nullyesPath of the pack on disk, if it’s saved there.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
file_countintegeryesAmount of files in the pack.

pack.open_vanilla

Opens all the vanilla packs of the selected game, merged into a single one.

Params (OpenVanillaPacks)

Empty object: {}.

Result (PackSummary)

NameTypeRequiredDescription
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pathstring or nullyesPath of the pack on disk, if it’s saved there.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
file_countintegeryesAmount of files in the pack.

pack.close

Closes an open pack, discarding unsaved changes.

Params (ClosePack)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (Done)

Empty object: {}.

pack.close_all

Closes all open packs, discarding unsaved changes.

Params (CloseAllPacks)

Empty object: {}.

Result (Done)

Empty object: {}.

pack.save

Saves an open pack to disk.

Params (SavePack)

NameTypeRequiredDescription
packstringyesKey of the pack.
pathstring or nullnoAbsolute path to save the pack to, creating its missing folders. If not set, the pack is saved to its current path.
cleanbooleanno, default falseIf files that failed to decode are removed before saving. Use it if saving normally fails.
disable_uuid_regenerationboolean or nullnoIf tables keep their GUID instead of getting a new one. Defaults to the server’s setting.
allow_editing_ca_packsboolean or nullnoIf packs of the vanilla types (not Mod or Movie) can be saved. Defaults to the server’s setting.

Result (PackSummary)

NameTypeRequiredDescription
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pathstring or nullyesPath of the pack on disk, if it’s saved there.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
file_countintegeryesAmount of files in the pack.

pack.update

Changes properties of an open pack. Only the fields set are changed.

Params (UpdatePack)

NameTypeRequiredDescription
packstringyesKey of the pack.
pack_typestring or nullnoNew type of the pack: Boot, Release, Patch, Mod or Movie.
compressionstring or nullnoNew compression format of the pack, like None or Lz4. If the game doesn’t support it, a supported one is used.
index_encryptedboolean or nullnoIf the index of the pack is encrypted. Only PFH4 and newer packs support encryption.
data_encryptedboolean or nullnoIf the data of the pack is encrypted. Only PFH4 and newer packs support encryption.
index_includes_timestampboolean or nullnoIf the index of the pack includes the timestamp of each file.
dependenciesarray of PackDependency or nullnoNew list of packs this pack depends on.
operational_modeanynoNew mode of the pack: "Normal", or {"MyMod": [game_folder, mod_name]}.

Result (PackDetails)

NameTypeRequiredDescription
versionstringyesVersion of the pack format, like PFH5.
compressionstringyesCompression format of the files of the pack, like None or Lz4.
index_encryptedbooleanyesIf the index of the pack is encrypted.
data_encryptedbooleanyesIf the data of the pack is encrypted.
index_includes_timestampbooleanyesIf the index of the pack includes the timestamp of each file.
extended_headerbooleanyesIf the pack has the extended header of some Arena packs.
timestampintegeryesUnix time of the last time the pack was saved.
dependenciesarray of PackDependencyyesPacks this pack depends on, loaded as parent files.
operational_modeanyyesIf the pack is in normal mode ("Normal") or MyMod mode ({"MyMod": [game_folder, mod_name]}).
file_countintegeryesAmount of files in the pack.
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
pathstring or nullyesPath of the pack on disk, if it’s saved there.

pack.settings

Returns the settings of an open pack.

Params (GetPackSettings)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (PackSettingsValues)

NameTypeRequiredDescription
textmap of stringno, default {}Multi-line text settings.
stringmap of stringno, default {}Single-line text settings.
boolmap of booleanno, default {}Boolean settings.
numbermap of integerno, default {}Number settings.

pack.update_settings

Changes settings of an open pack. Only the keys set are changed.

Params (UpdatePackSettings)

NameTypeRequiredDescription
packstringyesKey of the pack.
settingsPackSettingsValuesyesSettings to set, in the format pack.settings returns them.

Result (PackSettingsValues)

NameTypeRequiredDescription
textmap of stringno, default {}Multi-line text settings.
stringmap of stringno, default {}Single-line text settings.
boolmap of booleanno, default {}Boolean settings.
numbermap of integerno, default {}Number settings.

Types

Type PackDependency

A pack another pack depends on.

NameTypeRequiredDescription
enabledbooleanyesIf the dependency is loaded.
namestringyesFile name of the pack.

Type PackSettingsValues

Settings of a pack, by type of value and key, like diagnostics_files_to_ignore or disable_autosaves.

NameTypeRequiredDescription
textmap of stringno, default {}Multi-line text settings.
stringmap of stringno, default {}Single-line text settings.
boolmap of booleanno, default {}Boolean settings.
numbermap of integerno, default {}Number settings.