Trainz/containers/attached-splines container

From Wikibooks, open books for an open world
< Trainz‎ | containers(Redirected from Trainz/attached-splines)
Jump to navigation Jump to search
logo
Trainz Annotated References
TOC | BeginningsFun | AM&C | Creation | InBook Refs ORP Refs:  • Index • Containers • Kinds • Tags | Appendixes  • Vers
Loupe light.svg
 Glossary
 HKeys-CM
 HKeys-DVR
 HKeys-SUR
 HKeys-WIN
 Mouse use
 Notations

The attached-splines" container is an optional top-level config.txt file entry used by the KIND Track content type.

The container provides a mechanism for having one or more child splines attached which run parallel to the shape of a parent spline at a slight offset.

  • Attached splines are used where a spline with one set of rendering or functional behaviour needs to be coupled with a spline with a different set of rendering or functional behaviours. For example, a bridge (scenery) with attached track (functional), or a set of pylons (no stretching or shearing) with some wires strung between them (shearing and stretching to fit.)
  • The attached splines may be render-only splines which effectively don't exist beyond of their rendering behaviour, or they may be fully functional splines whose only specialty is that they move and delete with their parent.
P train grey.png
This page currently describes the default requirements of trainz-build 3.7 data model, and has not been given any annotations showing integrated evolutionary changes.


Supported Tags[edit]

The "attached-splines" container is a list of subcontainers with no standalone tags. Each attached-splines subcontainer supports the following tags. Each tag is shown here with its default value.

attached-splines   
{
lateral-offset 0.0
use-same-direction 1
spline-kuid <NULL>
visual-only 0
}

lateral-offset[edit]

type: Decimal numbers (sign + decimal values)

This decimal tag defines the number of meters that the child spline is offset sideways from its parent's position. The parent is at position 0.0, with positive offsets to the right, and negative offsets to the left.


use-same-direction[edit]

type: Boolean (0 or 1 only)

If set (1), this boolean tag causes the child spline to face in the same direction as the parent If clear (0), the child faces backward (180° rotation) to the parent.


spline-kuid[edit]

type: <KUID code value> (reference to an asset part)

This KUID tag defines the asset type to use for the child spline. A parent spline may have multiple children, which may be of the same or differing types.


visual-only[edit]

type: Boolean (0 or 1 only)

If set (1), this boolean tag causes the child spline to exist only while being actively rendered. This also removes all functional aspects of the child spline (such as carz, the use of the spline as railway track, connection of other splines, etc.) If clear (0), the child spline is fully instantiated along with the parent. Manual editing of the child spline is prevented in Surveyor but in all other aspects the child spline reacts as if placed manually.


follows-spline-gradient[edit]

type: Boolean (0 or 1 only)

If set (1), this boolean tag causes the child spline to follow the gradient of this spline rather than leaving the child to determine whether it should follow the spline gradient or the ground height. This is useful when the child is an asset which would normally follow the ground height (such as a regular track) but where the attachment location on the parent does not follow the ground height (such as on a bridge.)


Performance Notes[edit]

  • It is strongly recommended to avoid nesting of multiple layers of splines (eg. a single parent asset should have one or more child assets, and no grandchildren.)
  • Visual-only splines should be used where possible, as this gives a substantial performance benefit.
  • Any use of attached splines comes with a performance penalty. Where possible, a single spline which includes all the necessary features is preferred to use of this container resource.
  • CAVEAT: There is no connection between the LOD level of a parent spline, and the LOD level of a child spline. Do not assume that they will change LOD levels at the same time. (Reason: LOD is distance dependent, the offset alone—even if the LOD distance trigger values are identical—because of the trigonometric difference from the lateral-offset introduces a significant difference in distances in high resolution LOD distance ranges.)

Notes and references[edit]