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.
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.
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.
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).
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.
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.
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.
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.
+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:
starburst
no fog scattering
effect only
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.
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.
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).
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.
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
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.
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).
Street lighting (default): turns on when it gets dark, stays on all night;
Continuous (24/7) lighting: always on, regardless of ambient brightness;
Residential building: turns on when it gets dark, except between ~ and ~ (some random variation);
Commercial building: turns on when it gets dark, except between ~ and ~ (some random variation);
School building: turns on when it gets dark, except between ~ and ~ (some random variation) and on weekends/school holidays.
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.
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.
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.
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:
Centre
Left
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.
Centred on nearest letter spacing
Centred on nearest letter spacing to the right
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.
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.
+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:
Player vehicle exterior
Player vehicle interior
Non-player vehicle
By default, and when viewpoint is 0, the mesh is visible or the sound is audible from all viewpoints.
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.