Terrain script

From SIMboxWiki
Jump to navigation Jump to search

The terrain script is a text file that allows you to control the display properties of a given terrain.

Format

Sample

 terrain
 {
 	infrared
 	{
 		texture_temperature <texture name> <temperature calculation type> <minimum value> <maximum value>
 		texture_temperature <texture name> <temperature calculation type> <minimum value> <maximum value>
 		..
 	}
 }

Properties

texture_temperature

Defines how the temperature of the terrain is calculated in different areas of the terrain. This calculation is based on run-time values of general minimum and maximum temperature. This property will influences the way the terrain is drawn under infrared cameras.

The <texture name> attribute defines the area on which the temperature calculation needs to be performed. Each area is defined by the texture name which it uses. This attribute should be either a textures file name (without the path), or the reserved symbol "*" that will specify that the given calculation should be the default calculations.

The <temperature calculation type> attribute defines the type of calculation to be performed. Options are range_relative, bounds_relative, absolute or none.

  • range_relative - Calculation is done relative to the range between the run-time terrain temperature values.
  • bounds_relative - Calculation is done relative to the minimum and maximum temperature values.
  • absolute - The temperature are fixed and do not take into consideration the run-time temperature values.
  • none - The default calculation is performed

The <temperature calculation type> is combined with the <minimum value> and <maximum value> and the run-time terrain temperature values to calculate the final temperature range of a given area. For example under the conditions of:

  • <minimum value> is equal to 0.2.
  • <maximum value> is equal to 0.5.
  • Minimum run-time terrain temperature is equal to 10.
  • Maximum run-time terrain temperature is equal to 20.

The following calculation will be made:

  • If <temperature calculation type> is range_relative then:
    • Final minimum temperature will be 10 + (20 - 10) * 0.2 = 12.
    • Final maximum temperature will be 20 + (20 - 10) * 0.5 = 25.
  • If <temperature calculation type> is bounds_relative then:
    • Final minimum temperature will be 10 + 0.2 = 10.2.
    • Final maximum temperature will be 20 + 0.5 = 20.5.
  • If <temperature calculation type> is absolute then:
    • Final minimum temperature will be 0.2.
    • Final maximum temperature will be 0.5.
  • If <temperature calculation type> is none then:
    • Final minimum temperature will be 10.
    • Final maximum temperature will be 20.

Placement

In order for the system to recognize and load the terrain script, place the file containing this script in the same directory that houses the main OpenFlight file. The script file should have the same name as the main OpenFlight file, but with an extension of ".terrain" instead of ".flt".