Terrn file description
From Rigs of Rods Wiki
Contents |
Basics
The .terrn file is a text file containing the following information, in this precise order:
- Name of the terrain: it must be the first line of the file!
- Name of the .cfg file associated to the terrain (must be the second)
- (optional) If you want water in the terrain, put the character 'w' followed by the water height relative to the lowest point of your terrain. For example:
- (optional) For Caelum lighted terrains, add a line here with the text "Caelum". A Caelum-lighted terrain is a terrain that has 12 extra textures to have the mountain shadows match with the sun position.
- Sky color: red, green, blue components (between 0 and 1)
- Spawning positions: a set of two or three X,Y,Z coordinates.
- The first coordinate is the truck spawn position (when buying a new truck)
- The second is the initial camera spawn position
- (optional) The third is the initial character spawn position.
- (optional) sandstormcubemap Sky/EarlyMorning cube map used on this terrain. Example at 0.36 version in aspen.
- A set of lines, each line positioning an object or a truck on the terrain. At this stage, you can put comments by starting the line with "//".
- The content of the line is: X, Y, Z, RX, RY, RZ, object_name
- The values X,Y,Z are the position of the object
- RX,RY,RZ the rotation of the object
- The object_name is the name of an .odef file, but without its file extension
- You can add more optional parameters to add labels to the map:
- The first extra parameter is a qualifier (village, hotel, observatory, etc.)
- The second is the place name. If you want to put a truck or load in the map, use the keyword "truck" or "load" in place of the object_name, and put the truck or load name after (with the extension).
- The content of the line is: X, Y, Z, RX, RY, RZ, object_name
- The keyword "end"
NOTE: If you add truckshop, hangar, marina or any building you can buy vehicles, the section 8-2 is required!
Examples: A terrn file in its simplest form:
Angle angle.cfg 0.93, 0.86, 0.76 509,6,680, 509,6,680 end
A more complex terrn file, with water and a few objects (using 8-2 section):
North St Helens nhelens.cfg w 33 0.93, 0.86, 0.76 1169.0,35,948.75, 1220,36,980, 1165.5, 35, 942 //a truck 1190, 35, 930, 0, 0, 0, truck wrecker.truck //a load 1130, 35, 910, 0, 0, 0, load acontainer.load //an object 1180, 34.15, 950, 0, 20, 0, truckshop shop Rig-a-Deal 1220, 34.15, 980, 0, 20, 0, truckshop shop Rig-a-Deal-2 1280, 34.15, 960, 0, 20, 0, load-spawner sale spawn_Zone_1 1310, 34.15, 950, 0, 20, 0, load-spawner sale spawn_Zone_2 1390, 34.15, 950, 0, 20, 0, myhangar2 repair Repair_Zone_1 end
Author information
Append something like this inside your file:
//author terrain 4 pricorde //author objects 4 pricorde
The format is described here. Do not forget the '//' !
Grass
This enables you to add grass to the terrain. The arguments are (all on one line!):
For example 7 grass types plus sea grass (water level is 10):
// format: grass range, SwaySpeed, SwayLength, SwayDistribution, Density, minx, miny, maxx, maxy, fadetype, minY, maxY, material colormap densitymap grass 200, 0.5, 0.05, 10, 0.1, 0.2, 0.2, 1, 1, 1, 0, 9, seaweed none none grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass1 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass2 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass3 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass4 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass5 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 0.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass6 aspen.jpg aspen_grass_density.png grass 200, 0.5, 0.05, 10, 3.3, 0.2, 0.2, 1, 1, 1, 10, 0, grass7 aspen.jpg aspen_grass_density.png
Trees
//trees yawFrom, yawTo, scaleFrom, scaleTo, highDensity, distance1, distance2, meshName colormap densitymap trees 0, 360, 0.1, 0.12, 2, 60, 3000, fir05_30.mesh aspen-test.dds aspen_grass_density2.png trees 0, 360, 1, 3, 1, 60, 3000, tree.mesh aspen-test.dds aspen_grass_density2.png trees 0, 360, 1, 2, 1, 60, 3000, tree2.mesh aspen-test.dds aspen_grass_density2.png trees 0, 360, 0.1, 0.13, 1, 60, 3000, fir06_30.mesh aspen-test.dds aspen_grass_density2.png trees 0, 360, 0.1, 0.13, 1, 60, 3000, fir14_25.mesh aspen-test.dds aspen_grass_density2.png trees 0, 360, 0.1, 0.2, 3, 60, 3000, plant1.mesh aspen-test.dds aspen_grass_density.png trees 0, 360, 0.1, 0.2, 3, 60, 3000, plant2.mesh aspen-test.dds aspen_grass_density2.pngarguments:
- yawFrom-yawTo: that is the range which the game will choose to randomly rotate the trees
- scaleFrom-scaleTo: scaling range that the game uses randomly. 0=0%, 1=100%
- highDensity : density factor: 0=0, 1=not much, 2=more, etc
- distance1: distance to which the game should use the mesh instead of the billboard. This is performance critical, use low values if possible!
- distance2: distance to which the billboard should be drawn (max sight range)
- meshName : the mesh to use
- colorMap : used to colorize the mesh. if your mesh is too dark check the colormap! Can be set to none to disable it.
- densityMap: texture that determines where and how much trees are used. white = 100%, black = 0%
Races
This section is out of date and needs updating to correspond with Lua races
A typical race looks like this (3 coordinates with 3 rotational references)
//road race 1788.565918, 13.523803, 2188.309326, 0.000000, -75.000000, 0.000000, chp-start race race_Roadkill_0_16_0 1272.392822, 52.455555, 2639.341553, 0.000000, -25.000000, 0.000000, chp-checkpoint race race_Roadkill_1 976.396179, 139.362503, 2253.451660, 0.000000, 35.000000, 0.000000, chp-checkpoint race race_Roadkill_2 610.334473, 122.214699, 2292.108643, 0.000000, 30.000000, 0.000000, chp-checkpoint race race_Roadkill_3 425.260101, 154.688690, 1892.544434, 0.000000, 45.000000, 0.000000, chp-checkpoint race race_Roadkill_4 326.887360, 175.461609, 1637.232178, 0.000000, 20.000000, 0.000000, chp-checkpoint race race_Roadkill_5 207.137665, 190.209656, 1017.338806, 0.000000, -5.000000, 0.000000, chp-checkpoint race race_Roadkill_6 598.222473, 204.074921, 721.008057, 0.000000, -90.000000, 0.000000, chp-checkpoint race race_Roadkill_7 871.652405, 185.921021, 887.720337, 0.000000, -130.000000, 0.000000, chp-checkpoint race race_Roadkill_8 1244.441284, 101.542374, 1086.691650, 0.000000, -120.000000, 0.000000, chp-checkpoint race race_Roadkill_9 1534.553711, 88.164223, 755.955933, 0.000000, -35.000000, 0.000000, chp-checkpoint race race_Roadkill_10 1659.338379, 114.786842, 259.588989, 0.000000, -20.000000, 0.000000, chp-checkpoint race race_Roadkill_11 1745.098389, 125.204323, 457.132690, 0.000000, 90.000000, 0.000000, chp-checkpoint race race_Roadkill_12 1959.770996, 95.293251, 363.643250, 0.000000, 40.000000, 0.000000, chp-checkpoint race race_Roadkill_13 2001.199341, 41.409641, 802.094543, 0.000000, 90.000000, 0.000000, chp-checkpoint race race_Roadkill_14 2251.579834, 13.595664, 1292.946655, 0.000000, 190.000000, 0.000000, chp-checkpoint race race_Roadkill_15
Format:
- It begins with chp-start race race_(racename)_0_(amount of checkpoints + 1)_(number of goal checkpoint)
- From there reference chp-checkpoint with race_(racename)_(checkpoint number)
- Racename must be the same in one race
- Use 0 as goal checkpoint for a round course
Missions
Missions use triggers which can generate events with LUA. For example:
1829.785156, 13.413086, 2222.167969, 0.000000, 0.000000, 0.000000, persontrigger trigger mission_aspen_1_start 1833.785156, 13.413086, 2222.167969, 0.000000, 0.000000, 0.000000, trucktrigger trigger mission_aspen_1_trailer 2197.2, 16.8624, 1946.06, 0, -100.381, 0, planetrigger trigger mission_aspen_airtutorial_trigger1
There are three triggers:
- persontrigger
- trucktrigger
- planetrigger
The Format of missions is: (trigger-type) trigger mission_(missionname)_(triggername)
- missionname : a lua file must exists for this mission: /data/mission_(missionname).lua
- triggername : this name can be used inside LUA to differentiate the triggers
Procedural Roads
begin_procedural_roads
//position x,y,z rotation rx,ry,rz, width, border width, border height, type
0,0,0, 0,0,0, 10.0, 0, 0, flat
0,0,0, 0,0,0, 10.0, 0.25, 1.0, both
end_procedural_roads
valid types:
- flat
- left - Only left border
- right - Only right border
- both - Both borders
- bridge
- bridge_no_pillars
| Requires |
| 0.35 |
| or later |
- monorail (0.35+)
- monorail2 (0.35+)
You can view some examples of various settings.
Mpspawn
Mpspawn is used for spawning boats and airplanes on multiplayer. The syntax is
mpspawn airplane 2192.29 16.3357 1963.89 0 260 0 mpspawn boat 1741.8 5.58322 2291.23 0 68,091 0
The line starts with "mpspawn airplane" (for airplanes) or "mpspawn boat" (for boats)
The first three numbers are the X, Y and Z coordinates of the spawning point. The next three numbers are X rotation, Y rotation and Z rotation.
If these lines do not exist in the terrn code, the game will eventually crash or the vehicle will spawn at the standard spawning position
Caelum Sky
you can select which sky to use by adding a one-liner:
caelumconfig some_sky
the default is "ror_default_sky".
the sky must be defined in a .os file.
for example to use some_sky create a file "my_terrain_sky.os" and put beside your other terrain files and put the following into it:
caelum_sky_system some_sky
{
// J2000
julian_day 2451545.0
time_scale 1
point_starfield {
magnitude_scale 2.51189
mag0_pixel_size 16
min_pixel_size 4
max_pixel_size 6
}
manage_ambient_light true
minimum_ambient_light 0.1 0.1 0.3
manage_scene_fog yes
ground_fog_density_multiplier 0.0015
scene_fog_density_multiplier 0.0015
sun {
ambient_multiplier 1 0.5 0.5
diffuse_multiplier 3 3 2.7
specular_multiplier 5 5 5
auto_disable_threshold 0.05
auto_disable true
}
moon {
ambient_multiplier 1 0.2 0.2
diffuse_multiplier 1 1 .9
specular_multiplier 1 1 1
auto_disable_threshold 0.05
auto_disable true
}
// Off by default
/*
depth_composer {
debug_depth_render on
haze_enabled no
ground_fog_enabled no
ground_fog_vertical_decay 0.06
ground_fog_base_level 0
}
*/
sky_dome {
haze_enabled yes
sky_gradients_image EarthClearSky2.png
atmosphere_depth_image AtmosphereDepth.png
}
cloud_system
{
cloud_layer
{
height 3000
coverage 0.9
}
}
}

