author | Wuzzy |
Sat, 20 Apr 2019 02:31:33 +0100 (2019-04-20) | |
changeset 1846 | fb5912100443 |
parent 1318 | 57078c02a42e |
child 1870 | 6679e0e8a7b4 |
permissions | -rw-r--r-- |
83 | 1 |
#summary Structure of the theme.cfg file |
2 |
||
1315 | 3 |
= Structure of `theme.cfg` = |
1316 | 4 |
|
5 |
== Introduction == |
|
6 |
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]. |
|
7 |
||
1313 | 8 |
<wiki:toc max_depth="3" /> |
9 |
||
1310 | 10 |
== Syntax == |
1316 | 11 |
A `theme.cfg` is a text file which is structured with a list of keys, each separated by line breaks. Each key is followed by an equals sign followed a value. Values can be numbers, strings, or comma-separated lists of these. |
815 | 12 |
|
13 |
Example: |
|
14 |
<code>sky = 23, 8, 33 |
|
15 |
border = 7, 72, 102 |
|
16 |
music = Art.ogg</code> |
|
83 | 17 |
|
814 | 18 |
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. |
83 | 19 |
|
20 |
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. |
|
21 |
||
1124
b37c99c55365
ThemeCfg: convert color numbers to hexadecimal form, consistently
Wuzzy
parents:
1123
diff
changeset
|
22 |
The values red, green, blue and opacity are in the range of one byte and can be specified in both decimal or hexadecimal form. A hexadecimal number must be prepended with a dollar sign. The range is `0` - `255` or `$00` - `$FF`. |
83 | 23 |
|
463 | 24 |
Any line can be made into a comment line by having a semicolon (“`;`”) at the beginning. Comments are ignored by Hedgewars. |
319
e5542ee81444
Fixed the object entry, as well as some minor fixes.
Caironater@gmail.com
parents:
83
diff
changeset
|
25 |
|
806 | 26 |
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. |
27 |
||
1315 | 28 |
== General configuration keys == |
1317 | 29 |
=== `hidden` === |
1266 | 30 |
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. |
31 |
||
1318 | 32 |
This key has been added in 0.9.24. |
1317 | 33 |
|
1314 | 34 |
=== `ice` === |
1308 | 35 |
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. |
806 | 36 |
|
1314 | 37 |
=== `snow` === |
1308 | 38 |
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. |
462 | 39 |
|
1315 | 40 |
== Land keys == |
1314 | 41 |
=== `border` === |
83 | 42 |
The colour of the outline of explosions. |
43 |
||
319
e5542ee81444
Fixed the object entry, as well as some minor fixes.
Caironater@gmail.com
parents:
83
diff
changeset
|
44 |
<code>Values: red, green, blue</code> |
83 | 45 |
|
1124
b37c99c55365
ThemeCfg: convert color numbers to hexadecimal form, consistently
Wuzzy
parents:
1123
diff
changeset
|
46 |
<code>Default: $50, $50, $50</code> |
806 | 47 |
|
1314 | 48 |
=== `object` === |
319
e5542ee81444
Fixed the object entry, as well as some minor fixes.
Caironater@gmail.com
parents:
83
diff
changeset
|
49 |
There may be multiple object keys in the file, each one representing one land object. |
83 | 50 |
|
433
0661855ab04a
Reorganize the page, improve typography, add sd-music.
almikes@aol.com
parents:
320
diff
changeset
|
51 |
* `filename`: The object’s filename (without the “.png”). Case-sensitive. |
1142 | 52 |
* `max`: The maximum number of this object that may be generated in a map (must by between 1 and 32) |
1121 | 53 |
* `buriedrects_num`: (optional): Number of rectangles that must be buried in the terrain. If this value is ommitted, a value of 1 is assumed |
54 |
* `buriedrects`: A rectangle that must be buried in the terrain (`left, top, width, height`). If all 4 values are 0, the object will be placed on top of the water |
|
433
0661855ab04a
Reorganize the page, improve typography, add sd-music.
almikes@aol.com
parents:
320
diff
changeset
|
55 |
* `minvisible`: The minimum amount of rectangles that must be visible |
990 | 56 |
* `visiblerects`: List of the rectangles for being visible (`left, top, width, height`) |
57 |
||
1121 | 58 |
Syntax when you only need 1 buried rectangle: |
319
e5542ee81444
Fixed the object entry, as well as some minor fixes.
Caironater@gmail.com
parents:
83
diff
changeset
|
59 |
|
e5542ee81444
Fixed the object entry, as well as some minor fixes.
Caironater@gmail.com
parents:
83
diff
changeset
|
60 |
<code>Values: filename, max, buriedrec, minvisible, visiblerec</code> |
83 | 61 |
|
1121 | 62 |
Syntax when you want to use multiple buried rectangles: |
990 | 63 |
|
64 |
<code>Values: filename, max, buriedrects_num, buriedrects, minvisible, visiblerects</code> |
|
65 |
||
66 |
Here's an example where `visiblerects` and the `buriedrects` are visualized on an ancient picture: |
|
808 | 67 |
|
798
30c5f1ebd552
global replace of http with https for hedgewars.org wiki links
nemo
parents:
746
diff
changeset
|
68 |
https://hedgewars.org/images/avematantheme/hw-avematan.rects.png |
448 | 69 |
|
990 | 70 |
The large rectangle shows a `visiblerects` and the small one shows a `buriedrects`. |
808 | 71 |
|
1314 | 72 |
=== `spray` === |
83 | 73 |
There may be several spray keys in the file, each one representing one spray object. |
472
52bd8ea08f4f
Better explanation for the number of sprays.
almikes@aol.com
parents:
466
diff
changeset
|
74 |
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. |
83 | 75 |
|
464 | 76 |
<code>Values: name, number</code> |
77 |
||
1315 | 78 |
== Water keys == |
1314 | 79 |
=== `water-top` === |
1308 | 80 |
The colour of the topmost part of the water (under the `BlueWater.png`) before Sudden Death. |
81 |
This makes a gradient together with `water-bottom`. The default color is blue and matches the default `BlueColor.png`. |
|
82 |
||
83 |
<code>Values: red, green, blue</code> |
|
84 |
||
85 |
<code>Default: $54, $5C, $9D</code> |
|
86 |
||
1314 | 87 |
=== `water-bottom` === |
1308 | 88 |
The colour of the lowest part of the water before Sudden Death. |
89 |
This makes a gradient together with `water-top`. The default color is blue and matches the default `BlueColor.png`. |
|
90 |
||
91 |
<code>Values: red, green, blue</code> |
|
92 |
||
93 |
<code>Default: $34, $3C, $7D</code> |
|
94 |
||
1314 | 95 |
=== `sd-water-bottom` === |
1308 | 96 |
The colour of the lowest part of the water while in Sudden Death. |
97 |
This makes a gradient together with `sd-water-top`. |
|
98 |
The default color neatly matches the default `SDWater.png`. |
|
99 |
||
100 |
<code>Values: red, green, blue</code> |
|
101 |
||
102 |
<code>Default: $96, $70, $A9</code> |
|
103 |
||
1314 | 104 |
=== `sd-water-top` === |
1308 | 105 |
The colour of the topmost part of the water (under the `SDWater.png`) while in Sudden Death. |
106 |
This makes a gradient together with `sd-water-bottom`. |
|
107 |
The default color neatly matches the default `SDWater.png`. |
|
108 |
||
109 |
<code>Values: red, green, blue</code> |
|
110 |
||
111 |
<code>Default: $B9, $72, $C9</code> |
|
112 |
||
1314 | 113 |
=== `water-opacity` === |
1308 | 114 |
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. |
115 |
||
116 |
In combination with the default `BlueWater.png`, the recommended value for this is `$80`, which also is the default. |
|
117 |
||
118 |
<code>Values: opacity</code> |
|
119 |
||
120 |
<code>Default: $80</code> |
|
121 |
||
1314 | 122 |
=== `sd-water-opacity` === |
1308 | 123 |
The water opacity while in Sudden Death. Syntax and default value is equivalent to `water-opacity`. |
124 |
||
1317 | 125 |
=== `water-animation` === |
1308 | 126 |
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. |
127 |
||
128 |
<code>Values: frames, frame ticks, movement speed</code> |
|
129 |
||
130 |
* `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` |
|
131 |
* `frame ticks`: Duration of a single frame. Must be >0 if `frames`>1, otherwise it is ignored |
|
132 |
* `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 |
|
133 |
||
134 |
<code>Default: 1, 0, 1</code> |
|
135 |
||
1317 | 136 |
This key has been added in 0.9.23. |
137 |
||
138 |
=== `sd-water-animation` === |
|
1308 | 139 |
Sudden Death equivalent of `water-animation`, uses `SDWater.png`. |
140 |
||
1315 | 141 |
== Background keys == |
1314 | 142 |
=== `sky` === |
1308 | 143 |
The colour of the sky. |
144 |
||
145 |
<code>Values: red, green, blue</code> |
|
146 |
||
147 |
<code>Default: $00, $00, $00</code> |
|
148 |
||
1317 | 149 |
This key has been added in 0.9.23. |
150 |
||
1314 | 151 |
=== `rq-sky` === |
1308 | 152 |
The sky color in reduced quality mode. If present, it is used instead of `sky` on low quality. |
153 |
||
154 |
<code>Values: red, green, blue</code> |
|
155 |
||
1314 | 156 |
=== `sd-tint` === |
1308 | 157 |
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. |
158 |
||
159 |
<code>Values: red, green, blue, opacity</code> |
|
464 | 160 |
|
1308 | 161 |
<code>Default: $80, $80, $80, $FF</code> |
162 |
||
1314 | 163 |
=== `clouds` === |
1308 | 164 |
The number of clouds to create, before Sudden Death. Uses `Clouds.png`. |
165 |
||
166 |
<code>Values: number</code> |
|
167 |
||
168 |
<code>Default: 9</code> |
|
169 |
||
1314 | 170 |
=== `sd-clouds` === |
1308 | 171 |
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. |
172 |
||
173 |
<code>Values: number</code> |
|
174 |
||
175 |
<code>Default: 9</code> |
|
176 |
||
1314 | 177 |
=== `flatten-clouds` === |
1308 | 178 |
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). |
179 |
||
1314 | 180 |
=== `flakes` === |
1308 | 181 |
Values for the flakes of this theme before Sudden Death. Uses `Flake.png`. |
182 |
||
183 |
* `number`: Number of visible flakes. |
|
184 |
* `frames`: Number of frames used in `Flake.png` |
|
185 |
* `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. |
|
186 |
* `rotation speed`: How fast the flakes rotate. `0` = no rotation, and all flakes spawn unrotated. With any other value, flakes also spawn with a random rotation |
|
187 |
* `vertical speed`: Vertical speed of the flakes. A positive value makes the flakes fall, while a negative value makes them rise |
|
188 |
||
189 |
<code>Values: number, frames, frame ticks, rotation speed, vertical speed</code> |
|
190 |
||
191 |
No flakes are used by default. |
|
192 |
||
1314 | 193 |
=== `sd-flakes` === |
1308 | 194 |
Sudden Death version of `flakes`, the parameters are the same as in `flakes`. This uses `SDFlake.png`. |
195 |
||
196 |
<code>Values: number, frames, frame ticks, rotation speed, vertical speed</code> |
|
197 |
||
198 |
If `sd-flakes` is unspecified, skulls and bones are used as images and the following default values are used: |
|
199 |
||
200 |
<code>Default: X, 4, 0, 15, 250</code> |
|
201 |
||
202 |
(The “X” means the default number of Sudden Death flakes is variable. It depends on the window size and the terrain width.) |
|
203 |
||
1314 | 204 |
=== `flatten-flakes` === |
1308 | 205 |
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. |
206 |
||
207 |
||
1315 | 208 |
== Music keys == |
1314 | 209 |
=== `music` === |
1308 | 210 |
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! |
211 |
||
212 |
If you choose a custom music (i.e. a music which does not come with Hedgewars by default), you should also set `fallback-music`. |
|
213 |
||
214 |
<code>Values: filename</code> |
|
215 |
||
216 |
No music is played by default. |
|
217 |
||
218 |
Example: |
|
219 |
<code>music = Nature.ogg</code> |
|
220 |
||
1314 | 221 |
=== `sd-music` === |
1308 | 222 |
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! |
223 |
||
224 |
If you choose a custom music, you should also set `fallback-sd-music`. |
|
225 |
||
226 |
<code>Values: filename</code> |
|
227 |
||
228 |
Default: `sdmusic.ogg` (only if `music` was specified, no music otherwise) |
|
229 |
||
1314 | 230 |
=== `fallback-music` === |
1308 | 231 |
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. |
232 |
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. |
|
233 |
||
234 |
Note that if Hedgewars fails to find a music, it defaults to silence. |
|
235 |
||
236 |
Example usage (in combination with `music`): |
|
237 |
<code>music = My_Custom_Music.ogg |
|
238 |
fallback-music = Nature.ogg</code> |
|
239 |
||
1314 | 240 |
=== `fallback-sd-music` === |
1308 | 241 |
Like `fallback-music`, except it's for `sd-music`. |