]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Creating-campaigns.md
Upload attachment SpectatorHUD.jpg
[xonotic/xonotic.wiki.git] / Creating-campaigns.md
1 ## Creating campaigns
2
3 This page explains how to create campaigns for Xonotic.
4
5 ## Basics
6
7 Xonotic uses text files to store campaigns.
8
9 Campaigns are text files with the name “`campaign<name>.txt`”, where `<name>` can be any alphanumeric identifier which is used to uniquely identify the campaign.
10
11 Example: `campaignxonoticbeta.txt`
12
13 ## File syntax
14
15 It's basically like CSV (Comma-Separated Values), but with comments.
16
17 The following lines are possible
18
19 * Campaign title: Must be always the first line and has the form `//campaign:<Name>`, where `<Name>` is the human-readable campaign title.
20 * Empty lines: Are ignored
21 * Comments: These lines start with `//` and are ignored (except the 1st line which is a special case)
22 * Level definitions: This is a comma-separated list. Each value must be delimeted by quotation marks (e.g. `"value"`). You can omit the quotation marks for empty values, *except* for the last item in the list
23
24 ### Level definition
25
26 A comma-separated list (see above). Each level is exactly one line. The meaning of the values in a line must follow this order:
27
28 * Game mode: The short codename for the game mode (e.g. `dm` for deathmatch, `kh` for Key Hunt, etc.)
29 * Technical map name (e.g. `boil`)
30 * Bots: Number of bots
31 * Skill: Bot skill level. Minimum 2, maximum 11.
32 * Fraglimit: Frag/score limit (meaning depends on game mode) or empty if none
33 * Time limit: Time limit in minutes or empty if infinite time
34 * Mutator sets: A list of mutators/[CVars](CVars) to activate in this level, separated by semicolons. Can be empty.
35 * Level title. Can be empty.
36 * Level description. Can be empty.
37
38 ## Minimal example
39
40 This is a minimal example campaign with 1 level:
41
42 `campaignminimal.txt`:
43
44 ```
45 //campaign:Minimal Example Campaign
46 "dm","boil","5","8","30",,"g_instagib 1; sv_gravity 200","InstaGib Fun on Boil","To win this level, you must insta-gib against 5 bots until you have 30 frags. Good luck!"
47 ```
48
49 The campaign's only level is a Deathmatch on Boil with 5 bots at skill level 8. Frag limit of 30. [InstaGib](InstaGib) mutator is active and [gravity](Gravity) is set to 25% (`sv_gravity` is 800 by default).
50
51 ## Where to put the campaign file?
52
53 * In the source code: `<YOUR_XONOTIC_SOURCE_DIRECTORY>/data/xonotic-maps.pk3dir/maps/`
54 * In your user directory: `<YOUR_HOME_DIRECTORY>/.xonotic/data/maps/`