Difference between revisions of "Games/ETS2/Modding guides"

From SCS Modding Wiki
Jump to navigation Jump to search
(Patches)
(Updates)
 
(39 intermediate revisions by 4 users not shown)
Line 1: Line 1:
With each new game patch we are also shipping modding guides for users to be able to get their existing mods up-to-date.
+
With each new game update 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.
+
Page is organizing modding guides by update version numbers.
  
 
= Misc  useful commands =
 
= Misc  useful commands =
<ul>
 
<li>Running the game with <strong>-unlimitedlog</strong> 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.</li>
 
<li>Running the game with <strong>-validate</strong> command line parameter or executing <strong>validate</strong> 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.</li>
 
<li>Running the game with <strong>-error_overlay</strong> 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.</li>
 
</ul>
 
  
= Patches =
+
* Running the game with <strong>-unlimitedlog</strong> 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 <strong>-validate</strong> command line parameter or executing <strong>validate</strong> 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 <strong>-error_overlay</strong> 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.
  
* [[Games/ETS2/Modding Guides/1.22]]
+
= Updates =
* [[Games/ETS2/Modding Guides/1.20]]
 
* [[Games/ETS2/Modding Guides/1.19]]
 
* [[Games/ETS2/Modding Guides/1.17]]
 
* [[Games/ETS2/Modding Guides/1.16]]
 
* [[Games/ETS2/Modding Guides/1.15]]
 
* [[Games/ETS2/Modding Guides/1.14]]
 
* [[Games/ETS2/Modding Guides/1.11]]
 
* [[Games/ETS2/Modding Guides/1.9]]
 
* [[Games/ETS2/Modding Guides/1.4.1]]
 
  
= Patch: 1.20 =
+
* [[Games/ETS2/Modding guides/1.51]]
 
+
* [[Games/ETS2/Modding guides/1.50]]
== Recommendations ==
+
* [[Games/ETS2/Modding guides/1.49]]
<ul>
+
* Games/ETS2/Modding guides/1.48.5
<li> 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.
+
* Games/ETS2/Modding guides/1.48
</li> <li> When basing you model on the original ones, add to your mod also <strong>ALL</strong> 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.
+
* [[Games/ETS2/Modding guides/1.47]]
</li> <li> When modifying original models, always include <strong>ALL</strong> compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
+
* [[Games/ETS2/Modding guides/1.46]]
</li> <li> As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is <strong>HIGHLY RECOMMENDED</strong> 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.
+
* [[Games/ETS2/Modding guides/1.44]]
</li>
+
* [[Games/ETS2/Modding guides/1.43]]
</ul>
+
* [[Games/ETS2/Modding guides/1.42]]
 
+
* [[Games/ETS2/Modding guides/1.40]]
== How to convert map ==
+
* [[Games/ETS2/Modding guides/1.39]]
<ul>
+
* [[Games/ETS2/Modding guides/1.38]]
<li> 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.
+
* [[Games/ETS2/Modding guides/1.37]]
</li> <li> Use the replacement dialog (F3, "Prefab node correction") to add new prefab nodes which we added to some ferry prefabs in Scandinavia.
+
* [[Games/ETS2/Modding guides/1.36]]
</li> <li> Save map
+
* [[Games/ETS2/Modding guides/1.35]]
</li> <li> Do rebuild (F8)
+
* [[Games/ETS2/Modding guides/1.33]]
</li> <li> Save map
+
* [[Games/ETS2/Modding guides/1.32]]
</li>
+
* [[Games/ETS2/Modding guides/1.31]]
</ul>
+
* [[Games/ETS2/Modding guides/1.30]]
 
+
* [[Games/ETS2/Modding guides/1.28]]
== Changes ==
+
* [[Games/ETS2/Modding guides/1.27.2]]
=== Traffic-related changes ===
+
* [[Games/ETS2/Modding guides/1.27]]
==== AI vehicle type definition ====
+
* [[Games/ETS2/Modding guides/1.26]]
To specify spawned trailer count per vehicle, use the array attribute<strong> spawn_trailer_count</strong>. 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 <strong>0</strong> and <strong>1 </strong>are supported. For example:
+
* [[Games/ETS2/Modding guides/1.25]]
<pre># Set the trailer spawn probability to 75&#37;:
+
* [[Games/ETS2/Modding guides/1.24]]
#
+
* [[Games/ETS2/Modding guides/1.23]]
spawn&#95;trailer&#95;count&#91;]: 0
+
* [[Games/ETS2/Modding guides/1.22]]
spawn&#95;trailer&#95;count&#91;]: 1
+
* [[Games/ETS2/Modding guides/1.20]]
spawn&#95;trailer&#95;count&#91;]: 1
+
* [[Games/ETS2/Modding guides/1.19]]
spawn&#95;trailer&#95;count&#91;]: 1
+
* [[Games/ETS2/Modding guides/1.17]]
</pre>
+
* [[Games/ETS2/Modding guides/1.16]]
Currently, the default trailer spawn probability for trucks is <strong>90%</strong>.
+
* [[Games/ETS2/Modding guides/1.15]]
 
+
* [[Games/ETS2/Modding guides/1.14]]
==== AI vehicle definition ====
+
* [[Games/ETS2/Modding guides/1.11]]
To allow better control over AI trailer spawning, the meaning of attribute <strong>attachable_trailer </strong>has been modified:
+
* [[Games/ETS2/Modding guides/1.9]]
 
+
* [[Games/ETS2/Modding guides/1.4.1]]
<strong>BEFORE </strong>- when choosing a trailer model to spawn, the game randomly selects one, which name matches ANY OF THE STRINGS contained in the array
 
 
 
<strong>NOW - </strong>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 <strong>supports wildcard '*'</strong> - 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 <strong>all</strong> trailer models, use <code>attachable_trailer[]: ""</code> or <code>attachable_trailer[]: "*"</code>
 
 
 
Spawned trailer count can be set also per-vehicle by using attribute <strong>trailer_count</strong>. It works the same way as <em>spawn_trailer_count </em>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 <strong>allowed_tractor</strong>. This attribute <strong>supports wildcard '*'</strong> - 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:
 
<pre># Allow this trailer be attached only to a single vehicle
 
 
 
allowed&#95;tractor&#91;]: &#34;traffic.scania&#95;r&#95;a&#34;</pre>
 
 
 
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 <strong>low_elevation</strong> and <strong>high_elevation</strong> 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 <strong>sun_direction</strong>, 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 <strong>latitude_a</strong> and <strong>latitude_b</strong> 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) - <strong>day_in_year</strong> (172 = summer solstice), <strong>summer_time</strong> (+1h).
 
 
 
 
 
= Patch: 1.19 =
 
 
 
== Recommendations ==
 
<ul>
 
<li> 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.
 
</li> <li> When basing you model on the original ones, add to your mod also <strong>ALL</strong> 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.
 
</li> <li> When modifying original models, always include <strong>ALL</strong> compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
 
</li> <li> As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is <strong>HIGHLY RECOMMENDED</strong> 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.
 
</li>
 
</ul>
 
 
 
== How to convert map ==
 
<ul>
 
<li> If your mod overrides <strong>signs.sii</strong> or <strong>sign.dlc_north.sii</strong>, you need to update those files to account for us moving some signs from DLC Scandinavia to base.
 
</li> <li> Convert AI model storage definitions to the new format
 
</li> <li> Convert the road look definitions to the new format.
 
</li> <li> Convert the speed limit and license plate definitions in country data to the new format.
 
</li>
 
</ul>
 
 
 
== Changes ==
 
=== Traffic-related changes ===
 
==== AI vehicle model storage ====
 
For each supported vehicle type (currently: <strong><em>car, truck, bus</em></strong>) a separate unit exists in <strong>/def/vehicle/traffic_vehicle_type.sii</strong>. These units contain paths to actual model storage for given vehicle type (e.g.<strong> /def/vehicle/traffic_storage_car.sii</strong>)
 
 
 
==== AI trailer model storage ====
 
For each supported trailer type (currently: <strong><em>semi_trailer</em></strong>) a separate unit exists in <strong>/def/vehicle/traffic_trailer_type.sii</strong>. These units contain paths to actual model storage for given trailer type (e.g.<strong> /def/vehicle/traffic_storage_semi_trailer.sii</strong>)
 
 
 
==== AI vehicle definition ====
 
Property <strong>attachable</strong> is now obsolete. It has been replaced by an array attribute <strong>attachable_trailer</strong>. The array contains unit names (as strings) of all trailer models which can be attached to the given vehicle.
 
 
 
To allow <strong>all</strong> trailer models, add an empty string at the beginning of the array:
 
 
 
<code>attachable_trailer[]: ""</code>
 
 
 
==== AI trailer definition ====
 
To allow future features and improvements, the type of the unit defining an AI trailer <strong>CHANGED FROM</strong> <code>trailer</code> <strong>TO</strong> <code>traffic_trailer</code>
 
 
 
For example:
 
 
 
<code>trailer : traffic.trailer.fuel_cistern</code>
 
 
 
changes to
 
 
 
<code>trafic_trailer : traffic.trailer.fuel_cistern</code>
 
 
 
==== Road look definition ====
 
The <strong>lane_count_left</strong>, <strong>lane_count_right</strong> and <strong>ai_speed_type</strong> attributes are now obsolete. They were replaced by <strong>lanes_left</strong> and <strong>lanes_right</strong> 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 "<em>Traffic lane definition</em>"
 
 
 
==== Traffic lane definition ====
 
Traffic lane definitions can be found in <strong>/def/world/traffic_lane.sii</strong>.
 
 
 
==== License plate definition ====
 
The definitions of per-country license plates were moved into separate <strong>/def/country/&lt;country_name&gt;/license_plates.sii</strong> 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 <strong>/def/country/&lt;country_name&gt;/speed_limits.sii</strong> 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 <strong>ext_model</strong>, <strong>ext_variant</strong> and <strong>ext_look</strong> attributes of interior accessory.
 
 
 
=== Editor changes ===
 
<ul>
 
<li> <span style="background-color: transparent;">The toolbar window and editor window were combined into one.</span>
 
</li> <li> <span style="background-color: transparent;">Editor window can be resized, docked, maximized.</span>
 
</li> <li> <span style="background-color: transparent;">Resolution can be choosed from menu View &gt; Resolution.</span>
 
</li> <li> <span style="background-color: transparent;">Mouse cursor behaves significantly better.</span>
 
</li> <li> <span style="background-color: transparent;">Free camera can be rotated with right mouse button (RMB).</span>
 
</li> <li> <span style="background-color: transparent;">Several items can be combined into one by "Ctrl+G" or from menu Tools &gt; Compound Selection.</span>
 
</li></ul>
 
 
 
==== 3D move manipulator ====
 
<ul>
 
<li> <span style="background-color: transparent;">Editor contains 3D move manipulator ("gizmo").</span>
 
</li> <li> <span style="background-color: transparent;">Move manipulator can lock movement along one axis when X, Y or Z pressed.</span>
 
</li> <li> <span style="background-color: transparent;">Move manipulator can lock movement along one plane when Shift+X, Shift+Y or Shift+Z pressed.</span>
 
</li> <li> <span style="background-color: transparent;">Eg. </span><span style="background-color: transparent;">Shift+Y means that movement does not change in Y axis.</span>
 
</li>
 
</ul>
 
 
 
==== Grid ====
 
<ul>
 
<li> <span style="background-color: transparent;">Editor can render grid when enabled from menu View &gt; Grid.</span>
 
</li> <li> <span style="background-color: transparent;">On toolbar you can enable/disable Snap to grid and Snap to nodes.</span>
 
</li> <li> <span style="background-color: transparent;">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.</span>
 
</li>
 
</ul>
 

Latest revision as of 12:05, 22 August 2024

With each new game update 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 update version numbers.

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.

Updates