Changes

Jump to navigation Jump to search

Games/ATS/Modding guides/1.29

2,121 bytes added, 14:27, 3 November 2017
no edit summary
lanes_right[]: traffic_lane.road.freeway.full_out
lanes_right[]: traffic_lane.road.freeway.full_in
}
</pre>
 
 
=== Traffic rules ===
 
==== Priority modifier ====
 
The third parameter for priority modifier traffic rules ('''''rule: "priority"''''') has been changed. The old definitions will not work correctly, as no backward compatibility is provided.
 
''Example of two most common priority rules:''
<pre>
traffic_rule_data : traffic_rule.major_road
{
name: "Priority road"
rule: "priority"
num_params[]: -1 # no prirority value change
num_params[]: 0 # not additive
num_params[]: 2 # type 'priority_road'
}
traffic_rule_data : traffic_rule.minor_road
{
rule: "priority"
num_params[]: -1 # no prirority value change
num_params[]: 0 # not additive
num_params[]: 1 # type 'give_way'
}
</pre>
 
==== Spawn density ====
 
The way of defining spawn density has been completely redesigned. The old definitions will not work correctly, as no backward compatibility is provided.
 
Instead of defining spawn coefficients, it is now possible to define traffic density flow during the day for each vehicle type separately. For better readability, all density related rules were added to '''''traffic_rules_spawn.sui'''''and included from '''''traffic_rules.sii'''''
 
{{Note|When applying a traffic density rule for the same vehicle type through both: traffic lane (see [#Traffic lane data]) and a traffic area item, then '''''the traffic area rule overrides the lane rule'''''.}}
 
''Example of a car spawn density flow ('low density' version):''
<pre>
traffic_rule_data : traffic_rule.s_car_l
{
# name: "Spawn density car low"
rule: "density"
str_params[]: "car"
num_params[]: 7.0 # 7:00
num_params[]: 0.15 # frequency
num_params[]: 10 # count limit
num_params[]: 17.0 # 17:00
num_params[]: 0.1 # frequency
num_params[]: 10 # count limit
num_params[]: 0.0 # 00:00
num_params[]: 0.05 # frequency
num_params[]: 3 # count limit
}
</pre>
 
''Example of train spawn density (constant):''
<pre>
traffic_rule_data : traffic_rule.s_train_c
{
# name: "Spawn density cargo train"
rule: "density"
str_params[]: "train_cargo"
num_params[]: 0.0 # 00:00
num_params[]: 0.03 # frequency
num_params[]: 2 # count limit
}
</pre>

Navigation menu