Skip to content

mission_task_track_builder

Source: base/tealdef/mission/tasks/auto_builder/mission_task_track_builder.d.tl

Notes

Task that builds a prepared track segment by segment.

MissionTaskTrackBuilder

record global base/tealdef/mission/tasks/auto_builder/mission_task_track_builder.d.tl:4

global record MissionTaskTrackBuilder is MissionInterface.TaskScript<MissionTaskTrackBuilder.State, MissionTaskTrackBuilder.Params>

Load: local track_builder = ug_require "::/mission/tasks/auto_builder/track_builder.tl"

Notes

Task (track_builder) that builds a list of track segments (simple_catenary template) one after the other up to a target count, then completes.

Details

The target count is all segments, or the progress of ownerTask (a transport_cargo task) times the number of segments, or (with onEvent) the value of a mission / track_builder / target-segment script event.

MissionTaskTrackBuilder.Segment

record base/tealdef/mission/tasks/auto_builder/mission_task_track_builder.d.tl:5

record Segment

Notes

One track segment.

Used in the base game: 3 times in 2 files

base/content/mission/mission/tasks/auto_builder/prepare_track_building_util.tl:6

local segments : {MissionTaskTrackBuilder.Segment} = {}
base/content/mission/mission/tasks/auto_builder/track_builder.tl:7
local function buildRailFn(segment : MissionTaskTrackBuilder.Segment, tunnel? : boolean, startingNode? : Engine.Entity, endNode? : Engine.Entity) : {Engine.Enti

Fields

Name Type Description
position0 {number, number, number} Start position.
position1 {number, number, number} End position.
tangent0 {number, number, number} Tangent at the start.
tangent1 {number, number, number} Tangent at the end.

MissionTaskTrackBuilder.Params

record base/tealdef/mission/tasks/auto_builder/mission_task_track_builder.d.tl:11

record Params

Notes

Params of the task.

Used in the base game: 1 time in 1 file

base/content/mission/mission/tasks/auto_builder/track_builder.tl:2

local type P = MissionTaskTrackBuilder.Params

Fields

Name Type Description
roadTemplate ResName
segments {Segment} Segments to build, in order.
firstNode Engine.Entity Existing node the first segment starts at.
lastNode Engine.Entity Existing node the last segment ends at.
ownerTask ResName Unique key of a transport_cargo task whose progress sets how many segments are built.
onEvent boolean The target count comes from target-segment events (starts at 0).
inverted boolean Builds from the last segment backwards, starting at lastNode.
tunnel boolean Builds the segments as tunnel.

MissionTaskTrackBuilder.State

record base/tealdef/mission/tasks/auto_builder/mission_task_track_builder.d.tl:21

record State

Notes

State of the task.

Used in the base game: 1 time in 1 file

base/content/mission/mission/tasks/auto_builder/track_builder.tl:1

local type S = MissionTaskTrackBuilder.State

Fields

Name Type Description
isComplete boolean All target segments are built.
previousNodes {Engine.Entity} Nodes built so far; the last one is the start of the next segment.
builtSegmentCount integer Segments built.
targetSegmentCount integer Segments to build.