Changes

Jump to navigation Jump to search

Games/ETS2/Modding guides/1.9

3,492 bytes added, 09:07, 17 March 2016
m
50keda moved page Games/ETS2/Modding Guides/1.9 to Games/ETS2/Modding guides/1.9 without leaving a redirect
= Recommendations =
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 <a href="[[#Batch renaming">Batch renaming</a>]]) to fix the conflicts when new patch appears.
Some new models utilizing the "sc" 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.
<strong>intersection flags:</strong><br> <br> const unsigned PIF_SIBLING_COUNT_MASK = 0x000000F0;<br> const unsigned PIF_SIBLING_COUNT_SHIFT = 4;<br> const unsigned PIF_TYPE_START = 0x00010000;<br> const unsigned PIF_TYPE_END = 0x00020000;
==== Important notes ====
<ul>
<li><strong>intersection structures must be generated for EVERY curve involved in an intersection</strong></li>
</li></ul>
</li></ul>
 
 
== Changes in editor ==
=== Batch renaming ===
The editor now supports a batch renaming of some types of objects based on config file. First you need to prepare configuration file describing the changes which should be applied (see bellow). Afterwards you need to load the map in the editor, press <strong>F3</strong> to open the replacement dialog, press the <strong>Batch replace</strong> button and confirm the change. Afterwards you should save and reload the map.
 
The operation requires that units for both the old and the new names exist during the operation so you will need to do the operation in separate steps by first adding units under the new names to the definitions, then doing the rename and afterwards removing the units with the old names from the definitions.
 
The configuration file must be stored as <strong>Documents\Euro Truck Simulator 2\replace.sii</strong>. The file must contain a single unit of type <strong>editor_search_replace</strong>. The unit contains string array attribute <strong>sectors</strong> which must contain names of all sectors in which to apply the changes. The sector name corresponds to base name of the files used to store that sector (e.g. sec+0001-0001). The unit also contains additional string array attributes which define the replacements. The format of the replacement string is "old_name|new_name". Following arrays are supported: <ul>
<li> <strong>ter_material</strong> - terrain materials</li>
<li><strong>road_material</strong> - road materials</li>
<li><strong>sidewalk_material</strong> - sidewalk materials</li>
<li><strong>bld_scheme</strong> - building schemes</li>
<li><strong>model</strong> - models</li>
<li><strong>vegetation</strong> - vegetations</li>
<li><strong>road_look</strong> - road looks</li>
<li><strong>ter_profile</strong> - terrain profiles</li>
<li><strong>railing</strong> - railings on roads</li>
<li><strong>sign</strong> - lamps/bollars along the road
</li></ul>
 
Example of replacement file
<pre class="sii">SiiNunit
{
editor_search_replace : .edit_replace
{
# List of sectors where the search replace should be performed
 
sectors[]: "sec-0002-0007"
sectors[]: "sec-0002-0008"
 
# Terrain material replacement old terrain material unit suffix | new terrain material unit suffix
 
ter_material[]: "24|121"
ter_material[]: "103|129"
 
# Building scheme replacement old scheme unit suffix | new scheme unit suffix
 
bld_scheme[]: "22|2sc"
 
# Model replacement old model unit suffix | new model unit suffix
 
model[]: "122|1sc"
model[]: "757|2sc"
model[]: "56a|3sc"
}
}
</pre>
 
=== Categories ===
New attribute <strong>category</strong> of model_def, sign_model, prefab_model and building_scheme units specifies a string with category to which the unit belongs. This can be used in respective editor dialogs to filter the set of the items to only items belonging to selected category.
 
=== Changes in signs ===
The signs now appear as a standalone items in the editor. If you have modified editor_data.sii, you need to update the sub_mode_types array to make the corresponding entry visible in the ui.
 
A new <strong>distance_type</strong> attribute was added to the sign definition (0 - short, 1 - close, 2 - middle, 3 - far). The <strong>short_distance</strong> attribute is now obsolete and ignored.
 
A new <strong>Follow road dir</strong> checkbox was added to the Sign properties. It aligns the sign orientation according to the near road and to keep relative position when the road moves.

Navigation menu