With each new game patch we are also shipping modding guides for users to be able to get their existing mods up-to-date.
Page is organizing modding guides by patch version numbers.
Contents
Misc useful commands
- Running the game with -unlimitedlog command line parameter will disable the standard 1MB limit on size of game log file. This might be useful during update if you want to focus on some bugs first.
- Running the game with -validate command line parameter or executing validate command on the console will run special game mode which will load all defined models, prefabs, vehicles and other objects to detect missing textures and similar errors. By examining the game log you can determine what the game was trying to do when error appeared. Note that there is still lot of things which might be wrong which are not checked in this mode.
- Running the game with -error_overlay command line parameter will show overlay with number of error and warning messages printed to the log once at least one such message is printed.
Patch: 1.22
Recommendations
- Some new models utilizing the "fr" suffix or prefix are still work in progress and it is likely that they might change significantly in some next patch. For this reason it is recommended that you avoid using them in your mods at this time.
- When basing you model on the original ones, add to your mod also ALL original /automat/ files used by it. The names of the files are generated as SHA1 hash of theirs content so whenever we change the parameters of the material in any way, a different file will be used to store them and the original file might cease to exist if there is no other model utilizing the original parameters.
- When modifying original models, always include ALL compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
- As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is HIGHLY RECOMMENDED to use suffix or prefix in the name to avoid conflicts with new objects we are adding in patches. Otherwise you might have to use the batch renaming functionality (see Batch renaming) to fix the conflicts when new patch appears.
How to convert map
- Temporarily store vegetation.old.sii file into /def/world/vegetation.old.sii to make old definitions of vegetation profiles accessible.
- Store this replacement script Documents\Euro Truck Simulator 2\replace.sii
- Open the map in the editor
- If the log contains references to missing road looks
- Provide dummy definitions for them. Otherwise the editor will crash during save or some other operations.
- Locate items using those dummy definitions and change them to other suitable looks
- Open the replacement dialog (F3)
- Run "Batch replace"
- Save map
- Do rebuild (F8)
- Save map
- Remove dummy road look definitions, if any
- Remove vegetation.old.sii
Changes
Vegetation profiles
As most of the information previously set by the vegetation profile was moved into the map items, we cleaned up the vegetation templates. Use the attached files (see #How to convert map) to convert the map from the old profiles into the new ones.
Models
We cleaned folder structure of models and some files from DLC Scandinavia were moved to the base. As part of the cleanup content of asset_shared was moved to model2/prefab2 folders. Also some unfinished *_fr files were removed.
As long your map mod is not overriding our /def/world/*.sii files nor depending on those unfinished files, it should be fine. Otherwise you will need to update the definition file with the new paths or replace the referenced objects with something else. If your mod is overriding one from the affected models, you will need to move the models to the new path.
Map
When saving the map, the editor now creates separate file europe.set to store selection sets. That file is not used by game itself and does not have to be included in mod.
Patch: 1.20
Recommendations
- Some new models utilizing the "fr" suffix or prefix are still work in progress and it is likely that they might change significantly in some next patch. For this reason it is recommended that you avoid using them in your mods at this time.
- When basing you model on the original ones, add to your mod also ALL original /automat/ files used by it. The names of the files are generated as SHA1 hash of theirs content so whenever we change the parameters of the material in any way, a different file will be used to store them and the original file might cease to exist if there is no other model utilizing the original parameters.
- When modifying original models, always include ALL compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
- As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is HIGHLY RECOMMENDED to use suffix or prefix in the name to avoid conflicts with new objects we are adding in patches. Otherwise you might have to use the batch renaming functionality (see Batch renaming) to fix the conflicts when new patch appears.
How to convert map
- Ensure that the log contains no errors related to vegetation profiles. Load of the map in old format will bake most of that information into the map file so it is critical that the information is correct before continuing with the conversion.
- Use the replacement dialog (F3, "Prefab node correction") to add new prefab nodes which we added to some ferry prefabs in Scandinavia.
- Save map
- Do rebuild (F8)
- Save map
Changes
AI vehicle type definition
To specify spawned trailer count per vehicle, use the array attribute spawn_trailer_count. It defines the array of possible trailer counts for gived vehicle type. Before each AI vehicle is spawned, the game randomly selects one of the value from the array. So far, only values 0 and 1 are supported. For example:
# Set the trailer spawn probability to 75%: # spawn_trailer_count[]: 0 spawn_trailer_count[]: 1 spawn_trailer_count[]: 1 spawn_trailer_count[]: 1
Currently, the default trailer spawn probability for trucks is 90%.
AI vehicle definition
To allow better control over AI trailer spawning, the meaning of attribute attachable_trailer has been modified:
BEFORE - when choosing a trailer model to spawn, the game randomly selects one, which name matches ANY OF THE STRINGS contained in the array
NOW - when choosing a trailer model to spawn, the game randomly selects ONE OF THE STRINGS contained in the array and then selects a model which name matches the selected string. This allows specifying spawn probability for specific trailer models. Furthermore, this attribute supports wildcard '*' - it can be placed at the beginning of any string, at the end of any string or both (beginning and end) to allow partial trailer name matches.
To allow all trailer models, use attachable_trailer[]: ""
or attachable_trailer[]: "*"
Spawned trailer count can be set also per-vehicle by using attribute trailer_count. It works the same way as spawn_trailer_count defined per-vehicle-type
AI trailer definition
It is now possible to specify, to which AI vehicles can each AI trailer be attached - using array attribute allowed_tractor. This attribute supports wildcard '*' - it can be placed at the beginning of any string, at the end of any string or both (beginning and end) to allow partial name matches. For example:
# Allow this trailer be attached only to a single vehicle allowed_tractor[]: "traffic.scania_r_a"
By default, all vehicles are allowed.
Vegetation profiles
Most of the information previously stored in vegetation profiles, except for the list of models, is now stored per-item inside map to allow for easy local tweaks. Note that when converting from older map format, the editor will extract that information from vegetation profile and store it inside the map. From that moment the corresponding information inside the vegetation profile is ignored and only the list of models is used.
Note that because of changes in the accuracy of the stored values, some objects might slightly move as result.
Environment & skyboxes
Sun profiles (climate/default/nice.sii, bad.sii) are not bound to time anymore, rather to sun position. Thus low_elevation and high_elevation define interval when the profile is used. Meaningful range is -90 to 90 degrees, with 5 degree step. It works same as before, during given interval sun profile is present alone, outside of the interval it starts to blend with its neighbour. The only complication is sun_direction, that is used for splitting morning and afternoon profiles for same elevation (+1 = rising sun / morning; -1 = falling sun / afternoon; 0 = use profile for both).
Sun position is computed from actual time and truck position. Conversion formula from map coordinates to earth coordinates (namely latitude) is in climate profiles (climate.sii) as latitude_a and latitude_b values, so its possible to make differently positioned earth zones on single map just by choosing different climate profile. Some additional data are in environment data (env_data.sii) - day_in_year (172 = summer solstice), summer_time (+1h).
Patch: 1.19
Recommendations
- Some new models utilizing the "fr" suffix or prefix are still work in progress and it is likely that they might change significantly in some next patch. For this reason it is recommended that you avoid using them in your mods at this time.
- When basing you model on the original ones, add to your mod also ALL original /automat/ files used by it. The names of the files are generated as SHA1 hash of theirs content so whenever we change the parameters of the material in any way, a different file will be used to store them and the original file might cease to exist if there is no other model utilizing the original parameters.
- When modifying original models, always include ALL compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
- As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is HIGHLY RECOMMENDED to use suffix or prefix in the name to avoid conflicts with new objects we are adding in patches. Otherwise you might have to use the batch renaming functionality (see Batch renaming) to fix the conflicts when new patch appears.
How to convert map
- If your mod overrides signs.sii or sign.dlc_north.sii, you need to update those files to account for us moving some signs from DLC Scandinavia to base.
- Convert AI model storage definitions to the new format
- Convert the road look definitions to the new format.
- Convert the speed limit and license plate definitions in country data to the new format.
Changes
AI vehicle model storage
For each supported vehicle type (currently: car, truck, bus) a separate unit exists in /def/vehicle/traffic_vehicle_type.sii. These units contain paths to actual model storage for given vehicle type (e.g. /def/vehicle/traffic_storage_car.sii)
AI trailer model storage
For each supported trailer type (currently: semi_trailer) a separate unit exists in /def/vehicle/traffic_trailer_type.sii. These units contain paths to actual model storage for given trailer type (e.g. /def/vehicle/traffic_storage_semi_trailer.sii)
AI vehicle definition
Property attachable is now obsolete. It has been replaced by an array attribute attachable_trailer. The array contains unit names (as strings) of all trailer models which can be attached to the given vehicle.
To allow all trailer models, add an empty string at the beginning of the array:
attachable_trailer[]: ""
AI trailer definition
To allow future features and improvements, the type of the unit defining an AI trailer CHANGED FROM trailer
TO traffic_trailer
For example:
trailer : traffic.trailer.fuel_cistern
changes to
trafic_trailer : traffic.trailer.fuel_cistern
Road look definition
The lane_count_left, lane_count_right and ai_speed_type attributes are now obsolete. They were replaced by lanes_left and lanes_right arrays. (The array items are ordered from the center of the road to the borders) This allows specifying some traffic lane attributes for each lane separately - see "Traffic lane definition"
Traffic lane definition
Traffic lane definitions can be found in /def/world/traffic_lane.sii.
License plate definition
The definitions of per-country license plates were moved into separate /def/country/<country_name>/license_plates.sii file. It contains separate unit for each vehicle type (car, truck, bus). If more than one unit exists for some type, the game will use the first unit it encounters.
Country speed limit definition
The definitions of per-country speed limits were moved into separate /def/country/<country_name>/speed_limits.sii file. It contains separate unit for each vehicle type (car, truck, bus). If more than one unit exists for some type, the game will use the first unit it encounters.
Vehicle changes
Separate interior model
The cabin interior now uses separate model for rendering from external views. That model is defined using new ext_model, ext_variant and ext_look attributes of interior accessory.
Editor changes
- The toolbar window and editor window were combined into one.
- Editor window can be resized, docked, maximized.
- Resolution can be choosed from menu View > Resolution.
- Mouse cursor behaves significantly better.
- Free camera can be rotated with right mouse button (RMB).
- Several items can be combined into one by "Ctrl+G" or from menu Tools > Compound Selection.
3D move manipulator
- Editor contains 3D move manipulator ("gizmo").
- Move manipulator can lock movement along one axis when X, Y or Z pressed.
- Move manipulator can lock movement along one plane when Shift+X, Shift+Y or Shift+Z pressed.
- Eg. Shift+Y means that movement does not change in Y axis.
Grid
- Editor can render grid when enabled from menu View > Grid.
- On toolbar you can enable/disable Snap to grid and Snap to nodes.
- Beware: Grid is placed in zero height, if you have items in different height, the snapping may seem weird as it is distorted by perspective.