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

From SCS Modding Wiki
Jump to navigation Jump to search
(Created page with "= Recommendations = <ul> <li> 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...")
 
(Change in accessory hiding flags)
Line 36: Line 36:
 
== Change in accessory hiding flags ==
 
== Change in accessory hiding flags ==
 
The optional flags controlling visibility of accessories in various views did change. This calculator should be used instead the one from 1.11 modding info.
 
The optional flags controlling visibility of accessories in various views did change. This calculator should be used instead the one from 1.11 modding info.
 
<script> function Compute(element) { var Val = parseInt(document.getElementById("result").innerHTML, 16); if (element.checked) { Val += parseInt(element.value, 16); } else { Val -= parseInt(element.value, 16); } document.getElementById("result").innerHTML = Val.toString(16).toUpperCase(); } </script>
 
 
=== Hide following views ===
 
<table>
 
<tr>
 
<td> <input type="checkbox" value="7" onchange="Compute(this)"> </td>
 
<td> Main View </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="1F8" onchange="Compute(this)"> </td>
 
<td> Reflection Cube </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="600" onchange="Compute(this)"> </td>
 
<td> Close Mirror </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="1800" onchange="Compute(this)"> </td>
 
<td> Far Mirror </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="2000" onchange="Compute(this)"> </td>
 
<td> Side Mirror </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="4000" onchange="Compute(this)"> </td>
 
<td> Front Mirror </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="1FFE0000" onchange="Compute(this)"> </td>
 
<td> Shadows </td>
 
</tr>
 
<tr>
 
<td> <input type="checkbox" value="E0000000" onchange="Compute(this)"> </td>
 
<td> Rain reflection </td>
 
</tr>
 
<tr>
 
<td> hide_in: </td>
 
<td> 0x<span id="result">0</span> </td>
 
</tr>
 
</table>
 
  
 
== Map format version change ==
 
== Map format version change ==

Revision as of 09:27, 11 February 2016

Recommendations

  • 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.
  • 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 you are overloading the game_data.sii, update the garage and truck dealer definitions (Game data)
  • Define mass attribute for signs which do not have it (will be seen in the log)
  • Use the replacement dialog (F3, "Prefab node correction") to add to the map nodes which we added to some prefabs
  • Check vicinity of prefabs for which we corrected the nodes ( <a href="#Corrected prefab nodes">Corrected prefab nodes</a>)
  • Create traffic item areas for all cities that do not have one (see <a href="#City items vs. 'city speed limit">City items vs. 'city speed limits'</a>)
  • Save map
  • Do rebuild (F8)
  • Save map

Changes

Change in accessory hiding flags

The optional flags controlling visibility of accessories in various views did change. This calculator should be used instead the one from 1.11 modding info.

Map format version change

The format of the map did change. You need to re-save it in the editor before it can be loaded by the game.

Corrected prefab nodes

We fixed incorrect node positions in following template prefabs. If you are using them in your map, please check and correct their neighborhood.

  • /prefab/fork_temp/exit_road_joint_tmpl.ppd
  • /prefab/fork_temp/exit_road_joint_mirrored_tmpl.ppd
  • /prefab/fork_temp/hw2_one_way_joint_tmpl.ppd
  • /prefab/fork_temp/hw2_one_way_joint_mirrored_tmpl.ppd
  • /prefab/fork_temp/road1_split_tmpl.ppd
  • /prefab/fork_temp/hw2_exit_joint_tmpl.ppd
  • /prefab/fork_temp/hw2_exit_joint_mirrored_tmpl.ppd
  • /prefab/fork_temp/hw2-hw2_exit_tmpl.ppd
  • /prefab/fork_temp/hw2-hw2_exit_mirrored_tmpl.ppd
  • /prefab/fork_temp/exit_road_joint_short_tmpl.ppd
  • /prefab/fork_temp/exit_road_joint_short_mirrored_tmpl.ppd
  • /prefab/fork_temp/hw_exit_joint_narrow_tmpl.ppd
  • /road_template/hw_exit.pmd
  • /road_template/hw2_exit_one_way.pmd

Game data

The tiny_garage/small_garage/large_garage and truck_dealer_exterior/truck_dealer_interior attributes inside game_data.sii were changed into 's' suffixed arrays. If your mod overrides this file, you MUST update the attributes according to the official version of the file.

Dashboard templates

The dashboard_text.sii is now loaded after profile selection (so it can be modified using normal mod selection mechanism) and supports multiple files. Use the multi-file mechanism when adding dashboards for new trucks.

Route advisor

We changed way in which the advisor UI handles continental vs UK variant. If you are overriding it, you need to ensure that that the modified UI contains all required components.

Cargoes

The definition of the cargo was split into the common data and definition of individual trailers used to transport it.

  • The common parameters are stored in unit cargo.<name></name> in the /def/cargo/<name>.sii</name> as before.
  • The trailers used to transport that cargo are now stored as set of files in /def/cargo/<name/.sii*. There is no technical limit on name of the file however it is highly recommended to base it on the name of the trailer unit.

Climates

Weather system can now distinguish "climates". There can be several climates, each with own set of nice and bad weather. The list of available climates is in file climate.sii and supports multiple files. Use the multi-file mechanism when adding new climates.

Example of climates defining file:

SiiNunit
{
climate_profile : climate.subtropical {
 bad_weather_factor: 0.07
}
}

Weather profiles for each climate are in folder climate/<name_of_climate>/bad.sii and climate/<name_of_climate>/nice.sii. These weather profiles are in the same format as they were before, the default ones are only moved from nice_weather.sii and bad_weather.sii into climate/default/nice.sii and climate/default/bad.sii. If your mod overrides these files, you must update the new ones. Watch out for unique unit names in weather profiles.

Each map sector has assigned a climate, which means different parts of your map can have different climates. New sectors have assigned default climate automatically. You can override this by creating file map/<name_of_map>.climate.sii and saving the map in the editor. The names of climates will be stored inside the map sector files during the save.

Example of such file:

SiiNunit
{
map_sector_climate : map.europe.climate
{
 coordinate[]: (-2, 8)
 climate[]: subtropical
 coordinate[]: (-3, 8)
 climate[]: subtropical
}
}

Changes in traffic

New AI truck models

To save performance, all AI truck models have been optimized. Every truck has now its chassis and all addons merged into a single model. The truck storage definition file ( /base/def/vehicle/truck_traffic_storage.sii) now contains new definition paths. The old system (composing vehicles manually) is still supported. If your mod contains modified AI truck vehicle definitions, please check if there are correct definitions in truck_traffic_storage.sii.

Traffic areas

  • They are defined by creating traffic area items in editor.
  • Traffic areas were primarily created to allow specifying area traffic rules.
  • The shape of a traffic area can be an arbitrary N-gon
  • Any traffic rule (from traffic_rules.sii) can be used as a traffic area rule (although some wouldn't make sense as 'area' rules, e.g. 'give way', 'stop line', etc.)

Common area traffic rules

  • No trucks area
    • prevents trucks (with or without trailers) entering or spawning inside the area
  • City area
    • the rule area should correspond with 'city start' and 'city end' traffic signs
    • marks the area, where 'city speed limits' are to be used ('CITY ITEMS' IN EDITOR ARE NO LONGER USED FOR THIS PURPOSE!)

City items vs. 'city speed limits'

Until now, City items were used to define areas which are 'inside cities', i.e. where 'city rules' (like city speed limits) should be used. However, city items are very limited in what shapes they can have. This often resulted in bugs concerning speed limit detection (areas outside cities acted like they are inside, or vice versa).

Starting with this patch, Traffic are items are now used INSTEAD of City items to define city speed limits. If your map mod contains some new cities, please CREATE appropriate traffic area items over new cities with 'Traffic rule' property set to 'City area'. Otherwise, those areas WILL NOT act like they are city areas.

Changes in navigation

The navigation (GPS) on prefabs has been improved. Now it extracts 'navigation information' directly from prefab navigation curves to determine which patch between nodes are valid. This allows generation of much more sensible navigation routes, especially when navigating through 'one-way' prefabs and roads. However, this also assumes that all prefabs have correctly connected their nodes with navigation curves. If you have a modded map and encounter errors concerning navigation, please check for missing navigation curves in prefabs between start and end navigation points.