Open main menu

Changes

Games/ATS/Modding guides/1.29

5,080 bytes added, 14:15, 3 November 2017
Created page with "= 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 ge..."
= 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 =
{{Note|Work In Progress }}

= Changes =

== Traffic ==

There were several changes in traffic-related data. Due to their nature, some of them have '''no backward compatibility provided''', so please check your mods for potential problems. You shouldn't have any problems if the corresponding definitions are not modded.

=== Traffic lane data ===

All traffic lane properties are now defined through a set of traffic rules (see [[#Traffic rules]]) instead of having specific attributes for certain functions. This allows combining various 'functions' (e.g. road lines, access for vehicle types, spawning...) into traffic lanes without the need of specific attributes.

{{Note|There are no 'default traffic rules' defined for traffic lanes. All needed properties must be defined for each lane type manually.}}

''Example of lane with local road speed class, spawn rules for multiple vehicle types and 'overtaking allowed' rule:''
<pre>traffic_lane_data : traffic_lane.road.local
{
speed_class: local_road
traffic_rules[]: traffic_rule.road # Allow access for road vehicles
traffic_rules[]: traffic_rule.s_car_l
traffic_rules[]: traffic_rule.s_truck_l
traffic_rules[]: traffic_rule.s_bus_l
traffic_rules[]: traffic_rule.s_police
traffic_rules[]: traffic_rule.overtake_alw # Allow overtaking (including 'wrong way')
}
</pre>

''Example of a traffic lane with only trucks allowed to spawn or enter it:''
<pre>traffic_lane_data : traffic_lane.road.freeway.truck_lane
{
speed_class: freeway
traffic_rules[]: traffic_rule.s_truck_h
traffic_rules[]: traffic_rule.trucks_only
}
</pre>

''Example of a traffic lane with no rules (i.e. no spawning and no vehicle access):''
<pre>traffic_lane_data : traffic_lane.no_vehicles
{
speed_class: local_road
}
</pre>

=== Road looks ===

All road look traffic-related properties are defined through (see [[#Traffic lane data]]). To define different lane configurations for various road template variants, you can use '''''template_variants_left''''' and '''''template_variants_right''''' attributes.

''Example of a road look for 1+1 lane road. Only some template variants (with broken or no road lines) allow overtaking:''
<pre>
road_look : road.template0 {
name: "ca 1x1 country small border tmpl"
template_right: "/road_template/ca_nv/ca_1x1_small_border.pmd"


lanes_left[]: traffic_lane.road.local.no_overtake
lanes_right[]: traffic_lane.road.local.no_overtake

template_variants_right[]: .tmpl_var.road.template0

compatible_edges_right[]: "shldr_1m"
compatible_edges_right[]: "shldr_05m"
compatible_edges_right[]: "shldr_1m2"
compatible_edges_right[]: "sw_kerb"
compatible_edges_right[]: "sw_4m_a"
compatible_edges_right[]: "sw_4m_c"

shoulder_space_left: 1.0
shoulder_space_right: 1.0

}
road_template_variant : .tmpl_var.road.template0
{
variant_names[]: "no_lines"
variant_names[]: "lines_broken"

lanes_left[]: traffic_lane.road.local
lanes_right[]: traffic_lane.road.local
}
</pre>

''Example of a freeway road look with one 'truck lane' variant and one variant with lane changing disabled at the outermost lane:''
<pre>
road_look : road.us_tmpl13 {
name: "us 0-3 freeway tmpl"
template_right: "/road_template/us/us_3_freeway_one_way.pmd"

lanes_right[]: traffic_lane.road.freeway
lanes_right[]: traffic_lane.road.freeway
lanes_right[]: traffic_lane.road.freeway
template_variants_right[]: .tmpl_var.road.us_tmpl13
template_variants_right[]: .tmpl_var2.road.us_tmpl13
compatible_edges_right[]: "sh"
shoulder_space_right: 3.0
}
road_template_variant : .tmpl_var.road.us_tmpl13
{
variant_names[]: "truck_lane"
lanes_right[]: traffic_lane.road.freeway
lanes_right[]: traffic_lane.road.freeway
lanes_right[]: traffic_lane.road.freeway.truck_lane
}
road_template_variant : .tmpl_var2.road.us_tmpl13
{
variant_names[]: "brd_brk_ful"
lanes_right[]: traffic_lane.road.freeway
lanes_right[]: traffic_lane.road.freeway.full_out
lanes_right[]: traffic_lane.road.freeway.full_in
}
</pre>