write_campaign
Writes a Left 4 Dead 2 campaign file from a mission name and modes with numbered chapters, rejecting invalid structures and overwriting only when explicitly allowed.
Instructions
Writes a campaign file from a name and a list of modes with numbered chapters. Refuses to overwrite unless overwrite is set, and refuses a structurally invalid campaign (no name, an empty mode, a map given with a path or extension) rather than writing one the game will not read. The file is written through the same write guard as every other writer.
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": {
"name": "<name>",
"modes": "<modes>"
},
"name": "write_campaign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Destination .txt, absolute or relative to the repo root. | |
| name | Yes | The mission "Name", e.g. "L4D2C1". | |
| image | No | Campaign image, e.g. "maps/c1". | |
| modes | Yes | ||
| author | No | ||
| backup | No | Keep a .bak beside an overwritten mission. Off by default: a staging directory is packed as-is, and a backup there would ship inside the addon. | |
| dryRun | No | ||
| confirm | No | ||
| overwrite | No | ||
| description | No | ||
| displayTitle | No | Localisation token or plain title. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| bytes | Yes | ||
| modes | Yes | ||
| written | Yes | ||
| backupPath | Yes | ||
| chapterCount | Yes |