Difference between revisions of "TimeWML"
(→The [time] and [illuminated_time] tags) |
Pentarctagon (talk | contribs) (→The [time] tag) |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 6: | Line 6: | ||
Scenario author can schedule the times of day in scenario; use the pre-defined time macros, or create new times of day. | Scenario author can schedule the times of day in scenario; use the pre-defined time macros, or create new times of day. | ||
− | == The [time] | + | == The [time] tag == |
− | The [time] tag is a subtag of the [scenario] tag. However, most scenarios do not use these directly, but usually use | + | The [time] tag is a subtag of the [scenario] tag. However, most scenarios do not use these directly, but usually use ready-made macros to specify the day-night cycle. |
− | See '''data/core/macros/schedules.cfg''' for the definitions of these | + | See '''data/core/macros/schedules.cfg''' for the definitions of these macros. |
The [time] tag describes a single turn of a day/night sequence. When a scenario is played, the first turn is described by the first [time] tag; the second described by the second, until there are no more. After all the tags have described a turn, the next turn is described by the first tag again. | The [time] tag describes a single turn of a day/night sequence. When a scenario is played, the first turn is described by the first [time] tag; the second described by the second, until there are no more. After all the tags have described a turn, the next turn is described by the first tag again. | ||
Line 18: | Line 18: | ||
* '''id''': the id by which you can reference this time, e.g. in the ''time_of_day'' tag of [[AiWML]]. | * '''id''': the id by which you can reference this time, e.g. in the ''time_of_day'' tag of [[AiWML]]. | ||
* '''name''': (translatable) the name displayed when the cursor is over the day/night image. | * '''name''': (translatable) the name displayed when the cursor is over the day/night image. | ||
+ | * '''description''': (translatable) the description of the time displayed in the in-game help. | ||
* '''image''': the image displayed at the top of the Status Table during turns of this type. | * '''image''': the image displayed at the top of the Status Table during turns of this type. | ||
* '''mask''': the image displayed over all hexes during turns of this type. | * '''mask''': the image displayed over all hexes during turns of this type. | ||
− | * ''' | + | * '''lawful_bonus''': units with '''alignment=lawful''' do +''lawful_bonus'' % damage during turns of this type. Units with '''alignment=chaotic''' do -''lawful_bonus'' % damage. Units with '''alignment=neutral''' are unaffected by this key. Units with '''alignment=liminal''' do -(abs(''lawful_bonus'')) % damage. ''lawful_bonus'' can be a negative number. This is useful if you want to give Chaotic units an advantage instead of Lawful ones. |
− | |||
* '''red''', '''green''', '''blue''': describe the tint of the screen during the time period. Appears to be an integer value from -255 to 255. See schedules.cfg for examples. | * '''red''', '''green''', '''blue''': describe the tint of the screen during the time period. Appears to be an integer value from -255 to 255. See schedules.cfg for examples. | ||
* '''sound''': a sound to play (in sounds/) when changing into this time of day. | * '''sound''': a sound to play (in sounds/) when changing into this time of day. | ||
+ | |||
+ | === Ready-made times and schedules === | ||
+ | |||
+ | The following macros represent predefined times: | ||
+ | |||
+ | <syntaxhighlight lang='wml'> | ||
+ | {DAWN} | ||
+ | {MORNING} | ||
+ | {MIDDAY} | ||
+ | {AFTERNOON} | ||
+ | {DUSK} | ||
+ | {FIRST_WATCH} | ||
+ | {MIDNIGHT} | ||
+ | {SECOND_WATCH} | ||
+ | {INDOORS} | ||
+ | {UNDERGROUND} | ||
+ | {DEEP_UNDERGROUND} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | The latter three are typically used alone. The rest are more often used indirectly via one of the following predefined 6-step schedules: | ||
+ | |||
+ | <syntaxhighlight lang='wml'> | ||
+ | {DEFAULT_SCHEDULE} | ||
+ | {SUMMER_SCHEDULE} | ||
+ | {WINTER_SCHEDULE} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Two alternate schedules are also available. Each individual time in these schedules has its own macro, but they won't be listed here. | ||
+ | |||
+ | <syntaxhighlight lang='wml'> | ||
+ | {DEFAULT_SCHEDULE_24H} | ||
+ | {TWO_SUNS_DEFAULT_SCHEDULE} | ||
+ | </syntaxhighlight> | ||
=== Scheduling time === | === Scheduling time === | ||
Line 32: | Line 65: | ||
The typical day/night cycle looks like this: | The typical day/night cycle looks like this: | ||
− | + | <syntaxhighlight lang='wml'> | |
− | + | {DAWN} | |
− | + | {MORNING} | |
− | + | {AFTERNOON} | |
− | + | {DUSK} | |
− | + | {FIRST_WATCH} | |
+ | {SECOND_WATCH} | ||
+ | </syntaxhighlight> | ||
− | To avoid day/night cycle, use a neutral time of day, for example | + | To avoid day/night cycle, use a neutral time of day, for example {DAWN}. For underground scenarios, usually the {UNDERGROUND} time of day is used. |
− | |||
− | |||
− | |||
− | |||
It works like night; that is it gives advantage to chaotic units and disadvantage to lawful units. | It works like night; that is it gives advantage to chaotic units and disadvantage to lawful units. | ||
− | |||
− | |||
== See Also == | == See Also == | ||
Line 52: | Line 81: | ||
* [[ScenarioWML]] | * [[ScenarioWML]] | ||
* [[ReferenceWML]] | * [[ReferenceWML]] | ||
− | |||
[[Category: WML Reference]] | [[Category: WML Reference]] |
Latest revision as of 04:01, 24 November 2023
The time of day influences damage done by lawful and chaotic units; this makes timing of your attack important. Graphically time of day is represented by a picture (landscape with sun or moon) in the status table, and by darkening the screen during night turns.
Scenario author can schedule the times of day in scenario; use the pre-defined time macros, or create new times of day.
The [time] tag
The [time] tag is a subtag of the [scenario] tag. However, most scenarios do not use these directly, but usually use ready-made macros to specify the day-night cycle. See data/core/macros/schedules.cfg for the definitions of these macros.
The [time] tag describes a single turn of a day/night sequence. When a scenario is played, the first turn is described by the first [time] tag; the second described by the second, until there are no more. After all the tags have described a turn, the next turn is described by the first tag again.
The [time] tag recognizes the following keys:
- id: the id by which you can reference this time, e.g. in the time_of_day tag of AiWML.
- name: (translatable) the name displayed when the cursor is over the day/night image.
- description: (translatable) the description of the time displayed in the in-game help.
- image: the image displayed at the top of the Status Table during turns of this type.
- mask: the image displayed over all hexes during turns of this type.
- lawful_bonus: units with alignment=lawful do +lawful_bonus % damage during turns of this type. Units with alignment=chaotic do -lawful_bonus % damage. Units with alignment=neutral are unaffected by this key. Units with alignment=liminal do -(abs(lawful_bonus)) % damage. lawful_bonus can be a negative number. This is useful if you want to give Chaotic units an advantage instead of Lawful ones.
- red, green, blue: describe the tint of the screen during the time period. Appears to be an integer value from -255 to 255. See schedules.cfg for examples.
- sound: a sound to play (in sounds/) when changing into this time of day.
Ready-made times and schedules
The following macros represent predefined times:
{DAWN}
{MORNING}
{MIDDAY}
{AFTERNOON}
{DUSK}
{FIRST_WATCH}
{MIDNIGHT}
{SECOND_WATCH}
{INDOORS}
{UNDERGROUND}
{DEEP_UNDERGROUND}
The latter three are typically used alone. The rest are more often used indirectly via one of the following predefined 6-step schedules:
{DEFAULT_SCHEDULE}
{SUMMER_SCHEDULE}
{WINTER_SCHEDULE}
Two alternate schedules are also available. Each individual time in these schedules has its own macro, but they won't be listed here.
{DEFAULT_SCHEDULE_24H}
{TWO_SUNS_DEFAULT_SCHEDULE}
Scheduling time
The [scenario] tag contains a few [time] tags (or macros). These time tags are used in a loop, that is: first time tag is used during the first turn, then second one,... and when all time tags passed then again the first one, second one, etc.
The typical day/night cycle looks like this:
{DAWN}
{MORNING}
{AFTERNOON}
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}
To avoid day/night cycle, use a neutral time of day, for example {DAWN}. For underground scenarios, usually the {UNDERGROUND} time of day is used. It works like night; that is it gives advantage to chaotic units and disadvantage to lawful units.