Road-hog123

Keywords

A list of [keywords], an explanation of their parameters and the context in which they can be used.

The file(s) that a keyword can be used in are listed after Valid files—Model keywords can usually be used both in a model.cfg file and the file one would be linked from (see [model]).

Some keywords act directly on the result of a previous keyword—those previous keywords are listed after Must follow, and the inverse relationship is listed after Followed by. Keywords that are used together in another way are listed after Used with. Other similar/relevant keywords are listed after See also.

[add_camera_driver]

position x
position y
position z
metres, relative to origin
orbit distance metres
field of view degrees (°), vertical
pan degrees (°), positive right
tilt degrees (°), positive up

Defines a camera for the driver view.

The camera orbits around position at a distance specified by orbit distance—typically this is -0.06, which places the camera with the rotation point behind it to simulate the neck being ~6 cm behind the eyes. The initial horizontal and vertical rotation are set with pan and tilt respectively, and are relative to directly forward.

The right arrow key steps through cameras in the order they occur in the file, the left arrow key steps through them in reverse.

Valid files: Bus, Vehicle
Followed by: [view_schedule], [view_ticketselling]
Used with: [set_camera_std]
See also: [add_camera_pax], [add_camera_reflexion], [add_camera_reflexion_2], [set_camera_outside_center]

[add_camera_reflexion]

position x
position y
position z
metres, relative to origin
orbit distance metres
field of view degrees (°)
pan degrees (°), positive right
tilt degrees (°), positive up

Defines a reflection (mirror) camera.

See [add_camera_driver]orbit distance should always be zero as reflections don't have a neck joint.

Each camera renders to a square virtual texture in the format reflexion0.bmp, where 0 is the zero-based index of the reflection camera.

Valid files: Bus
See also: [add_camera_driver], [add_camera_pax], [add_camera_reflexion_2], [set_camera_outside_center]

[add_camera_reflexion_2]

position x
position y
position z
metres, relative to origin
orbit distance metres
field of view degrees (°)
pan degrees (°), positive right
tilt degrees (°), positive up
culling ???

Defines a reflection (mirror) camera that stops rendering when out of sight.

See [add_camera_reflexion].

culling is a numerical value that should be configured to ensure the mirror stops rendering at the right time—I recommend displaying one reflection camera on all mirrors so you can see when the mirror stops rendering, and then adjust this value until it does so as soon as the true mirror is out of sight.

Valid files: Bus
See also: [add_camera_driver], [add_camera_pax], [add_camera_reflexion], [set_camera_outside_center]

[animparent]

identifier identifier assigned with [mesh_ident]

This mesh inherits the animations from the mesh assigned identifier with [mesh_ident].

For example if the ticket machine or change dispenser is attached to the cab door then all of their many meshes can inherit the cab door animation from the cab door mesh rather than each having their own copy (as was required in OMSI 1).

Valid files: Model (Bus)
Must follow: [mesh]
Used with: [mesh_ident]

[boundingbox]

size x
size y
size z
metres
centre x
centre y
centre z
metres, relative to origin

Defines a cuboid-shaped collider.

The cuboid is centred on centre and has side-lengths size.

Valid files: Sceneryobject, Bus, Vehicle
See also: [collision_mesh], [nocollision]

[char]

character Single ASCII letter, number or symbol
left
right
top
Integer pixel coordinates, inclusive

Defines a character in an OMSI-font.

A character is simply a rectangle of pixels that's mapped to a single-byte text character—the content of the rectangle doesn't have to be representation of character.

The coordinates of the top, left and right edges (inclusive) of the rectangle are set with the respective parameters, the height is the same for all characters in a font.

Valid files: Font
Must follow: [newfont]

[const]

name
value float value

Defines a local constant.

Valid files: Constfile
See also: [newcurve]

[crashmode_pole]

resistance rad/tm/s
break angle rad

Enables and configures "pole" crash simulation.

Poles—whether supporting traffic signs, traffic lights or streetlighting—are fixed to the ground at the base and tend to bend and break at the base when crashed into. This keyword enables and configures simulation of this kind of behaviour for an object.

resistance configures how much bending occurs in a collision based on the colliding vehicle's momentum—a value of 1 means a rotation of 1 radian when hit by a 1 tonne vehicle moving at 1 metre per second.

break angle is the accumulated rotation angle (again in radians) that results in the pole breaking off at the base.

Valid files: Sceneryobject

[illumination_interior]

light 0
light 1
light 2
light 3
Zero-based indexes of [interiorlight] entries

Sets which [interiorlight]s illuminate a mesh.

Meshes without this keyword inherit the lighting from the previous mesh—if the first mesh does not have this keyword, it is lit by [interiorlight]s 0–3.

A zero-based index of a [interiorlight] entry must be provided for each of the four parameters—invalid indexes will raise no error and the mesh will still be lit by any valid indexes, so it is convention to use -1 for parameters you want to leave unused—if you repeat indexes the appearance is identical to increasing that light's brightness by the same factor.

Valid files: Model (Bus)
Must follow: [mesh]
Used with: [interiorlight]

[interiorlight]

brightness value or script variable
brightness multiplier multiplier for script variable
colour r
colour g
colour b
RGB24 colour (0–255)
position x
position y
position z
metres, relative to origin

Defines a point light source inside a bus.

The point light will illuminate the passengers (preventing them from complaining it's too dark in the bus), and by default the meshes of the bus will be vertex-lit by the first four lights. [illumination_interior] can be used to pick which lights illuminate each mesh.

The light source is attached to the previous mesh—if the mesh is animated, the light source will move with it.

position defines the position of the point the light eminates from, brightness (which can be a script variable) and brightness multiplier work together to configure the intensity of the lighting, and colour sets the colour of the lighting.

Valid files: Model (Bus)
Must follow: [mesh]
Used with: [illumination_interior]

[isshadow]

The fake shadow mesh below vehicles is clamped to the ground if it has this keyword.

Valid files: Model (Vehicle, Bus)
Must follow: [mesh]

[light_enh]

position x
position y
position z
metres, relative to origin
colour r
colour g
colour b
RGB24 colour (0–255)
size metres
brightness value or script variable
brightness multiplier multiplier for script variable
z-offset metres
effect +1: starburst, +2: no fog scattering, +4: effect only
time constant seconds for brightness to change by ~63%
alpha bitmap path to texture

Adds an omnidirectional light bloom effect to the current mesh.

A square plane of width and height size is created centred on position, and rotates to always face the camera. If there is geometry close to the light source, z-offset can be used to move the plane towards the camera such that it does not intersect with any geometry.

The plane is textured with red, green and blue channels from colour and alpha from alpha bitmap—if left blank /Texture/light.bmp is used. The alpha channel is additionally multiplied by brightness (which can be a script variable) and brightness multiplier. Sunlight also reduces the alpha to simulate most artificial light sources being dimmer than the sun.

If time constant is zero the brightness of the light effect will directly follow brightness—changes in brightness are instantaneous, like with an LED light source. For incandescent light sources, the brightness should increase and decrease exponentially—~63% of the brightness change will be achieved after time constant seconds, and ~90% after twice that time.

effect is a 3-bit integer made by summing three bit-flags:

  1. starburst
  2. no fog scattering
  3. effect only
A soft-edged circle of light with a faint glow around it; the same but slightly brighter and with 6 radiating rays; the first without the faint glow; the second without the faint glow; just the faint glow; the faint glow with 6 radiating rays; nothing at all; just the 6 radiating rays
From left-to-right, top-to-bottom: a comparison of the 8 possible values of effect (0–7) at night with fog set to 150 metres.
Valid files: Model (Sceneryobject, Vehicle, Bus)
Must follow: [mesh]
See also: [light_enh_2]

[light_enh_2]

position x
position y
position z
metres, relative to origin
direction x
direction y
direction z
unitless vector
rotation axis x
rotation axis y
rotation axis z
unitless vector
omnidirectional 0 = directional, 1 = omnidirectional
rotation mode 0 = no rotation, 1 = pan only, 2 = both pan and tilt
colour r
colour g
colour b
RGB24 colour (0–255)
size metres
inner cone angle degrees (°)
outer cone angle degrees (°)
brightness value or script variable
brightness multiplier multiplier for script variable
z-offset metres
effect +1: starburst, +2: no fog scattering, +4: effect only
cone effect 0 = no cone effect, 1 = yes cone effect
time constant seconds for brightness to change by ~63%
alpha bitmap path to texture

Adds a directional light bloom effect to the current mesh.

When rotation mode is 0 the light effect will not rotate to point towards the camera, remaining pointing towards direction. When it is 1 or 2 the effect will rotate around rotation axis only (pan), or around both pan and tilt, respectively.

When omnidirectional is 1, the effect remains at full brightness regardless of the angle at which the effect is viewed. When it is 0, the effect remains at full brightness only when the angle from direction is less than inner cone angle, with the brightness decreasing outside this angle until reaching zero brightness at outer cone angle.

The circular fog scrattering effect also takes into consideration the angle away from direction, fading out as the angle increases, however it can be complimented with a triangular fog effect to mimic the side of the cone in which the fog is scattering light.

Valid files: Model (Sceneryobject, Bus, Vehicle)
Must follow: [mesh]
See also: [light_enh]

[maplight]

position x
position y
position z
metres, relative to origin
colour r
colour g
colour b
RGB24 colour (0–255)
radius metres

Defines a spherical/point light source that illuminates the map via the tile lightmaps.

The light is at full brightness until radius distance from position, beyond which the brightness decreases with the square of the distance.

Lights defined this way do not exist at runtime—they are used when generating tile lightmaps in the editor, and those lightmaps are then used to illuminate the map at runtime. As a result, if the light from a maplight does not reach the terrain then it does not affect the tile lightmap and so illuminates nothing. If the light does affect the lightmap then that light illuminates everything above it equally—for small objects without [LightMapMapping] the entire object is lit to the brightness of the lightmap below the object's origin, for larger objects with [LightMapMapping] (like junctions and buildings) the lightmap is projected upwards—the ground below and the roof of even a tall building will be lit equally. As such you will have to author your own lightmaps to have light cast realistically onto objects with a lot of verticality (the default streetlights ignore map lighting ([nomaplighting]) and are instead lit by their own lightmaps).

Valid files: Model (Sceneryobject)
Used with: [LightMapMapping], [nomaplighting]

[matl]

texture material texture path
index repeat index

Selects a material from the current mesh to which effects are to be applied.

A material is selected primarily by its texture path, but as multiple materials can have the same texture path, this is supplimented by an index to indicate which occurence of texture should be selected.

Valid files: Model (Sceneryobject, Vehicle, Bus, Human)
Must follow: [mesh]
Followed by: [alphascale], [matl_alpha], [matl_bumpmap], [matl_envmap], [matl_freetex], [matl_lightmap], [matl_nightmap], [matl_transmap], [matl_noZcheck], [matl_noZwrite], [matl_texadress_border], [matl_texadress_clamp], [matl_texadress_mirror], [matl_texadress_mirroronce], [texcoordtransX], [texcoordtransY], [useScriptTexture], [useTextTexture]
See also: [matl_change]

[matl_alpha]

mode 0 = Ignore Alpha, 1 = Clip Alpha, 2 = Blend Alpha

Specifies the transparency blending mode for this material.

By default, and when mode is 0, the material is rendered with no transparency—this is the most efficient blending mode and should be used whenever possible.

When mode is 1, the material is rendered with "clipped" transparency—for screen pixels where the alpha is more than 0.5 the material is opaque just like 0, where the alpha is less than 0.5 the material does not render (as though there was no mesh geometry there). The edges of unrendered regions are aliased just like the edges of geometry, and this mode is almost as efficient as 0.

When mode is 2, the material is rendered with "blended" transparency—instead of overwriting existing pixels the material mixes with the existing pixels based on the alpha value. Transparent areas have no effect on the colour of the existing pixels, however they still occlude and thus prevent from rendering any geometry later in the render order that is further away. This is the least efficient render mode as all affected pixels are mixed even if they are opaque or transparent.

By default the alpha source is the alpha channel of the main/diffuse texture, however [matl_transmap] can be used to specify an alternative texture from which the alpha channel is used.

Valid files: Model (Sceneryobject, Vehicle, Bus, Human), Spline
Must follow: [matl], [texture]
Used with: [matl_transmap]

[matl_transmap]

texture path to texture

Specifies an a texture to use as a transparency map.

Without this keyword the alpha channel of the main/diffuse texture is used as a transparency map. With this keyword the alpha channel of the texture is used as a transparency map instead. Some default assets use a blank value when using the alpha channel as an envmap mask.

Valid files: Model (Sceneryobject, Vehicle, Bus)
Must follow: [matl]
Used with: [matl_alpha]

[model]

model config file path, relative to current file

Specifies an external model config file.

Valid files: Sceneryobject, Vehicle, Bus
See also: [mesh]

[mouseevent]

trigger script trigger name

Makes a mesh clickable.

Valid files: Model (Sceneryobject, Bus)
Must follow: [mesh]

[newcurve]

name

Defines a local constant curve. The points of the curve are added with [pnt].

Valid files: Constfile
Followed by: [pnt]
See also: [const]

[newfont]

font name internal font name
colour bitmap path, relative to current file
alpha bitmap path, relative to current file
height integer
spacing integer

Defines an OMSI-font.

colour bitmap and alpha bitmap must both point to 24-bit bitmap images.

Each rectangle has the same height—the position and width of each character is configured with [char].

spacing pixels will be skipped between each rectangle when displaying the font.

Valid files: Font
Followed by: [char]

[NightMapMode]

mode 0–4, see description

Sets what kind of object/building this is, and therefore what times of day the building is active and wanting/providing illumination when it gets dark (even when that darkness is due to heavy cloud cover).

  1. Street lighting (default): turns on when it gets dark, stays on all night;
  2. Continuous (24/7) lighting: always on, regardless of ambient brightness;
  3. Residential building: turns on when it gets dark, except between ~ and ~ (some random variation);
  4. Commercial building: turns on when it gets dark, except between ~ and ~ (some random variation);
  5. School building: turns on when it gets dark, except between ~ and ~ (some random variation) and on weekends/school holidays.
Valid files: Sceneryobject
Used with: [matl_change], [matl_lightmap], [matl_nightmap], [light_enh], [light_enh_2]

[pnt]

x
y
float value

Adds a point to a constant or sound "curve". The actual shape is a series of straight lines interpolating between each point and horizontal lines extending to infinity beyond the first/last points.

Valid files: Constfile, Sound
Must follow: [newcurve], [volcurve]

[rendertype]

rendertype presurface, surface, on_surface, 1, 2, 3, 4

Sets the sceneryobject's position in the render order.

Without this keyword the sceneryobject's position is 2.

Valid files: Sceneryobject

[spotlight]

position x
position y
position z
metres, relative to origin
direction x
direction y
direction z
unitless vector
colour r
colour g
colour b
RGB24 colour (0–255)
range metres
inner cone angle degrees (°)
outer cone angle degrees (°)

Defines a conical light source that illuminates the map (vertex lighting), to complement the headlight bloom effects.

Several spotlights can be defined, but only one can be active at a time—the outer edge of the area illuminated by a pair of headlights should be approximated with a single conical light. Which light is active is determined by the Spot_Select variable.

The default buses use values of 0, 1 & -0.3 for the direction parameters, which aims the headlights straight forward (no left/right bias) with an ~16° downwards pitch. Some vehicles may bias their headlights towards the nearside.

Surfaces within the inner cone will be illuminated at full brightness, with that brightness falling off linearly to zero at the edge of the outer cone. The actual lighting results will depend on the geometry of the map—low-poly junction objects, while great for performance, can lead to poor illumination results due to their lack of vertices to light.

Valid files: Model (Bus)
See also: [light_enh], [light_enh_2], [interiorlight]

[stringvarnamelist]

count number of stringvarnamelist entries that follow
stringvarnamelist file path

Specifies which string variable declaration file(s) to load.

Valid files: Sceneryobject, Vehicle, Bus
Used with: [script], [varnamelist], [constfile]

[surface]

Enables tyre collision for this object, so the player can drive on it.

Valid files: Sceneryobject
Used with: [collision_mesh]

[surface]

type type code (0–16)

Specifies the type of surface a road surface texture represents; I don't know if this affects anything besides the friction coefficient.

Only 0–2, 4, 6 & 8 are used in default files.

  1. Asphalt (default)
  2. Concrete
  3. Cobblestone
  4. Dirt
  5. Grass
  6. Gravel
  7. Snow
  8. Deep Snow
  9. Slush
  10. Ice
  11. Water
  12. Mud
  13. Sand
  14. Metal
  15. Wood
  16. Small Cobblestone
  17. Interlocking Paver
Valid files: Texture

[texttexture]

variable string variable
font internal font name
width pixels
height pixels
font colour 0 = colour, 1 = font colour
colour r
colour g
colour b
RGB24 colour (0–255)

Defines a virtual texture to which text is written.

A texture width by height is created and initialised with transparent black. The content of variable is written to the texture centre-aligned (overflowing right) in font—note that this is the internal name of a font, not the file name.

When font colour is 1, all 4 texture channels are copied from the font, but when it is 0 the red, green and blue channels are replaced with colour.

For sceneryobjects, variable can be a zero-based label index to be used as text input instead of a script variable.

Valid files: Model (Sceneryobject, Vehicle, Bus)
See also: [texttexture_enh], [useTextTexture], [newfont]

[texttexture_enh]

variable string variable
font internal font name
width pixels
height pixels
font colour 0 = colour, 1 = font colour
colour r
colour g
colour b
RGB24 colour (0–255)
alignment 0: Centre, 1: Left, 2: Right, 3: Centred on spacing, 4: ...shift left, 5: ...shift right
grid pixels

Defines a texture to which text is written, with alignment configuration.

This keyword enhances [texttexture] with two additional parameters:

grid is used with fonts that represent pixel-based displays where the pixels span several texture pixels—the first character will always be aligned to a grid of the specified size. 0 or 1 both disable this feature (aligning to a grid of texture pixels).

alignment sets the text alignment from one of 6 options, divided into two groups:

  1. Centre
  2. Left
  3. Right

0 is the same behaviour as [texttexture], the other two align the text to the left and right sides are you would expect. Text must not be allowed to overflow the left edge of the texture (negative coordinate-space)—Fehler bei Bereichsprüfung: map.translate will be spammed into the logfile and the object or vehicle will not display, possibly breaking the game too.

  1. Centred on nearest letter spacing
  2. Centred on nearest letter spacing to the right
  3. Centred on nearest letter spacing to the left

These centre-aligned options all align the gap between a pair of characters with the centre of the texture, again useful for fonts with a larger grid structure. If the centre-point of a line is within a character 3 will find the nearest gap in either direction, 4 will only look right (putting the longer half of the text to the left) and 5 will only look left. All three overflow to the right if the text is too long.

Valid files: Model (Sceneryobject, Vehicle, Bus)
See also: [texttexture], [useTextTexture], [newfont]

[VFDmaxmin]

min x
min y
min z
metres, relative to origin
max x
max y
max z
metres, relative to origin

Defines the extents of an object for culling purposes.

Objects entirely outside the field of view are not rendered—normally the extents are calculated from the object's geometry, but with this keyword you can define them manually.

None of the uses of this keyword in default files are accompanied by comments to explain why it is being used.

Valid files: Model (Sceneryobject, Vehicle, Bus)

[viewpoint]

viewpoint +1: Player vehicle exterior, +2: Player vehicle interior, +4: Non-player vehicle

Sets the viewpoints from which a mesh should render or a sound should play.

This keyword is important for bus developers to use to optimise their buses such that parts of the exterior not visible from the inside (e.g. matrices) are hidden to improve performance when driving, but most importantly that high-detail meshes suitable for the player vehicle are hidden or replaced for AI vehicles (e.g. replacing or removing detailed cockpit meshes) as any gains from optimisations to AI vehicles will be multiplied by the number of AI vehicles nearby.

viewpoint is a 3-bit integer made by summing three bit-flags:

  1. Player vehicle exterior
  2. Player vehicle interior
  3. Non-player vehicle

By default, and when viewpoint is 0, the mesh is visible or the sound is audible from all viewpoints.

Valid files: Model (Vehicle, Bus), Sound (Vehicle, Bus)
Must follow: [mesh], [sound], [loopsound]

[visible]

variable script float variable
value number, usually an integer

Control mesh visibility with a script variable.

The mesh will only be visible when the value of variable is exactly equal to value, however other visibility-restricting keywords such as [viewpoint] are not overridden.

Valid files: Model (Sceneryobject, Vehicle, Bus)
Must follow: [mesh]