Open main menu

Changes

Games/ETS2/Modding guides/1.46

2,725 bytes added, 15:01, 8 November 2022
Created page with "= Introduction = The following page contains modding guidelines for the new update of the game. To better understand changes in units it is recommended to check Documentat..."
= Introduction =

The following page contains modding guidelines for the new update of the game.

To better understand changes in units it is recommended to check [[Documentation/Engine/Units|Units documentation]] page.

= Recommendations =
* When basing your 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 CityHash64 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 <strong>ALL</strong> components 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 <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.

= How to convert map =

* Load map
* Do rebuild (F8)
* Save map

= Changes & New Features =
== Interior UI addon accessory data ==
There is a new type of interior accessory specialized for using custom screen displays trough UI. They are utilizing same mechanisms as we use for dashboard and GPS. More info about unit: [[Documentation/Engine/Units|here]]

To create working working custom UI accessory (like custom GPS) one needs following:
1. Proper new '''accessory_addon_int_ui_data''' e.g.:
SiiNunit
{
accessory_addon_int_ui_data : my_gps.<brand>.<model>.set_lglass
{
name: "My GPS"
price: 999
unlock: 0
icon: "icon_path"
part_type: aftermarket

interior_model: "/path/to/my_gps_model.pmd"

# path to the UI script, either use custom or any existing e.g.: /ui/gps.sii
ui_path: "/ui/gps.sii"

# texture path for UI script to be drawn into,
# should be unique, if it's not, then multiple scripts
# may draw into same texture and last one to be drawn will prevail,
# consequentially all accessories using same drawable texture path will output same result.
ui_drawable_texture_path: "/path/to/my_gps_model_ui.tobj"

# size of the texture UI script will be drawn into
ui_drawable_size: (512, 256)
}
}
2. You need to create placeholder static texture defined in accessory for our example: "/path/to/my_gps_model_ui.tga" + "/path/to/my_gps_model_ui.tobj"
3. Material in model has to be using texture defined in accessory for our example: "/path/to/my_gps_model_ui.tobj"