ThemeCfg.wiki
changeset 1311 8278a0b9e9c0
parent 1310 c84f7dd4a919
child 1312 73191c174bf5
equal deleted inserted replaced
1310:c84f7dd4a919 1311:8278a0b9e9c0
     1 #summary Structure of the theme.cfg file
     1 #summary Structure of the theme.cfg file
     2 
     2 
     3 = `theme.cfg` =
     3 = `theme.cfg` =
     4 
       
     5 <wiki:toc max_depth="2" />
       
     6 
       
     7 == Syntax ==
     4 == Syntax ==
     8 The file `theme.cfg` gives the engine the values associated with a certain theme, to complement the graphics. To understand themes in general, start at [Themes]. To learn more about the general file structure of themes, see [ThemeFiles].
     5 The file `theme.cfg` gives the engine the values associated with a certain theme, to complement the graphics. To understand themes in general, start at [Themes]. To learn more about the general file structure of themes, see [ThemeFiles].
     9 It is structured with a list of keys, each separated by line breaks. Each key is followed by an equals sign followed a value. The value depends on the key.
     6 It is structured with a list of keys, each separated by line breaks. Each key is followed by an equals sign followed a value. The value depends on the key.
    10 
     7 
    11 Example:
     8 Example:
    21 
    18 
    22 Any line can be made into a comment line by having a semicolon (“`;`”) at the beginning. Comments are ignored by Hedgewars.
    19 Any line can be made into a comment line by having a semicolon (“`;`”) at the beginning. Comments are ignored by Hedgewars.
    23 
    20 
    24 Literally all lines in the `theme.cfg` file are optional, thus an empty file is valid. Everything has a default value. However, some default values are not really useful (e.g. the water or sky color) and you should therefore explicitly specify enough values.
    21 Literally all lines in the `theme.cfg` file are optional, thus an empty file is valid. Everything has a default value. However, some default values are not really useful (e.g. the water or sky color) and you should therefore explicitly specify enough values.
    25 
    22 
    26 == General configuration keys ==
    23 <wiki:toc max_depth="2" />
    27 === `hidden` (0.9.24) ===
    24 
       
    25 == Keys ==
       
    26 === General configuration ===
       
    27 ==== `hidden` (0.9.24) ====
    28 If this key is present in `theme.cfg` (the value does not matter), the theme will be hidden from the theme selection menu. Background themes *must* be hidden.
    28 If this key is present in `theme.cfg` (the value does not matter), the theme will be hidden from the theme selection menu. Background themes *must* be hidden.
    29 
    29 
    30 === `ice` ===
    30 ==== `ice` ====
    31 If this key is present (any value), girders become slippery like ice. This also applies to placed girders. This significantly changes the gameplay of your theme, so use wisely. If this key is not present, the terrain is not slippery.
    31 If this key is present (any value), girders become slippery like ice. This also applies to placed girders. This significantly changes the gameplay of your theme, so use wisely. If this key is not present, the terrain is not slippery.
    32 
    32 
    33 === `snow` ===
    33 ==== `snow` ====
    34 If this key is present (any value), the flakes which are normally purely decorational now behave like snowflakes. When they collide with terrain, they become a part of the landscape. This significantly changes the gameplay of your theme, so use wisely. If this key is not present, the flakes are purely decorational.
    34 If this key is present (any value), the flakes which are normally purely decorational now behave like snowflakes. When they collide with terrain, they become a part of the landscape. This significantly changes the gameplay of your theme, so use wisely. If this key is not present, the flakes are purely decorational.
    35 
    35 
    36 == Land keys ==
    36 === Land ===
    37 === `border` ===
    37 ==== `border` ====
    38 The colour of the outline of explosions.
    38 The colour of the outline of explosions.
    39 
    39 
    40 <code>Values: red, green, blue</code>
    40 <code>Values: red, green, blue</code>
    41 
    41 
    42 <code>Default: $50, $50, $50</code>
    42 <code>Default: $50, $50, $50</code>
    43 
    43 
    44 === `object` ===
    44 ==== `object` ====
    45 There may be multiple object keys in the file, each one representing one land object.
    45 There may be multiple object keys in the file, each one representing one land object.
    46 
    46 
    47  * `filename`: The object’s filename (without the “.png”). Case-sensitive.
    47  * `filename`: The object’s filename (without the “.png”). Case-sensitive.
    48  * `max`: The maximum number of this object that may be generated in a map (must by between 1 and 32)
    48  * `max`: The maximum number of this object that may be generated in a map (must by between 1 and 32)
    49  * `buriedrects_num`: (optional): Number of rectangles that must be buried in the terrain. If this value is ommitted, a value of 1 is assumed
    49  * `buriedrects_num`: (optional): Number of rectangles that must be buried in the terrain. If this value is ommitted, a value of 1 is assumed
    63 
    63 
    64 https://hedgewars.org/images/avematantheme/hw-avematan.rects.png
    64 https://hedgewars.org/images/avematantheme/hw-avematan.rects.png
    65 
    65 
    66 The large rectangle shows a `visiblerects` and the small one shows a `buriedrects`.
    66 The large rectangle shows a `visiblerects` and the small one shows a `buriedrects`.
    67 
    67 
    68 === `spray` ===
    68 ==== `spray` ====
    69 There may be several spray keys in the file, each one representing one spray object.
    69 There may be several spray keys in the file, each one representing one spray object.
    70 The `name` is the case-sensitive name of the PNG file (without the file name suffix) of the graphics file, and `number` is the rough number of instances of this spray that may be added to the map. The number is the average number of sprays that are normally placed on a random medium-sized island. For larger and smaller landscapes, this number will be automatically scaled up or down. Please note that this number only specifies a rough goal, the actual number of created sprays may vary and you may have to play a bit with this number in order to find a good value.
    70 The `name` is the case-sensitive name of the PNG file (without the file name suffix) of the graphics file, and `number` is the rough number of instances of this spray that may be added to the map. The number is the average number of sprays that are normally placed on a random medium-sized island. For larger and smaller landscapes, this number will be automatically scaled up or down. Please note that this number only specifies a rough goal, the actual number of created sprays may vary and you may have to play a bit with this number in order to find a good value.
    71 
    71 
    72 <code>Values: name, number</code>
    72 <code>Values: name, number</code>
    73 
    73 
    74 == Water keys ==
    74 === Water keys ===
    75 === `water-top` ===
    75 ==== `water-top` ====
    76 The colour of the topmost part of the water (under the `BlueWater.png`) before Sudden Death.
    76 The colour of the topmost part of the water (under the `BlueWater.png`) before Sudden Death.
    77 This makes a gradient together with `water-bottom`. The default color is blue and matches the default `BlueColor.png`.
    77 This makes a gradient together with `water-bottom`. The default color is blue and matches the default `BlueColor.png`.
    78 
    78 
    79 <code>Values: red, green, blue</code>
    79 <code>Values: red, green, blue</code>
    80 
    80 
    81 <code>Default: $54, $5C, $9D</code>
    81 <code>Default: $54, $5C, $9D</code>
    82 
    82 
    83 === `water-bottom` ===
    83 ==== `water-bottom` ====
    84 The colour of the lowest part of the water before Sudden Death.
    84 The colour of the lowest part of the water before Sudden Death.
    85 This makes a gradient together with `water-top`. The default color is blue and matches the default `BlueColor.png`.
    85 This makes a gradient together with `water-top`. The default color is blue and matches the default `BlueColor.png`.
    86 
    86 
    87 <code>Values: red, green, blue</code>
    87 <code>Values: red, green, blue</code>
    88 
    88 
    89 <code>Default: $34, $3C, $7D</code>
    89 <code>Default: $34, $3C, $7D</code>
    90 
    90 
    91 === `sd-water-bottom` ===
    91 ==== `sd-water-bottom` ====
    92 The colour of the lowest part of the water while in Sudden Death.
    92 The colour of the lowest part of the water while in Sudden Death.
    93 This makes a gradient together with `sd-water-top`.
    93 This makes a gradient together with `sd-water-top`.
    94 The default color neatly matches the default `SDWater.png`.
    94 The default color neatly matches the default `SDWater.png`.
    95 
    95 
    96 <code>Values: red, green, blue</code>
    96 <code>Values: red, green, blue</code>
    97 
    97 
    98 <code>Default: $96, $70, $A9</code>
    98 <code>Default: $96, $70, $A9</code>
    99 
    99 
   100 === `sd-water-top` ===
   100 ==== `sd-water-top` ====
   101 The colour of the topmost part of the water (under the `SDWater.png`) while in Sudden Death.
   101 The colour of the topmost part of the water (under the `SDWater.png`) while in Sudden Death.
   102 This makes a gradient together with `sd-water-bottom`.
   102 This makes a gradient together with `sd-water-bottom`.
   103 The default color neatly matches the default `SDWater.png`.
   103 The default color neatly matches the default `SDWater.png`.
   104 
   104 
   105 <code>Values: red, green, blue</code>
   105 <code>Values: red, green, blue</code>
   106 
   106 
   107 <code>Default: $B9, $72, $C9</code>
   107 <code>Default: $B9, $72, $C9</code>
   108 
   108 
   109 === `water-opacity` ===
   109 ==== `water-opacity` ====
   110 The water opacity before Sudden Death. Opacity of the water affects how visible gears in the water are. `0` makes it fully transparent, whereas `255` or `$FF` makes it fully opaque. If the water is fully opaque, the drowning animation is skipped when a hedgehog drowns.
   110 The water opacity before Sudden Death. Opacity of the water affects how visible gears in the water are. `0` makes it fully transparent, whereas `255` or `$FF` makes it fully opaque. If the water is fully opaque, the drowning animation is skipped when a hedgehog drowns.
   111 
   111 
   112 In combination with the default `BlueWater.png`, the recommended value for this is `$80`, which also is the default.
   112 In combination with the default `BlueWater.png`, the recommended value for this is `$80`, which also is the default.
   113 
   113 
   114 <code>Values: opacity</code>
   114 <code>Values: opacity</code>
   115 
   115 
   116 <code>Default: $80</code>
   116 <code>Default: $80</code>
   117 
   117 
   118 === `sd-water-opacity` ===
   118 ==== `sd-water-opacity` ====
   119 The water opacity while in Sudden Death. Syntax and default value is equivalent to `water-opacity`.
   119 The water opacity while in Sudden Death. Syntax and default value is equivalent to `water-opacity`.
   120 
   120 
   121 === `water-animation` (0.9.23) ===
   121 ==== `water-animation` (0.9.23) ====
   122 Specified a custom water animation and flowing speed before Sudden Death. By default, the water just moves to the right and has no special animation.
   122 Specified a custom water animation and flowing speed before Sudden Death. By default, the water just moves to the right and has no special animation.
   123 
   123 
   124 <code>Values: frames, frame ticks, movement speed</code>
   124 <code>Values: frames, frame ticks, movement speed</code>
   125 
   125 
   126  * `frames`: Number of frames in `BlueWater.png`. The frames in this image should be stacked horizontally. The height of this image must be divisible by `frames`
   126  * `frames`: Number of frames in `BlueWater.png`. The frames in this image should be stacked horizontally. The height of this image must be divisible by `frames`
   127  * `frame ticks`: Duration of a single frame. Must be >0 if `frames`>1, otherwise it is ignored
   127  * `frame ticks`: Duration of a single frame. Must be >0 if `frames`>1, otherwise it is ignored
   128  * `movement speed`: How fast the water moves to the right. Higher values means faster movement. If negative, it moves to the left. Use 0 to stop movement
   128  * `movement speed`: How fast the water moves to the right. Higher values means faster movement. If negative, it moves to the left. Use 0 to stop movement
   129 
   129 
   130 <code>Default: 1, 0, 1</code>
   130 <code>Default: 1, 0, 1</code>
   131 
   131 
   132 === `sd-water-animation` (0.9.23) ===
   132 ==== `sd-water-animation` (0.9.23) ====
   133 Sudden Death equivalent of `water-animation`, uses `SDWater.png`.
   133 Sudden Death equivalent of `water-animation`, uses `SDWater.png`.
   134 
   134 
   135 == Background keys ==
   135 === Background ===
   136 === `sky` ===
   136 ==== `sky` ====
   137 The colour of the sky.
   137 The colour of the sky.
   138 
   138 
   139 <code>Values: red, green, blue</code>
   139 <code>Values: red, green, blue</code>
   140 
   140 
   141 <code>Default: $00, $00, $00</code>
   141 <code>Default: $00, $00, $00</code>
   142 
   142 
   143 === `rq-sky` ===
   143 ==== `rq-sky` ====
   144 The sky color in reduced quality mode. If present, it is used instead of `sky` on low quality.
   144 The sky color in reduced quality mode. If present, it is used instead of `sky` on low quality.
   145 
   145 
   146 <code>Values: red, green, blue</code>
   146 <code>Values: red, green, blue</code>
   147 
   147 
   148 === `sd-tint` ===
   148 ==== `sd-tint` ====
   149 Custom tinting of the background in Sudden Death. The background color will be multiplied by the RGB and opacity values. With `$FF, $FF, $FF, $FF`, there is no change, while with `$00, $00, $00, $FF`, the backgroun turns completely black. The opacity value controls how visible the background image will still be. With an opacity of `$00`, the background image is not visible, only the `sd-tint` color can be seen.
   149 Custom tinting of the background in Sudden Death. The background color will be multiplied by the RGB and opacity values. With `$FF, $FF, $FF, $FF`, there is no change, while with `$00, $00, $00, $FF`, the backgroun turns completely black. The opacity value controls how visible the background image will still be. With an opacity of `$00`, the background image is not visible, only the `sd-tint` color can be seen.
   150 
   150 
   151 <code>Values: red, green, blue, opacity</code>
   151 <code>Values: red, green, blue, opacity</code>
   152 
   152 
   153 <code>Default: $80, $80, $80, $FF</code>
   153 <code>Default: $80, $80, $80, $FF</code>
   154 
   154 
   155 === `clouds` ===
   155 ==== `clouds` ====
   156 The number of clouds to create, before Sudden Death. Uses `Clouds.png`.
   156 The number of clouds to create, before Sudden Death. Uses `Clouds.png`.
   157 
   157 
   158 <code>Values: number</code>
   158 <code>Values: number</code>
   159 
   159 
   160 <code>Default: 9</code>
   160 <code>Default: 9</code>
   161 
   161 
   162 === `sd-clouds` ===
   162 ==== `sd-clouds` ====
   163 Number of clouds while in Sudden Death, uses the file `SDClouds.png`. By default it is the same number as `clouds` or `9` if `clouds` was not specified as well.
   163 Number of clouds while in Sudden Death, uses the file `SDClouds.png`. By default it is the same number as `clouds` or `9` if `clouds` was not specified as well.
   164 
   164 
   165 <code>Values: number</code>
   165 <code>Values: number</code>
   166 
   166 
   167 <code>Default: 9</code>
   167 <code>Default: 9</code>
   168 
   168 
   169 === `flatten-clouds` ===
   169 ==== `flatten-clouds` ====
   170 Normally, the clouds vary in size and are drawn on different layers. But if this key is present (any value) in `theme.cfg`, all clouds have the same size and are on the same layer (background).
   170 Normally, the clouds vary in size and are drawn on different layers. But if this key is present (any value) in `theme.cfg`, all clouds have the same size and are on the same layer (background).
   171 
   171 
   172 === `flakes` ===
   172 ==== `flakes` ====
   173 Values for the flakes of this theme before Sudden Death. Uses `Flake.png`.
   173 Values for the flakes of this theme before Sudden Death. Uses `Flake.png`.
   174 
   174 
   175  * `number`: Number of visible flakes.
   175  * `number`: Number of visible flakes.
   176  * `frames`: Number of frames used in `Flake.png`
   176  * `frames`: Number of frames used in `Flake.png`
   177  * `frame ticks`: Number of ticks a frame is shown, after that the next frame is shown (a tick currently equals 1 millisecond). A value of 0 indicates that each flake should keep displaying the exact frame that was selected randomly when the flake was created.
   177  * `frame ticks`: Number of ticks a frame is shown, after that the next frame is shown (a tick currently equals 1 millisecond). A value of 0 indicates that each flake should keep displaying the exact frame that was selected randomly when the flake was created.
   180 
   180 
   181 <code>Values: number, frames, frame ticks, rotation speed, vertical speed</code>
   181 <code>Values: number, frames, frame ticks, rotation speed, vertical speed</code>
   182 
   182 
   183 No flakes are used by default.
   183 No flakes are used by default.
   184 
   184 
   185 === `sd-flakes` ===
   185 ==== `sd-flakes` ====
   186 Sudden Death version of `flakes`, the parameters are the same as in `flakes`. This uses `SDFlake.png`.
   186 Sudden Death version of `flakes`, the parameters are the same as in `flakes`. This uses `SDFlake.png`.
   187 
   187 
   188 <code>Values: number, frames, frame ticks, rotation speed, vertical speed</code>
   188 <code>Values: number, frames, frame ticks, rotation speed, vertical speed</code>
   189 
   189 
   190 If `sd-flakes` is unspecified, skulls and bones are used as images and the following default values are used:
   190 If `sd-flakes` is unspecified, skulls and bones are used as images and the following default values are used:
   191 
   191 
   192 <code>Default: X, 4, 0, 15, 250</code>
   192 <code>Default: X, 4, 0, 15, 250</code>
   193 
   193 
   194 (The “X” means the default number of Sudden Death flakes is variable. It depends on the window size and the terrain width.)
   194 (The “X” means the default number of Sudden Death flakes is variable. It depends on the window size and the terrain width.)
   195 
   195 
   196 === `flatten-flakes` ===
   196 ==== `flatten-flakes` ====
   197 Normally, the flakes vary in size and are drawn on different layers, some of them even in front of the terrain. But if this key is present (any value) in `theme.cfg`, all flakes have the same size and are on the same layer: In front of the sky and horizont and behind the terrain.
   197 Normally, the flakes vary in size and are drawn on different layers, some of them even in front of the terrain. But if this key is present (any value) in `theme.cfg`, all flakes have the same size and are on the same layer: In front of the sky and horizont and behind the terrain.
   198 
   198 
   199 
   199 
   200 == Music keys ==
   200 === Music ===
   201 === `music` ===
   201 ==== `music` ====
   202 Name of the music file to be played in the theme before Sudden Death, e.g. `Nature.ogg`. You find music tracks in `Data/Music` of the Hedgewars installation directory. The file name is case-sensitive!
   202 Name of the music file to be played in the theme before Sudden Death, e.g. `Nature.ogg`. You find music tracks in `Data/Music` of the Hedgewars installation directory. The file name is case-sensitive!
   203 
   203 
   204 If you choose a custom music (i.e. a music which does not come with Hedgewars by default), you should also set `fallback-music`.
   204 If you choose a custom music (i.e. a music which does not come with Hedgewars by default), you should also set `fallback-music`.
   205 
   205 
   206 <code>Values: filename</code>
   206 <code>Values: filename</code>
   208 No music is played by default.
   208 No music is played by default.
   209 
   209 
   210 Example:
   210 Example:
   211 <code>music = Nature.ogg</code>
   211 <code>music = Nature.ogg</code>
   212 
   212 
   213 === `sd-music` ===
   213 ==== `sd-music` ====
   214 Name of the music file to be played in the theme while in Sudden Death, e.g. `hell.ogg`. If `music` was not specified, the Sudden Death has no default music as well. You find music tracks in `Data/Music` of the Hedgewars installation directory. The file name is case-sensitive!
   214 Name of the music file to be played in the theme while in Sudden Death, e.g. `hell.ogg`. If `music` was not specified, the Sudden Death has no default music as well. You find music tracks in `Data/Music` of the Hedgewars installation directory. The file name is case-sensitive!
   215 
   215 
   216 If you choose a custom music, you should also set `fallback-sd-music`.
   216 If you choose a custom music, you should also set `fallback-sd-music`.
   217 
   217 
   218 <code>Values: filename</code>
   218 <code>Values: filename</code>
   219 
   219 
   220 Default: `sdmusic.ogg` (only if `music` was specified, no music otherwise)
   220 Default: `sdmusic.ogg` (only if `music` was specified, no music otherwise)
   221 
   221 
   222 === `fallback-music` ===
   222 ==== `fallback-music` ====
   223 Fallback music for the `music` setting. This setting should be added whenever you use a custom music which is not part of the official Hedgewars install. Otherwise you don't need to set this.
   223 Fallback music for the `music` setting. This setting should be added whenever you use a custom music which is not part of the official Hedgewars install. Otherwise you don't need to set this.
   224 If the music specified in `music` is missing, Hedgewars attempts to use this fallback music istead. *Only* use tracks which come with the official Hedgewars install.
   224 If the music specified in `music` is missing, Hedgewars attempts to use this fallback music istead. *Only* use tracks which come with the official Hedgewars install.
   225 
   225 
   226 Note that if Hedgewars fails to find a music, it defaults to silence.
   226 Note that if Hedgewars fails to find a music, it defaults to silence.
   227 
   227 
   228 Example usage (in combination with `music`):
   228 Example usage (in combination with `music`):
   229 <code>music = My_Custom_Music.ogg
   229 <code>music = My_Custom_Music.ogg
   230 fallback-music = Nature.ogg</code>
   230 fallback-music = Nature.ogg</code>
   231 
   231 
   232 === `fallback-sd-music` ===
   232 ==== `fallback-sd-music` ====
   233 Like `fallback-music`, except it's for `sd-music`.
   233 Like `fallback-music`, except it's for `sd-music`.