Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# WorkingSound - Prototype Docs

## WorkingSound :: struct or Sound Example code

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

Inherits from MainSound

## Properties

- default
- sorted

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`, entities playing their extra sound don't count towards `max_sounds_per_prototype` limit. [...]
If `true`, entities playing their extra sound don't count towards `max_sounds_per_prototype` limit. [...]
persistent optional | :: boolean | When `true`, working sounds for all entities of the same prototype are combined into one.
When `true`, working sounds for all entities of the same prototype are combined into one.
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] | Unused when `persistent` is `true`.
Unused when `persistent` is `true`.

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 | Unused when WorkingSound::persistent is `true`.
Unused when WorkingSound::persistent is `true`.
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`.

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. [...]
extra_sounds_ignore_limit optional | :: boolean | If `true`, entities playing their extra sound don't count towards `max_sounds_per_prototype` limit. [...]
If `true`, entities playing their extra sound don't count towards `max_sounds_per_prototype` limit. [...]
idle_sound optional | :: Sound | The sound to be played when the entity is idle. [...]
The sound to be played when the entity is idle. [...]
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. [...]
persistent optional | :: boolean | When `true`, working sounds for all entities of the same prototype are combined into one.
When `true`, working sounds for all entities of the same prototype are combined into one.
sound_accents optional | :: SoundAccent or array[SoundAccent] | Unused when `persistent` is `true`.
Unused when `persistent` is `true`.
use_doppler_shift optional | :: boolean |

Inherited from MainSound

activity_to_speed_modifiers optional | :: ActivityMatchingModifiers |
activity_to_volume_modifiers optional | :: ActivityMatchingModifiers |
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`.
match_progress_to_activity optional | :: boolean | Unused when WorkingSound::persistent is `true`.
Unused when WorkingSound::persistent is `true`.
match_speed_to_activity optional | :: boolean |
match_volume_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. [...]
probability optional | :: double | Modifies how often the sound is played. [...]
Modifies how often the sound is played. [...]
sound optional | :: Sound | Cannot be empty.
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.

Unused when `persistent` is `true`.

### extra_sounds_ignore_limit :: boolean optional

Default: `false`

If `true`, entities playing their extra sound don't count towards `max_sounds_per_prototype` limit. 'extra sound' refers to `idle_sound`, `activate_sound` or `deactivate_sound`.

Unused when `persistent` is `true`.

### persistent :: boolean optional

Default: `false`

When `true`, working sounds for all entities of the same prototype are combined into one.

### 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.

Unused when `persistent` is `true`.

### activate_sound :: Sound optional

Might not work with all entities that use working_sound.

Unused when `persistent` is `true`.

### deactivate_sound :: Sound optional

Might not work with all entities that use working_sound.

Unused when `persistent` is `true`.

### sound_accents :: SoundAccent or array[SoundAccent] optional

Unused when `persistent` is `true`.

## 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
    }

Type used in

- EntityPrototype::working_sound