Changes

Jump to navigation Jump to search

Documentation/Engine/Random Road Events

402 bytes added, 14:54, 22 May 2018
no edit summary
[[File:Engine random event composition.jpg|800px]]
= Defining random Road events creation pipeline =
All RE are stored in "'''/def/world/journey_road_event.sii'''" as list of [[Documentation/Engine/Units/journey_events_road_event|'''journey_events_road_event''']] units. Example '''journey_road_event.sii''' file definition:<pre>SiiNunit{# For moddersworking road event we need: Please do not modify this file if you want to add a new entry. Create in# this directory a new file "<base_name>.<idofyourmod>Exported one or more cutscenes from map editor.sii" where <base_name> is name of# base file without the extension (eDefined cutscenes exported in step 1.g. "city" for "/def/city.sii") and <idofyourmod> is# some string which is unlikely to conflict Defined journey cutscenes with other mod.## Warning: Even if the units are specified last token of cutscene unit names defined in more than one source file, they share thestep 2 - [[# same namespace so suffixes or prefixes should be used to avoid conflicts. journey_events_road_event : j_re.acc_uni_p{ signs_distances_outer[Defining cutscenes for random events]: 50  layer_min_curve[]: 0.0 layer_max_curve# Finally defined road events inside with linked journey cutscenes from step 3 - []: 15.0 max_length: 55.0 min_length: 55.0}journey_events_road_event : j_re.acc_plane{ start_cutscene: j_cut.acc_stop_li layer_cutscenes[#Defining random events]: j_cut.acc_mid end_cutscene: j_cut.acc_plane  min_shoulder_space: 3.0 outer_lane_allowed: true centerline_displacement: true layer_max_curve[]: 2.0 weight: 10.0  parent: j_re.acc_spec_p  name: "Accident country specific plane (1)"}}</pre>
== Defining cutscenes for random events ==
</pre>
=== Cutscene width ===
In case of RE, cutscene definition of type [[Documentation/Engine/Units/journey_events_cutscene|journey_events_cutscene]] also uses '''left_width''' and '''right_width''' attributes, which defines the length of the cutscene. This two attributes are very important as they determinate how much space is between different cutscenes, how many layer cutscenes can be places in whole RE and where traffic blocks will be placed.
# Once seeing cutscene as on picture, use the ruler tool in map editor to measure distance from cutscene origin point on each side.
# Use measured widths in cutscene definition.
 
== Defining random events ==
 
All RE are stored in "'''/def/world/journey_road_event.sii'''" as list of [[Documentation/Engine/Units/journey_events_road_event|'''journey_events_road_event''']] units.
 
Example '''journey_road_event.sii''' file definition:
<pre>
SiiNunit
{
# For modders: Please do not modify this file if you want to add a new entry. Create in
# this directory a new file "<base_name>.<idofyourmod>.sii" where <base_name> is name of
# base file without the extension (e.g. "city" for "/def/city.sii") and <idofyourmod> is
# some string which is unlikely to conflict with other mod.
#
# Warning: Even if the units are specified in more than one source file, they share the
# same namespace so suffixes or prefixes should be used to avoid conflicts.
 
journey_events_road_event : j_re.acc_uni_p
{
signs_distances_outer[]: 50
 
layer_min_curve[]: 0.0
layer_max_curve[]: 15.0
max_length: 55.0
min_length: 55.0
}
journey_events_road_event : j_re.acc_plane
{
start_cutscene: j_cut.acc_stop_li
layer_cutscenes[]: j_cut.acc_mid
end_cutscene: j_cut.acc_plane
 
min_shoulder_space: 3.0
outer_lane_allowed: true
centerline_displacement: true
layer_max_curve[]: 2.0
weight: 10.0
 
parent: j_re.acc_spec_p
 
name: "Accident country specific plane (1)"
}
}
</pre>

Navigation menu