Difference between revisions of "ScenarioWML"
m (→Test scenario: + links to forum) |
(rewriting + examples) |
||
Line 1: | Line 1: | ||
{{WML Tags}} | {{WML Tags}} | ||
− | |||
− | + | During a scenario, units of a few sides fight against each other on the map for the limited number of turns. | |
− | The | + | In addition to standard game rules, there are scenario-specific events. |
+ | The side which succeeds to fulfill scenario objectives wins; this is end of scenario, and possibly switching to another scenario. | ||
− | + | Though technically there are 4 types of scenarios -- multiplayer scenarios, campaign scenarios, tutorial scenarios, and test scenarios -- the diferences between them are very small. The tutorial is just another campaign, except that is does not appear in a campaign menu, but it started with a button on main screen (and it does not have difficulties; though difficulties are optional also for campaigns). Multiplayer scenarios have special settings in game menu; they allow many human-controlled players, and disallow recall. (It is not currently possible to make a multiplayer campaign, but this may change in future versions.) | |
− | |||
− | |||
− | + | The [scenario] / [multiplayer] / [tutorial] / [test] tag contains information about: | |
− | + | * scenario order in storyline | |
− | + | * map | |
+ | * fighting sides | ||
+ | * events | ||
− | + | == The [multiplayer], [scenario], [tutorial] and [test] tags == | |
− | + | Top-level tags; appear directly in [game]. | |
− | + | Attributes marked [M] are valid only for the [multiplayer] tags. | |
− | + | General attributes: | |
− | * | + | * ''id'' -- unique identifier of scenario |
+ | * ''next_scenario'' -- the default following scenario | ||
+ | * ''name'' -- (translatable) name of scenario; used in intro screen, save file names, etc | ||
+ | * ''description'' -- [M] (translatable) description of scenario, a tooltip in the multiplayer setup screen | ||
+ | * ''turns'' sets an event on turn ''turns'' causing the player to lose. See also [[EventWML]] | ||
+ | * ''turn_at'' the turn to start on (default=1) | ||
− | + | * ''theme'' the UI theme that should be used when playing this scenario. See [[Using_custom_themes_in_campaigns]] | |
− | + | * ''music'' the music file relative to ''./music/'' to play during the scenario | |
− | * '' | + | * '''[music]''' {{DevFeature}} specifies the music tracks to play during this scenario, see [[MusicListWML]]. This was introduced after 1.1, obsoleting the old ''music'' key, which specifies the music to play relative to the '"music/'". |
− | |||
− | |||
− | |||
− | |||
− | + | Map subtag and attributes: | |
* ''map_data'' inputs valid Wesnoth map data. See [[BuildingMaps]] for a description of the Wesnoth map syntax. | * ''map_data'' inputs valid Wesnoth map data. See [[BuildingMaps]] for a description of the Wesnoth map syntax. | ||
− | * '' | + | * '''[label]''' sets a label |
+ | ** ''x'', ''y'' location to set label | ||
+ | ** ''text'' the label | ||
− | * '' | + | * ''map_generation'' another way to generate a map. The map will be generated randomly |
+ | ** "default" the default random map generator | ||
+ | * '''[generator]''' if this is present, the map and scenario will be generated randomly. See [[MapGeneratorWML]] | ||
− | + | Intro subtag: | |
− | * '''[ | + | * '''[story]''' describes the intro screen. See [[IntroWML]] |
− | + | Rule attributes: | |
− | |||
− | |||
* ''victory_when_enemies_defeated'' when this is set to 'yes'(default), the player wins once all non-allied units with '''canrecruit=1''' (aka leaders) are killed. (Currently this only controls the win condition for when all enemies are defeated; it does not prevent the player from losing if he has no leader.) | * ''victory_when_enemies_defeated'' when this is set to 'yes'(default), the player wins once all non-allied units with '''canrecruit=1''' (aka leaders) are killed. (Currently this only controls the win condition for when all enemies are defeated; it does not prevent the player from losing if he has no leader.) | ||
Line 55: | Line 58: | ||
* ''experience_modifier'' the percentage that required XP to level up (for all units in the scenario) is multiplied by. Default 100. Note that when used in a campaign, weird things (like units being above the required XP to level up) can happen if this value is different for different scenarios. | * ''experience_modifier'' the percentage that required XP to level up (for all units in the scenario) is multiplied by. Default 100. Note that when used in a campaign, weird things (like units being above the required XP to level up) can happen if this value is different for different scenarios. | ||
− | * '''[ | + | Side subtag: |
+ | |||
+ | * '''[side]''' describes one player. See [[SideWML]] | ||
− | + | Time-of-day subtags: | |
− | |||
− | |||
* '''[time]''', '''[illuminated_time]''' how a day should progress. See [[TimeWML]] | * '''[time]''', '''[illuminated_time]''' how a day should progress. See [[TimeWML]] | ||
− | |||
* '''[time_area]''' how a day should progress in a given area. Everywhere not specified in a [time_area] tag is affected by the [time] and [illuminated_time] tags in the [scenario] tag | * '''[time_area]''' how a day should progress in a given area. Everywhere not specified in a [time_area] tag is affected by the [time] and [illuminated_time] tags in the [scenario] tag | ||
** standard location filter | ** standard location filter | ||
** '''[time]''', '''[illuminated_time]''' how a day should progress in those locations. See [[TimeWML]] | ** '''[time]''', '''[illuminated_time]''' how a day should progress in those locations. See [[TimeWML]] | ||
− | + | Event subtag: | |
+ | * ''objectives'' (translatable) the text displayed in the Scenario Objectives box in-game. Now obsolete; see '''[objectives]''', [[InterfaceActionsWML]]. | ||
* '''[event]''' describes an event that may be triggered at a certain point of the scenario. See [[EventWML]] | * '''[event]''' describes an event that may be triggered at a certain point of the scenario. See [[EventWML]] | ||
− | + | === Ordering scenarios in campaign === | |
− | ** " | + | |
+ | The most simple solution is to build a linear sequence of scenarios; it has also the advantage of easier storytelling, and gradually increasing game difficulty. | ||
+ | But using events, the scenarios can "hyperlink" each other freely. | ||
+ | Author can split the story (based on player's decision or action); later join it again or provide different endings; make an optional "bonus" scenario; etc. | ||
+ | |||
+ | The scenarios may only link to scenarios of the same tag type, that is: multiplayer scenario to another multiplayer scenario, campaign scenario to another campaign scenario, tutorial scenario to another tutorial scenario, and test scenario to another test scenario. | ||
+ | |||
+ | The ''id'' attribute is the scenario identifier. | ||
+ | The ''next_scenario'' attribute is the identifier of the following scenario. | ||
+ | It can be overridden by a "next_scenario" attribute of an [endlevel] action (see [[DirectActionsWML]]). | ||
+ | |||
+ | * The first multiplayer scenario is the one selected from the game menu. | ||
+ | * The first campaign scenario is determined by a "first_scenario" attribute in [campaign] tag. | ||
+ | * The first tutorial scenario is the one with ''id=tutorial''. | ||
+ | * The first test scenario is the one with ''id=test''. | ||
+ | |||
+ | For example if the campaign contains the following attribute: | ||
+ | |||
+ | [campaign] | ||
+ | |||
+ | #... | ||
+ | |||
+ | first_scenario=My_first_scenario | ||
+ | |||
+ | #... | ||
+ | |||
+ | [/campaign] | ||
− | + | Then the first scenario would look like this: | |
− | == | + | [scenario] |
+ | |||
+ | id=My_first_scenario | ||
+ | next_scenario=My_second_scenario | ||
+ | |||
+ | #... | ||
+ | |||
+ | [/scenario] | ||
− | + | The last scenario has value ''next_scenario=null'': | |
− | The | ||
− | |||
− | + | [scenario] | |
+ | |||
+ | id=My_last_scenario | ||
+ | next_scenario=null | ||
+ | |||
+ | #... | ||
+ | |||
+ | [/scenario] | ||
− | + | The event that moves player to a bonus scenario, would look like this: | |
− | + | [scenario] | |
+ | |||
+ | #... | ||
+ | |||
+ | [event] | ||
+ | |||
+ | #... | ||
+ | |||
+ | [endlevel] | ||
+ | result=victory | ||
+ | next_scenario=My_bonus_scenario | ||
+ | [/endlevel] | ||
+ | |||
+ | [/event] | ||
+ | |||
+ | [/scenario] | ||
− | + | Units that survive the scenario are added to the recall list. | |
+ | The first scenario has an empty recall list. | ||
− | + | === Using test scenarios === | |
− | * | + | Test scenario can be started directly from the system command line. |
− | * | + | The game menu and campaign menu are skipped; this saves a few seconds of time at each start; which can save a lot of time when frequently editing. |
− | * | + | So you may want to temporarily turn your campaign scenario to a test scenario: |
+ | * replace the "[scenario]" tag with "[test]" tag; | ||
+ | * change "id" attribute to "id=test"; | ||
+ | * move it to "$userdata/campaigns" directory. | ||
Note: | Note: | ||
Line 100: | Line 160: | ||
You have to overwrite or delete this default test scenario (because there cannot be two test scenarios with the same "id".) | You have to overwrite or delete this default test scenario (because there cannot be two test scenarios with the same "id".) | ||
− | + | To start the test scenario, on MS Windows, make a "bat" file containing the following commands: | |
− | |||
− | |||
cd %ProgramFiles%\Wesnoth | cd %ProgramFiles%\Wesnoth | ||
wesnoth.exe --test --windowed | wesnoth.exe --test --windowed | ||
+ | |||
+ | When playing test scenario it is not possible to recall units; so balancing scenario difficulty may not be accurate. | ||
+ | |||
+ | Related forum threads: [http://www.wesnoth.org/forum/viewtopic.php?t=9146 9146], [http://www.wesnoth.org/forum/viewtopic.php?t=9839 9839]. | ||
+ | |||
== See Also == | == See Also == |
Revision as of 14:24, 22 March 2006
During a scenario, units of a few sides fight against each other on the map for the limited number of turns. In addition to standard game rules, there are scenario-specific events. The side which succeeds to fulfill scenario objectives wins; this is end of scenario, and possibly switching to another scenario.
Though technically there are 4 types of scenarios -- multiplayer scenarios, campaign scenarios, tutorial scenarios, and test scenarios -- the diferences between them are very small. The tutorial is just another campaign, except that is does not appear in a campaign menu, but it started with a button on main screen (and it does not have difficulties; though difficulties are optional also for campaigns). Multiplayer scenarios have special settings in game menu; they allow many human-controlled players, and disallow recall. (It is not currently possible to make a multiplayer campaign, but this may change in future versions.)
The [scenario] / [multiplayer] / [tutorial] / [test] tag contains information about:
- scenario order in storyline
- map
- fighting sides
- events
Contents
The [multiplayer], [scenario], [tutorial] and [test] tags
Top-level tags; appear directly in [game].
Attributes marked [M] are valid only for the [multiplayer] tags.
General attributes:
- id -- unique identifier of scenario
- next_scenario -- the default following scenario
- name -- (translatable) name of scenario; used in intro screen, save file names, etc
- description -- [M] (translatable) description of scenario, a tooltip in the multiplayer setup screen
- turns sets an event on turn turns causing the player to lose. See also EventWML
- turn_at the turn to start on (default=1)
- theme the UI theme that should be used when playing this scenario. See Using_custom_themes_in_campaigns
- music the music file relative to ./music/ to play during the scenario
- [music] Template:DevFeature specifies the music tracks to play during this scenario, see MusicListWML. This was introduced after 1.1, obsoleting the old music key, which specifies the music to play relative to the '"music/'".
Map subtag and attributes:
- map_data inputs valid Wesnoth map data. See BuildingMaps for a description of the Wesnoth map syntax.
- [label] sets a label
- x, y location to set label
- text the label
- map_generation another way to generate a map. The map will be generated randomly
- "default" the default random map generator
- [generator] if this is present, the map and scenario will be generated randomly. See MapGeneratorWML
Intro subtag:
- [story] describes the intro screen. See IntroWML
Rule attributes:
- victory_when_enemies_defeated when this is set to 'yes'(default), the player wins once all non-allied units with canrecruit=1 (aka leaders) are killed. (Currently this only controls the win condition for when all enemies are defeated; it does not prevent the player from losing if he has no leader.)
- disallow_recall when this is set to 'no'(default), the player is allowed to recall units from previous scenarios.
- experience_modifier the percentage that required XP to level up (for all units in the scenario) is multiplied by. Default 100. Note that when used in a campaign, weird things (like units being above the required XP to level up) can happen if this value is different for different scenarios.
Side subtag:
- [side] describes one player. See SideWML
Time-of-day subtags:
- [time], [illuminated_time] how a day should progress. See TimeWML
- [time_area] how a day should progress in a given area. Everywhere not specified in a [time_area] tag is affected by the [time] and [illuminated_time] tags in the [scenario] tag
- standard location filter
- [time], [illuminated_time] how a day should progress in those locations. See TimeWML
Event subtag:
- objectives (translatable) the text displayed in the Scenario Objectives box in-game. Now obsolete; see [objectives], InterfaceActionsWML.
- [event] describes an event that may be triggered at a certain point of the scenario. See EventWML
Ordering scenarios in campaign
The most simple solution is to build a linear sequence of scenarios; it has also the advantage of easier storytelling, and gradually increasing game difficulty. But using events, the scenarios can "hyperlink" each other freely. Author can split the story (based on player's decision or action); later join it again or provide different endings; make an optional "bonus" scenario; etc.
The scenarios may only link to scenarios of the same tag type, that is: multiplayer scenario to another multiplayer scenario, campaign scenario to another campaign scenario, tutorial scenario to another tutorial scenario, and test scenario to another test scenario.
The id attribute is the scenario identifier. The next_scenario attribute is the identifier of the following scenario. It can be overridden by a "next_scenario" attribute of an [endlevel] action (see DirectActionsWML).
- The first multiplayer scenario is the one selected from the game menu.
- The first campaign scenario is determined by a "first_scenario" attribute in [campaign] tag.
- The first tutorial scenario is the one with id=tutorial.
- The first test scenario is the one with id=test.
For example if the campaign contains the following attribute:
[campaign] #... first_scenario=My_first_scenario #... [/campaign]
Then the first scenario would look like this:
[scenario] id=My_first_scenario next_scenario=My_second_scenario #... [/scenario]
The last scenario has value next_scenario=null:
[scenario] id=My_last_scenario next_scenario=null #... [/scenario]
The event that moves player to a bonus scenario, would look like this:
[scenario] #... [event] #... [endlevel] result=victory next_scenario=My_bonus_scenario [/endlevel] [/event] [/scenario]
Units that survive the scenario are added to the recall list. The first scenario has an empty recall list.
Using test scenarios
Test scenario can be started directly from the system command line. The game menu and campaign menu are skipped; this saves a few seconds of time at each start; which can save a lot of time when frequently editing. So you may want to temporarily turn your campaign scenario to a test scenario:
- replace the "[scenario]" tag with "[test]" tag;
- change "id" attribute to "id=test";
- move it to "$userdata/campaigns" directory.
Note: When you install Wesnoth, it already includes a test scenario in "$data/scenario-test.cfg". You have to overwrite or delete this default test scenario (because there cannot be two test scenarios with the same "id".)
To start the test scenario, on MS Windows, make a "bat" file containing the following commands:
cd %ProgramFiles%\Wesnoth wesnoth.exe --test --windowed
When playing test scenario it is not possible to recall units; so balancing scenario difficulty may not be accurate.
Related forum threads: 9146, 9839.