350 === {{{[Campaign%20<CAMPAIGN_NAME>]}}} === |
350 === {{{[Campaign%20<CAMPAIGN_NAME>]}}} === |
351 This section stores campaign variables which are stored and read by Lua scripts. Replace “`<CAMPAIGN_NAME>` with the folder name of the campaign. Example: The section for “A Classic Fairytale” would be “`[Campaign%20A_Classic_Fairytale]`”. |
351 This section stores campaign variables which are stored and read by Lua scripts. Replace “`<CAMPAIGN_NAME>` with the folder name of the campaign. Example: The section for “A Classic Fairytale” would be “`[Campaign%20A_Classic_Fairytale]`”. |
352 |
352 |
353 Campaign variables are stored on a key-value basis, where the key is the name of the campaign variable and the value is the value of the campaign variable. |
353 Campaign variables are stored on a key-value basis, where the key is the name of the campaign variable and the value is the value of the campaign variable. |
354 |
354 |
355 Campaign variable names and their values can are chosen by the Lua script authors, but there are some special variables which are used to determine which missions are available in the main menu: |
355 Campaign variable names and their values can are chosen by the Lua script authors, but there are some special variables which are used to determine which missions are available in the main menu, and since 0.9.23, also to determine which missions and campaigns have been completed. |
356 |
356 |
357 || *Setting* || *Type* || *Description* || |
357 For linear campaigns, the variables `Progress` and `Won` are used. |
358 || `Progress` || Integer || If present, this number of missions _additional to the first mission_ are unlocked in the menu, starting with the second mission and continuing with the following missions in their regular order (as specified in `campaign.ini`). If the number is `0`, only the first mission is available. || |
358 For non-linear campaigns, the variables `UnlockedMissions`, `MissionX`, `MissionXWon` and `Won` are used. |
359 || `UnlockedMissions` || Integer || An alternative way to store the unlocked missions in the main menu if the missions aren't unlocked in the regular order. This number specifies how many missions are unlocked. If this variable is set, then the variables `Mission1`, `Mission2`, etc. must be used to specfify the IDs of the unlocked missions. || |
359 The variables should not be mixed up. |
360 || `Mission1` || Integer || The `campaign.ini` ID of the first unlocked mission, must be used together with `UnlockedMissions` || |
360 |
361 || `Mission2` || Integer || ID of the second unlocked mission (continues with `Mission3`, `Mission4`, and so on) || |
361 Since Hedgewars 0.9.23, completed missions and campaigns get a check mark in the campaign screen. |
362 |
362 |
363 If neither `Progress` nor `UnlockedMissions` are present, only the first mission is unlocked. |
363 || *Setting* || *Type* || *Description* || |
|
364 || `Progress` || Integer || Since version 0.9.23, this variable stands for the number of completed missions in a campaign. For each completed mission, the next one gets unlocked. Previous versions have a slightly trickier definition: If present, this number of missions _additional to the first mission_ are unlocked in the menu, starting with the second mission and continuing with the following missions in their regular order (as specified in `campaign.ini`). If the number is `0`, only the first mission is available. || |
|
365 || `UnlockedMissions` || Integer || This number specifies how many missions are unlocked. If this variable is set, then the variables `Mission1`, `Mission2`, etc. must be used to specfify the IDs of the unlocked missions. || |
|
366 || `MissionX` || Integer || E.g. `Mission1`, `Mission2`, etc. Contains the `campaign.ini` ID of the `X`th unlocked mission, must be used together with `UnlockedMissions` || |
|
367 || `MissionXWon` || Boolean || Since 0.9.23. E.g. `Mission1Won`, `Mission2Won`, etc. If `true`, the mission with the number `X` in `campaign.ini` has been completed. || |
|
368 || `Won` || Boolean || Since 0.9.23. If `true`, the team has completed the campaign. Note that campaign victory is completely seperate from mission victory, so this setting must be set seperately. || |
|
369 |
|
370 By default, the first mission (Mission 1 in `campaign.ini`) is available. |
364 |
371 |
365 ==== Examples ==== |
372 ==== Examples ==== |
366 Simple campaign with 10 missions, missions 1-5 are available: |
373 Simple campaign with 10 missions, missions 1-5 are available and missions 1-4 count as completed: |
367 |
374 |
368 {{{ |
375 {{{ |
369 [Campaign%20Simple_Campaign] |
376 [Campaign%20Simple_Campaign] |
370 Progress=4 |
377 Progress=4 |
371 }}} |
378 }}} |
|
379 |
|
380 Simple 0.9.23 campaign with 6 missions. This campaign and all its missions have been unlocked and completed: |
|
381 |
|
382 {{{ |
|
383 [Campaign%20Simple_Campaign_2] |
|
384 Progress=6 |
|
385 Won=true |
|
386 }}} |
|
387 |
372 |
388 |
373 Complex campaign with 13 missions, missions 2, 7 and 3 are available (in that order): |
389 Complex campaign with 13 missions, missions 2, 7 and 3 are available (in that order): |
374 {{{ |
390 {{{ |
375 [Campaign%20Complex_Campaign] |
391 [Campaign%20Complex_Campaign] |
376 UnlockedMissions=3 |
392 UnlockedMissions=3 |