WorkingSound :: struct or SoundExample code
| Inherits from MainSound |
| 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 |
If | ||
| persistent optional | :: boolean | When |
When | ||
| 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 |
Unused when | ||
| 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 |
Can't be used when | ||
| fade_out_ticks optional | :: uint32 | Can't be used when |
Can't be used when | ||
| activity_to_volume_modifiers optional | :: ActivityMatchingModifiers | |
| activity_to_speed_modifiers optional | :: ActivityMatchingModifiers | |
| match_progress_to_activity optional | :: boolean | Unused when WorkingSound::persistent is |
Unused when WorkingSound::persistent is | ||
| 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. [...] | ||
| play_for_directionsnew optional | :: array[defines.direction] | The |
The | ||
| volume_smoothing_window_size optional | :: uint32 | Only used if WorkingSound::persistent is |
Only used if WorkingSound::persistent is | ||
Properties
max_sounds_per_prototype :: uint8 optional 
extra_sounds_ignore_limit :: boolean optional 
persistent :: boolean optional 
use_doppler_shift :: boolean optional 
idle_sound :: Sound optional 
activate_sound :: Sound optional 
deactivate_sound :: Sound optional 
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
}

