Factorio.com|Forums|Wiki|Mod Portal|API Docs Prototype|Runtime|Auxiliary

# Factorio Prototype Docs Version 2.0.7

## VariableAmbientSoundLayer :: struct

## Properties

- default
- sorted

name | :: string | Name has to be unique across all layers.
Name has to be unique across all layers.
variants | :: array[Sound] | Cannot be empty. [...]
Cannot be empty. [...]
composition_mode | :: VariableAmbientSoundCompositionMode |
control_layer optional | :: string | Name of a layer which controls this layer, a layer cannot control itself. [...]
Name of a layer which controls this layer, a layer cannot control itself. [...]
control_layer_sample_mapping optional | :: array[array[uint8]] | Defines a mapping between controlling layer's samples and this (controlled) layer's samples. [...]
Defines a mapping between controlling layer's samples and this (controlled) layer's samples. [...]
has_start_sample optional | :: bool | If `true`, the first of Sound::variations is played at the start of a sequence. [...]
If `true`, the first of Sound::variations is played at the start of a sequence. [...]
has_end_sample optional | :: bool | If `true`, the last of Sound::variations is played at the end of a sequence (if the sequence is long enough). [...]
If `true`, the last of Sound::variations is played at the end of a sequence (if the sequence is long enough). [...]
number_of_sublayers optional | :: uint8 | If greater than one, samples are composed in overlapping sub-layers, offset from each other. [...]
If greater than one, samples are composed in overlapping sub-layers, offset from each other. [...]
sublayer_starting_offset optional | :: RandomRange or ProbabilityTable | Specifies starting offset of the second sub-layer. [...]
Specifies starting offset of the second sub-layer. [...]
sublayer_offset optional | :: RandomRange or ProbabilityTable | Specifies offset between two sub-layers' samples. [...]
Specifies offset between two sub-layers' samples. [...]
sample_length optional | :: RandomRange | Explicitly defines sample lengths. [...]
Explicitly defines sample lengths. [...]

composition_mode | :: VariableAmbientSoundCompositionMode |
name | :: string | Name has to be unique across all layers.
Name has to be unique across all layers.
variants | :: array[Sound] | Cannot be empty. [...]
Cannot be empty. [...]
control_layer optional | :: string | Name of a layer which controls this layer, a layer cannot control itself. [...]
Name of a layer which controls this layer, a layer cannot control itself. [...]
control_layer_sample_mapping optional | :: array[array[uint8]] | Defines a mapping between controlling layer's samples and this (controlled) layer's samples. [...]
Defines a mapping between controlling layer's samples and this (controlled) layer's samples. [...]
has_end_sample optional | :: bool | If `true`, the last of Sound::variations is played at the end of a sequence (if the sequence is long enough). [...]
If `true`, the last of Sound::variations is played at the end of a sequence (if the sequence is long enough). [...]
has_start_sample optional | :: bool | If `true`, the first of Sound::variations is played at the start of a sequence. [...]
If `true`, the first of Sound::variations is played at the start of a sequence. [...]
number_of_sublayers optional | :: uint8 | If greater than one, samples are composed in overlapping sub-layers, offset from each other. [...]
If greater than one, samples are composed in overlapping sub-layers, offset from each other. [...]
sample_length optional | :: RandomRange | Explicitly defines sample lengths. [...]
Explicitly defines sample lengths. [...]
sublayer_offset optional | :: RandomRange or ProbabilityTable | Specifies offset between two sub-layers' samples. [...]
Specifies offset between two sub-layers' samples. [...]
sublayer_starting_offset optional | :: RandomRange or ProbabilityTable | Specifies starting offset of the second sub-layer. [...]
Specifies starting offset of the second sub-layer. [...]

## Properties

### name :: string

Name has to be unique across all layers.

### variants :: array[Sound]

Cannot be empty.

Samples within a layer are the Sound::variations.

Number of samples must be the same across all variants.

Samples cannot have variable volume and all samples must have the same default volume.

### composition_mode :: VariableAmbientSoundCompositionMode

### control_layer :: string optional

Name of a layer which controls this layer, a layer cannot control itself.

Only loaded, and mandatory if `composition_mode` is `"layer-controlled"`.

### control_layer_sample_mapping :: array[array[uint8]] optional

Defines a mapping between controlling layer's samples and this (controlled) layer's samples. The number of items in the mapping must be the same as the number of samples in the controlling layer. Item in the mapping with index N defines which samples of this layer can play when the sample N is playing in the controlling layer.

Only loaded, and mandatory if `composition_mode` is `"layer-controlled"`.

### has_start_sample :: bool optional

Default: `false`

If `true`, the first of Sound::variations is played at the start of a sequence. The start sample counts towards the VariableAmbientSoundLayerStateProperties::sequence_length

### has_end_sample :: bool optional

Default: `false`

If `true`, the last of Sound::variations is played at the end of a sequence (if the sequence is long enough). The end sample counts towards the VariableAmbientSoundLayerStateProperties::sequence_length.

### number_of_sublayers :: uint8 optional

Default: `1`

If greater than one, samples are composed in overlapping sub-layers, offset from each other.

If greater than one, one of `sublayer_starting_offset` or `sublayer_offset` must be defined. Both cannot be defined together.

Cannot be defined for layers with `"shuffled"` `composition_mode`.

Cannot be zero.

### sublayer_starting_offset :: RandomRange or ProbabilityTable optional

Specifies starting offset of the second sub-layer.

Only loaded if `number_of_sublayers` is greater than one.

Cannot be defined together with `sublayer_offset`.

The minimum of RandomRange variant cannot be zero.

### sublayer_offset :: RandomRange or ProbabilityTable optional

Specifies offset between two sub-layers' samples.

This implicitly dictates the sample lengths as two sub-layer offsets.

Only loaded if `number_of_sublayers` is greater than one.

Cannot be defined together with `sublayer_starting_offset`.

The minimum of RandomRange variant cannot be zero.

### sample_length :: RandomRange optional

Explicitly defines sample lengths. The whole sample is played when this is not specified.

Cannot be defined together with `sublayer_offset`.

The minimum cannot be zero.

Type used in

- VariableAmbientSoundVariableSound::layers