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

From SCS Modding Wiki
Jump to navigation Jump to search
(Interior UI addon accessory data)
(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...")
(5 intermediate revisions by 2 users not shown)
Line 17: Line 17:
  
 
= Changes & New Features =
 
= Changes & New Features =
== Interior UI improvements ==
+
== Interior UI addon accessory data ==
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.
+
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]]
  
=== Interior UI addon accessory data ===
+
To create working working custom UI accessory (like custom GPS) one needs following:
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: [[Documentation/Engine/Units/accessory_addon_int_ui_data|here]]
+
1. Proper new '''accessory_addon_int_ui_data''' e.g.:
 
 
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
 
  SiiNunit
 
  {
 
  {
  accessory_addon_int_ui_data : my_gps.<brand>.<model>.<acc_type>
+
  accessory_addon_int_ui_data : my_gps.<brand>.<model>.set_lglass
 
  {
 
  {
 
  name: "My GPS"
 
  name: "My GPS"
Line 35: Line 32:
 
  part_type: aftermarket
 
  part_type: aftermarket
 
   
 
   
  interior_model: "/path/to/my_gps_model_int.pmd"
+
  interior_model: "/path/to/my_gps_model.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
 
  # path to the UI script, either use custom or any existing e.g.: /ui/gps.sii
Line 51: Line 47:
 
  }
 
  }
 
  }
 
  }
* 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"
+
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"
* Material using texture path from accessory definition, for our example that would be: "/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"

Revision as of 15:01, 8 November 2022

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 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"