Difference between revisions of "NML:Snow line"

From GRFSpecs
Jump to navigationJump to search
(add nav template)
m (clarify documentation a bit)
Line 8: Line 8:
 
day_of_year(11, 1): 4;
 
day_of_year(11, 1): 4;
 
177: 29;
 
177: 29;
day_of_year(10, 1): 29;
+
day_of_year(10, 1): 50 snow%;
 
}
 
}
 
</pre>
 
</pre>
   
It starts with the <code style="color:darkgreen">snowline</code> keyword followed by the mode. It contains a number of <code style="color:darkgreen">&lt;day-of-the-year&gt; : &lt;height&gt;</code> pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. Heights run from 2 (for snow everywhere) to 29, although 17 is already sufficient to remove all traces of snow from the game.
+
It starts with the <code style="color:darkgreen">snowline</code> keyword followed by the mode. It contains a number of <code style="color:darkgreen">&lt;day-of-the-year&gt; : &lt;height&gt;</code> pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. Heights run from 0 to 255 in levels above sea level. Thus a value of 17 is already sufficient to remove all traces of snow from the game. And any value lower than 2 will cover the whole map in snow. If you use the unit 'snow%' then the values are scaled to the available height difference, thus to values between 0 and 17.
   
 
For the days not listed, the program computes a height. It can do that in two modes, namely in <code style="color:darkgreen">equal</code> mode and in <code style="color:darkgreen">linear</code> mode (last line of text in the example). In <code style="color:darkgreen">equal</code> mode, the height of the snow is the same as the day before, unless the day is listed in the <code style="color:darkgreen">snowline</code> statement. In <code style="color:darkgreen">linear</code> mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around' at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.
 
For the days not listed, the program computes a height. It can do that in two modes, namely in <code style="color:darkgreen">equal</code> mode and in <code style="color:darkgreen">linear</code> mode (last line of text in the example). In <code style="color:darkgreen">equal</code> mode, the height of the snow is the same as the day before, unless the day is listed in the <code style="color:darkgreen">snowline</code> statement. In <code style="color:darkgreen">linear</code> mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around' at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.

Revision as of 17:51, 11 May 2014

Block Syntax

The snowline is specified by a snowline statement. See the example below:

 snowline (linear) {
 	day_of_year(2,  1):  2;
 	day_of_year(11, 1):  4;
 	177: 29;
 	day_of_year(10, 1): 50 snow%;
 }

It starts with the snowline keyword followed by the mode. It contains a number of <day-of-the-year> : <height> pairs. These define the height of the snowline at that day in the year. The day of the year value is actually an integer from 1 up to and including 365, so you may also define a day as a number. Heights run from 0 to 255 in levels above sea level. Thus a value of 17 is already sufficient to remove all traces of snow from the game. And any value lower than 2 will cover the whole map in snow. If you use the unit 'snow%' then the values are scaled to the available height difference, thus to values between 0 and 17.

For the days not listed, the program computes a height. It can do that in two modes, namely in equal mode and in linear mode (last line of text in the example). In equal mode, the height of the snow is the same as the day before, unless the day is listed in the snowline statement. In linear mode, the height of the snowline gets linearly interpolated between two heights specified in the statement. In both cases, note that days `wrap around' at the end of the year, to get the snow height of January 1st (if not listed in the statement), the last specified height of the year is used in the calculation.