Games/ETS2/Modding guides/1.46

From SCS Modding Wiki
Jump to navigation Jump to search

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 Units documentation page.

Recommendations

  • When basing your 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 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 ALL 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 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

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

Changes & New Features

Interior UI improvements

Truck interior now has unified handling of UI scripts for dashboard, infotainment and accessories. Now supporting all the truck IDs in all three types of drawables. Additionally infotainement/gps scripts being able to define multiple screen pages same as dashboard script.

Interior UI addon accessory data

There is a new type of interior accessory specialized for usage of custom screen displays via UI script (similarly as truck dashboards do). They are utilizing same mechanisms as we use for dashboard and GPS. More info about unit: here

To create working working custom UI accessory (like custom GPS) one needs the following:

  • Accessory defined with new accessory_addon_int_ui_data unit type e.g.:
SiiNunit
{
accessory_addon_int_ui_data : my_gps.<brand>.<model>.<acc_type>
{
	name: "My GPS"
	price: 999
	unlock: 0
	icon: "icon_path"
	part_type: aftermarket

	interior_model: "/path/to/my_gps_model_int.pmd"
	exterior_model: "/path/to/my_gps_model_ext.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)
}
}
  • Placeholder static texture from accessory definition, for our example that would be: "/path/to/my_gps_model_ui.tga" and "/path/to/my_gps_model_ui.tobj"
  • Material using texture path from accessory definition, for our example that would be: "/path/to/my_gps_model_ui.tobj"