Attach or detach a .pak add-on
dos2_addonAttach or detach a ready-made .pak mod as a campaign add-on, copying it into the Mods folder, reading its metadata, and backing up meta.lsf before changes.
Instructions
Attaches a ready-made mod from a .pak file to the campaign as an add-on, or detaches it with attach=false. On attach the file is copied into the game's Mods folder; UUID, name, version and folder are read from the meta.lsx inside the pak. Detaching leaves the .pak in Mods.
Writes meta.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
Players need the same .pak, as with any add-on. Fails if the file is missing or holds no single meta.lsx.
Returns the module name, author, UUID, the .pak path and the campaign's add-on list. To build a mod from a
source folder use dos2_mod_install.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"campaign": "<campaign>",
"pak": "<pak>"
},
"name": "dos2_addon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pak | Yes | Absolute path to the mod's .pak file. | |
| attach | No | true (default) attaches the mod; false removes it from the campaign's add-ons. | |
| campaign | Yes | The campaign to work on: its name, its folder name, its UUID, or a unique part of any of them. dos2_status lists the campaigns. | |
| allow_running | No | Keep false. Set true only after the user has confirmed that the running game sits in the main menu: a write into a campaign that is loaded in the game gets lost or damages it. |