Campaigns.wiki
author Wuzzy <almikes@aol.com>
Wed, 30 Oct 2019 03:23:57 +0100
changeset 2070 0705b1d3ed65
child 2071 4580c5366698
permissions -rw-r--r--
Add campaigns page
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2070
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     1
#summary How to create campaigns
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     2
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     3
= Campaigns =
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     4
== Introduction ==
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     5
A campaign is a series of missions that tell a story. Campaigns are played in singleplayer mode only.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     6
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     7
== Campaign files ==
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     8
Campaigns are stored in `Data/Missions/Campaign/<CAMPAIGN NAME>`, with `<CAMPAIGN NAME>` being the campaign name.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
     9
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    10
In this directory, the following files are used:
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    11
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    12
 * `campaign.ini`: Campaign mission list
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    13
 * `*.lua`: A bunch of Lua scripts for the missions
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    14
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    15
=== `campaign.ini` ===
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    16
This is a file in the INI format. This lists the available missions.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    17
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    18
 * No section:
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    19
  * `MissionNum`: Number of missions
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    20
  * `ResetRetry`: Unused
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    21
 * `[Mission X]`: Configuration for mission `X`, where X is the mission number. Mission 1 is the first mission.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    22
  * `Name`: Human-readable mission name in English
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    23
  * `Script`: Name of Lua script file to load for this mission
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    24
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    25
=== The mission's Lua scripts ===
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    26
There's one Lua script per mission. They work like singleplayer missions, see [Missions].
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    27
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    28
=== Preview image ===
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    29
The preview image is displayed in the menu when you have selected the mission.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    30
It must be a PNG image of size 314px×260px.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    31
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    32
The file must be saved in `Data/Graphics/Campaigns/<CAMPAIGN NAME>`. The file name must follow this pattern:
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    33
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    34
`<mission script name>@2x.png`
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    35
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    36
Where `<mission script name>` is name of the mission script without the file name suffix.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    37
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    38
For example, the preview image for the mission script `mission1.lua` must have the name `mission@2x.png`.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    39
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    40
=== Localization ===
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    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.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    42
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    43
This is the syntax:
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    44
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    45
{{{
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    46
<campaign dir name>.name="<campaign name>"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    47
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    48
<campaign dir name>-<mission 1 script name>.name="<mission 1 name>"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    49
<campaign dir name>-<mission 1 script name>.desc="<mission 1 description>"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    50
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    51
<campaign dir name>-<mission 2 script name>.name="<mission 2 name>"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    52
<campaign dir name>-<mission 2 script name>.desc="<mission 2 description>"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    53
}}}
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    54
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    55
And so on.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    56
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    57
 * `<campaign dir name>` is the directory name of the campaign. Replace spaces with underscores here.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    58
 * `<campaign name>` is the human-readable campaign name.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    59
 * `<mission x script name>` is the file name of the script of mission _x_ without file name suffix
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    60
 * `<mission x name>` is the human-readable name of mission _x_
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    61
 * `<mission x description>` is the description of mission _x_
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    62
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    63
If something is, the campaign menu will derive the title from the directory/file names instead and shows no description.
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    64
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    65
For more information about translating Hedgewars, see [Translations].
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    66
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    67
==== Example ====
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    68
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    69
Excerpt from `campaigns_en.txt`:
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    70
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    71
{{{
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    72
A_Classic_Fairytale.name="A Classic Fairytale"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    73
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    74
A_Classic_Fairytale-first_blood.name="Mission 1: First Blood"
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    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."
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    76
}}}
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    77
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    78
== Campaign progress ==
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    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. 
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    80
0705b1d3ed65 Add campaigns page
Wuzzy <almikes@aol.com>
parents:
diff changeset
    81
Read [ConfigurationFiles] to learn how campaign variables work.