openOMSI GitHub Discord
Modding overview

Docs / Making content / Modding overview

Lights

3 min readEdit this pagedocs/MODDING.md

On this page
  1. Extra spotlights
  2. Picture spotlights

Extra spotlights#

[spotlight_2] in model.cfg is a spotlight of its own. Low beam, main beam, fog lamps or a lamp over a door can light the road together, each switched by its own variable. They add to the one [spotlight] that Spot_Select picks.

[spotlight_2]
0.95
5.95
0.652
0
1
-0.3
255
255
233
200
30
80
lights_fern
0

The values, one per line:

Lines Meaning
1-3 Position x, y, z
4-6 Direction x, y, z
7-9 Red, green, blue (0-255)
10 Range (m)
11-12 Inner and outer cone angle
13 Variable: 0 off, 1 full, between dimmed. A number is a constant.
14 0 (or left out): a mirrored pair. 1: a single lamp.
  • With flag 0, a twin lamp stands on the other side, mirrored across the vehicle's axis. Put the position on one headlamp. A pair is as bright as one [spotlight] of the same colour.
  • With flag 1 there is one lamp, for example over a door or a cornering lamp.
  • The position is used as written. Unlike a [spotlight], it is not moved to the vehicle's front.
  • A rear section's model may have its own. Their variables are the bus's.

Picture spotlights#

[spotlight_cookie] is a lamp whose beam is a picture: the picture is what the lamp would show on a wall in front of it.

[spotlight_cookie]
0.9
5.85
0.75
0
1
-0.04
255
250
235
80
70
30
lowbeam_right.png
lights_main
0.15
cornering_yaw
Lines Meaning
1-3 Position x, y, z
4-6 Direction x, y, z
7-9 Red, green, blue (0-255)
10 Range (m)
11 Horizontal angle the picture covers (degrees)
12 Vertical angle the picture covers (degrees)
13 The picture
14 Switching variable
15 Optional: fade time (s)
16 Optional: variable that turns the lamp right (degrees)
17 Optional: variable that turns the lamp up (degrees)
  • The picture's right is the lamp's right, seen from behind the lamp.
  • White is as bright as a headlamp's strongest beam. Black is no light.
  • The Enhanced renderers draw up to eight different pictures at once.
  • The classic renderer, and a lamp whose picture is missing, light a plain cone instead.

Sobol's buses (MAN Enhance V4, Urbino III and others) write a shorter layout with the same keyword. The picture carries the colour there, so there are no colour numbers or cone angles:

[spotlight_cookie]
0.71507
5.82032
0.67736
0
1
0
200
lights_fern_front_1
0
cookie_fern_H4_lens.png
0.05
lamp_pitch
lamp_yaw
Lines Meaning
1-3 Position x, y, z
4-6 Direction x, y, z
7 Range (m)
8 Switching variable (a number is a constant)
9 Flag: 0 (or left out) for a twin across the vehicle's axis, 1 for the one lamp
10 The picture, in the vehicle's texture folder
11 Optional: fade time (s)
12 Optional: variable that turns the lamp up (degrees)
13 Optional: variable that turns the lamp right (degrees)

The picture is 1280 x 1024, 0.09375 degrees a pixel (-60 to 60 across, 36 to -60 up/down); the lamp covers that whole frame. The twin's place and direction are mirrored, but its offsets are not, so both beams steer the same way. The two offsets come in the opposite order from the openOMSI layout above.

A block with no picture name after the flag is read in the openOMSI layout, so both can live in one model.

With shadows on, the player's headlamps also cast shadows in Enhanced. The front lamps that light the road share one shadow map.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open