Factorio Prototype DocsVersion 2.0.42

WorkingSound :: struct or SoundExample code

This type is used to produce sound from in-game entities when they are working/idle.

Inherits from MainSound

Properties

main_sounds optional :: MainSound or array[MainSound]

If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.

If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.

max_sounds_per_prototype optional :: uint8

Sets a maximum limit on how many entities of the same prototype will play their working sound. [...]

Sets a maximum limit on how many entities of the same prototype will play their working sound. [...]

extra_sounds_ignore_limit optional :: boolean

If true, max_sounds_per_prototype is ignored. [...]

If true, max_sounds_per_prototype is ignored. [...]

persistent optional :: boolean

When true, working sounds for all entities of the same prototype are combined into one and some (most) properties of this are ignored or unused.

When true, working sounds for all entities of the same prototype are combined into one and some (most) properties of this are ignored or unused.

use_doppler_shift optional :: boolean
idle_sound optional :: Sound

The sound to be played when the entity is idle. [...]

The sound to be played when the entity is idle. [...]

activate_sound optional :: Sound

Might not work with all entities that use working_sound.

Might not work with all entities that use working_sound.

deactivate_sound optional :: Sound

Might not work with all entities that use working_sound.

Might not work with all entities that use working_sound.

sound_accents optional :: SoundAccent or array[SoundAccent]

Inherited from MainSound
sound optional :: Sound

Cannot be empty.

Cannot be empty.

probability optional :: double

Modifies how often the sound is played. [...]

Modifies how often the sound is played. [...]

fade_in_ticks optional :: uint32

Can't be used when match_progress_to_activity is true.

Can't be used when match_progress_to_activity is true.

fade_out_ticks optional :: uint32

Can't be used when match_progress_to_activity is true.

Can't be used when match_progress_to_activity is true.

activity_to_volume_modifiers optional :: ActivityMatchingModifiers
activity_to_speed_modifiers optional :: ActivityMatchingModifiers
match_progress_to_activity optional :: boolean
match_volume_to_activity optional :: boolean
match_speed_to_activity optional :: boolean
play_for_working_visualisations optional :: array[string]

Array of WorkingVisualisation::names, individual names cannot be empty. [...]

Array of WorkingVisualisation::names, individual names cannot be empty. [...]

volume_smoothing_window_size optional :: uint32

Only used if WorkingSound::persistent is true.

Only used if WorkingSound::persistent is true.

Properties

main_sounds :: MainSound or array[MainSound] optional

If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.

max_sounds_per_prototype :: uint8 optional

Sets a maximum limit on how many entities of the same prototype will play their working sound.

Inactive entities without an idle_sound don't count towards this limit.

Entities with their working sound fading out don't count towards this limit.

extra_sounds_ignore_limit :: boolean optional

Default: false

If true, max_sounds_per_prototype is ignored. 'extra sound' refers to idle_sound, activate_sound or deactivate_sound.

persistent :: boolean optional

Default: false

When true, working sounds for all entities of the same prototype are combined into one and some (most) properties of this are ignored or unused.

use_doppler_shift :: boolean optional

Default: true

idle_sound :: Sound optional

The sound to be played when the entity is idle. Might not work with all entities that use working_sound.

activate_sound :: Sound optional

Might not work with all entities that use working_sound.

deactivate_sound :: Sound optional

Might not work with all entities that use working_sound.

sound_accents :: SoundAccent or array[SoundAccent] optional

Examples

-- refinery
working_sound =
{
  sound = {filename = "__base__/sound/oil-refinery.ogg"},
  idle_sound = {filename = "__base__/sound/idle1.ogg", volume = 0.6},
}
-- roboport
working_sound =
{
  sound = {filename = "__base__/sound/roboport-working.ogg", volume = 0.6, audible_distance_modifier = 0.5},
  max_sounds_per_prototype = 3,
  probability = 1 / (5 * 60) -- average pause between the sound is 5 seconds
}

Prototypes

Types

Defines