|
1 #summary How to create campaigns |
|
2 |
|
3 = Campaigns = |
|
4 == Introduction == |
|
5 A campaign is a series of missions that tell a story. Campaigns are played in singleplayer mode only. |
|
6 |
|
7 == Campaign files == |
|
8 Campaigns are stored in `Data/Missions/Campaign/<CAMPAIGN NAME>`, with `<CAMPAIGN NAME>` being the campaign name. |
|
9 |
|
10 In this directory, the following files are used: |
|
11 |
|
12 * `campaign.ini`: Campaign mission list |
|
13 * `*.lua`: A bunch of Lua scripts for the missions |
|
14 |
|
15 === `campaign.ini` === |
|
16 This is a file in the INI format. This lists the available missions. |
|
17 |
|
18 * No section: |
|
19 * `MissionNum`: Number of missions |
|
20 * `ResetRetry`: Unused |
|
21 * `[Mission X]`: Configuration for mission `X`, where X is the mission number. Mission 1 is the first mission. |
|
22 * `Name`: Human-readable mission name in English |
|
23 * `Script`: Name of Lua script file to load for this mission |
|
24 |
|
25 === The mission's Lua scripts === |
|
26 There's one Lua script per mission. They work like singleplayer missions, see [Missions]. |
|
27 |
|
28 === Preview image === |
|
29 The preview image is displayed in the menu when you have selected the mission. |
|
30 It must be a PNG image of size 314px×260px. |
|
31 |
|
32 The file must be saved in `Data/Graphics/Campaigns/<CAMPAIGN NAME>`. The file name must follow this pattern: |
|
33 |
|
34 `<mission script name>@2x.png` |
|
35 |
|
36 Where `<mission script name>` is name of the mission script without the file name suffix. |
|
37 |
|
38 For example, the preview image for the mission script `mission1.lua` must have the name `mission@2x.png`. |
|
39 |
|
40 === Localization === |
|
41 Campaign title, mission titles and mission descriptions menu must be edited in the missions files in `Data/Locale`. The file name is `campaigns_<language code>.txt`. There is one file per language. E.g. `campaigns_en.txt` for English. Note that these files are supposed to contain the titles and descriptions of *all* campaigns on your computer. This makes these files unsuitable for sharing or inclusion into [HWPFormat HWP files], for example. |
|
42 |
|
43 This is the syntax: |
|
44 |
|
45 {{{ |
|
46 <campaign dir name>.name="<campaign name>" |
|
47 |
|
48 <campaign dir name>-<mission 1 script name>.name="<mission 1 name>" |
|
49 <campaign dir name>-<mission 1 script name>.desc="<mission 1 description>" |
|
50 |
|
51 <campaign dir name>-<mission 2 script name>.name="<mission 2 name>" |
|
52 <campaign dir name>-<mission 2 script name>.desc="<mission 2 description>" |
|
53 }}} |
|
54 |
|
55 And so on. |
|
56 |
|
57 * `<campaign dir name>` is the directory name of the campaign. Replace spaces with underscores here. |
|
58 * `<campaign name>` is the human-readable campaign name. |
|
59 * `<mission x script name>` is the file name of the script of mission _x_ without file name suffix |
|
60 * `<mission x name>` is the human-readable name of mission _x_ |
|
61 * `<mission x description>` is the description of mission _x_ |
|
62 |
|
63 If something is, the campaign menu will derive the title from the directory/file names instead and shows no description. |
|
64 |
|
65 For more information about translating Hedgewars, see [Translations]. |
|
66 |
|
67 ==== Example ==== |
|
68 |
|
69 Excerpt from `campaigns_en.txt`: |
|
70 |
|
71 {{{ |
|
72 A_Classic_Fairytale.name="A Classic Fairytale" |
|
73 |
|
74 A_Classic_Fairytale-first_blood.name="Mission 1: First Blood" |
|
75 A_Classic_Fairytale-first_blood.desc="Help Leaks a Lot to complete his training and become a proper hedgehog warrior. You will be trained in the art of rope, parachute, shoryuken and desert eagle." |
|
76 }}} |
|
77 |
|
78 == Campaign progress == |
|
79 Initially, only mission 1 is unlocked. To unlock more missions and to mark missions and the campaign as completed, you must set campaign variables. |
|
80 |
|
81 Read [ConfigurationFiles] to learn how campaign variables work. |