Games/ETS2/Modding guides/1.46

From SCS Modding Wiki
< Games‎ | ETS2/Modding guides
Revision as of 15:29, 8 November 2022 by 50keda (talk | contribs) (Interior UI addon accessory data)

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 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: 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>.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)
}
}
  • 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"