ThemeCfg.wiki
changeset 1011 399ca0374984
parent 990 606b2d0c5a09
child 1019 0f9e43961b7e
equal deleted inserted replaced
1010:c4ebbf3e0966 1011:399ca0374984
       
     1 #summary Structure of the theme.cfg file
       
     2 
       
     3 = `theme.cfg` =
       
     4 The file `theme.cfg` gives the engine the values associated with a certain theme, to complement the graphics. To learn more about the general file structure of themes, see [ThemeFiles].
       
     5 It is structured with a list of keys, each seperated by line breaks. Each key is followed by an equals sign followed a value. The value depends on the key.
       
     6 
       
     7 Example:
       
     8 <code>sky = 23, 8, 33
       
     9 border = 7, 72, 102
       
    10 music = Art.ogg</code>
       
    11 
       
    12 There are also keys that replace existing keys under certain conditions, all keys preceding with “`sd-`” are used during Sudden Death and all keys with “`rq-`” are used when the graphics quality is reduced.
       
    13 
       
    14 Following is the list of all current keys and their values, it is important to have the right number of values. Most keys may only be used once.
       
    15 
       
    16 The values red, green, blue and opacity are in the range of one byte and can be specified in both decimal or hexadecimal form. The range are `0` - `255` or `$00` - `$FF`.
       
    17 
       
    18 Any line can be made into a comment line by having a semicolon (“`;`”) at the beginning. Comments are ignored by Hedgewars.
       
    19 
       
    20 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 
       
    22 == `sky` ==
       
    23 The colour of the sky.
       
    24 
       
    25 <code>Values: red, green, blue</code>
       
    26 
       
    27 <code>Default: 0, 0, 0</code>
       
    28 
       
    29 == `rq-sky` ==
       
    30 The sky color in reduced quality mode. If present, it is used instead of `sky` on low quality.
       
    31 
       
    32 <code>Values: red, green, blue</code>
       
    33 
       
    34 == `border` ==
       
    35 The colour of the outline of explosions.
       
    36 
       
    37 <code>Values: red, green, blue</code>
       
    38 
       
    39 <code>Default: 80, 80, 80</code>
       
    40 
       
    41 == `water-top` ==
       
    42 The colour of the topmost part of the water (under the `BlueWater.png`) before Sudden Death.
       
    43 This makes a gradient together with `water-bottom`. The default color
       
    44 is black which is usually not what you want.
       
    45 In combination with the default `BlueWater.png`, the recommended value is `$54, $5C, $9D`.
       
    46 
       
    47 <code>Values: red, green, blue</code>
       
    48 
       
    49 <code>Default: 0, 0, 0</code>
       
    50 
       
    51 == `water-bottom` ==
       
    52 The colour of the lowest part of the water before Sudden Death.
       
    53 This makes a gradient together with `water-top`. The default color
       
    54 is black which is usually not what you want.
       
    55 In combination with the default `BlueWater.png`, the recommended value is `$34, $3C, $7D`.
       
    56 
       
    57 <code>Values: red, green, blue</code>
       
    58 
       
    59 <code>Default: 0, 0, 0</code>
       
    60 
       
    61 == `sd-water-bottom` ==
       
    62 The colour of the lowest part of the water while in Sudden Death.
       
    63 This makes a gradient together with `sd-water-top`.
       
    64 The default color neatly matches the default `SDWater.png`.
       
    65 
       
    66 <code>Values: red, green, blue</code>
       
    67 
       
    68 <code>Default: 150, 112, 169</code>
       
    69 
       
    70 == `sd-water-top` ==
       
    71 The colour of the topmost part of the water (under the `SDWater.png`) while in Sudden Death.
       
    72 This makes a gradient together with `sd-water-bottom`.
       
    73 The default color neatly matches the default `SDWater.png`.
       
    74 
       
    75 <code>Values: red, green, blue</code>
       
    76 
       
    77 <code>Default: 182, 144, 201</code>
       
    78 
       
    79 == `water-opacity` ==
       
    80 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.
       
    81 
       
    82 In combination with the default `BlueWater.png`, the recommended value for this is `$80`, which also is the default.
       
    83 
       
    84 <code>Values: opacity</code>
       
    85 
       
    86 <code>Default: $80</code>
       
    87 
       
    88 == `sd-water-opacity` ==
       
    89 The water opacity while in Sudden Death. Syntax and default value is equivalent to `water-opacity`.
       
    90 
       
    91 == `water-animation` (0.9.23) ==
       
    92 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.
       
    93 
       
    94 <code>Values: frames, frame ticks, movement speed</code>
       
    95 
       
    96  * `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`
       
    97  * `frame ticks`: Duration of a single frame. Must be >0 if `frames`>1, otherwise it is ignored
       
    98  * `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
       
    99 
       
   100 <code>Default: 1, 0, 1</code>
       
   101 
       
   102 == `sd-water-animation` (0.9.23) ==
       
   103 Sudden Death equivalent of `water-animation`, uses `SDWater.png`.
       
   104 
       
   105 == `music` ==
       
   106 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!
       
   107 
       
   108 <code>Values: filename</code>
       
   109 
       
   110 No music is played by default.
       
   111 
       
   112 == `sd-music` (0.9.21) ==
       
   113 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!
       
   114 
       
   115 <code>Values: filename</code>
       
   116 
       
   117 Default: `sdmusic.ogg` (only if `music` was specified, no music otherwise)
       
   118 
       
   119 == `clouds` ==
       
   120 The number of clouds to create, before Sudden Death. Uses `Clouds.png`.
       
   121 
       
   122 <code>Values: number</code>
       
   123 
       
   124 <code>Default: 9</code>
       
   125 
       
   126 == `sd-clouds` ==
       
   127 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.
       
   128 
       
   129 <code>Values: number</code>
       
   130 
       
   131 <code>Default: 9</code>
       
   132 
       
   133 == `flatten-clouds` ==
       
   134 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).
       
   135 
       
   136 == `flakes` ==
       
   137 Values for the flakes of this theme before Sudden Death. Uses `Flake.png`.
       
   138 
       
   139  * `number`: Number of visible flakes.
       
   140  * `frames`: Number of frames used in `Flake.png`
       
   141  * `frame ticks`: Number of ticks a frame is shown, after that the next frame is shown (a tick currently equals 1 millisecond).
       
   142 Since 0.9.21: A value of 0 indicates that each flake should keep displaying the exact frame that was selected randomly when the flake was created.
       
   143 *Tip*: If you want to have multiple static flakes in 0.9.20 or earlier, you can set the animation length to a ridiculous high value. Sometimes, a flake will still change the displayed frame, but it will rarely happen.
       
   144  * `speed`: Rotation speed of flake
       
   145  * `fall speed`: Falling speed of flake. Since 0.9.23, this can be negative for rising flakes
       
   146 
       
   147 <code>Values: number, frames, frame ticks, speed, fall speed</code>
       
   148 
       
   149 No flakes are used by default.
       
   150 
       
   151 == `sd-flakes` ==
       
   152 Sudden death version of `flakes`, the parameters are the same as in `flakes`. This uses `SDFlake.png`. If `flakes` was unspecified, then there are no Sudden Death flakes by default, the default shown below only applies if `flakes` has been specified.
       
   153 
       
   154 <code>Values: number, frames, frame ticks, speed, fall speed</code>
       
   155 
       
   156 <code>Default: X, 4, 0, 15, 250</code>
       
   157 
       
   158 (The “X” means the default number of Sudden Death flakes is variable. It depends on the window size and the terrain width.)
       
   159 
       
   160 == `flatten-flakes` ==
       
   161 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.
       
   162 
       
   163 == `object` ==
       
   164 There may be multiple object keys in the file, each one representing one land object.
       
   165 
       
   166  * `filename`: The object’s filename (without the “.png”). Case-sensitive.
       
   167  * `max`: The maximum number of this object that may be generated in a map (must by between 1 and 32
       
   168  * `buriedrects_num`: (optional): Number of rectangles that must be buried in the terrain. If this value is ommitted, a value of 1 is assumed. Only available in version 0.9.23 or later
       
   169  * `buriedrects`: A rectangle that must be buried in the terrain (`left, top, width, height`). In version 0.9.23, if all 4 values are 0, the object will be placed on top of the water
       
   170  * `minvisible`: The minimum amount of rectangles that must be visible
       
   171  * `visiblerects`: List of the rectangles for being visible (`left, top, width, height`)
       
   172 
       
   173 Syntax for version 0.9.22, or when you only need 1 buried rectangle:
       
   174 
       
   175 <code>Values: filename, max, buriedrec, minvisible, visiblerec</code>
       
   176 
       
   177 Syntax when using multiple buried rectangles in 0.9.23:
       
   178 
       
   179 <code>Values: filename, max, buriedrects_num, buriedrects, minvisible, visiblerects</code>
       
   180 
       
   181 Here's an example where `visiblerects` and the `buriedrects` are visualized on an ancient picture:
       
   182 
       
   183 https://hedgewars.org/images/avematantheme/hw-avematan.rects.png
       
   184 
       
   185 The large rectangle shows a `visiblerects` and the small one shows a `buriedrects`.
       
   186 
       
   187 == `spray` ==
       
   188 There may be several spray keys in the file, each one representing one spray object.
       
   189 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.
       
   190 
       
   191 <code>Values: name, number</code>
       
   192 
       
   193 == `ice` ==
       
   194 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.
       
   195 
       
   196 == `snow` ==
       
   197 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.