Types/Sound: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Prototype property type usage)
(0.18.17)
Line 4: Line 4:
* volume - [[Types/float]] - Optional. - Default: 1.0
* volume - [[Types/float]] - Optional. - Default: 1.0
* preload - [[Types/bool]] - Optional.
* preload - [[Types/bool]] - Optional.
* speed - [[Types/float] - Optional. - Default: 1.0 - Speed must be >= 1 / 64. This sets both min and max speed.
* min_speed - [[Types/float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be >= 1 / 64.
* max_speed - [[Types/float]] - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be >= min_speed.


== Optional properties ==
== Optional properties ==
Line 14: Line 17:
* remove - [[Types/bool]] - Mandatory.
* remove - [[Types/bool]] - Mandatory.
* count_already_playing - [[Types/bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.
* count_already_playing - [[Types/bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.
=== allow_random_repeat ===
'''Type''': [[Types/bool]]
'''Default''': false


=== audible_distance_modifier ===
=== audible_distance_modifier ===
Line 21: Line 29:


=== variations ===
=== variations ===
'''Type''': [[Types/table]] of [[Types/table]]s
'''Type''': [[Types/table]] (array) of [[Types/table]]s


Array of tables with the following members:
Array of tables with the following members:
Line 27: Line 35:
* volume - [[Types/float]] - Optional. - Default: 1.0
* volume - [[Types/float]] - Optional. - Default: 1.0
* preload - [[Types/bool]] - Optional.
* preload - [[Types/bool]] - Optional.
* speed - [[Types/float] - Optional. - Default: 1.0 - Speed must be >= 1 / 64. This sets both min and max speed.
* min_speed - [[Types/float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be >= 1 / 64.
* max_speed - [[Types/float]] - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be >= min_speed.


=== filename ===
=== filename ===
Line 44: Line 55:


Only loaded if <code>variations</code> is not given.
Only loaded if <code>variations</code> is not given.
=== speed ===
'''Type''': [[Types/float]]
'''Default''': 1.0
Only loaded if <code>variations</code> is not given. Speed must be >= 1 / 64. This sets both min and max speed.
=== min_speed ===
'''Type''': [[Types/float]]
'''Default''': 1.0
Only loaded if <code>variations</code> is not given. Not loaded if speed is present. Speed must be >= 1 / 64.
=== max_speed ===
'''Type''': [[Types/float]]
'''Default''': 1.0
Only loaded if <code>variations</code> is not given. Mandatory if max_speed is present, otherwise not loaded. Must be >= min_speed.


==Example==
==Example==

Revision as of 11:33, 6 April 2020

Basics

This type is either a table with the properties listed in #Optional properties, or an array of tables with the following members:

  • filename - Types/FileName - Mandatory.
  • volume - Types/float - Optional. - Default: 1.0
  • preload - Types/bool - Optional.
  • speed - [[Types/float] - Optional. - Default: 1.0 - Speed must be >= 1 / 64. This sets both min and max speed.
  • min_speed - Types/float - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be >= 1 / 64.
  • max_speed - Types/float - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be >= min_speed.

Optional properties

aggregation

Type: Types/table

Table with the following members:

  • max_count - Types/uint32 - Mandatory.
  • progress_threshold - Types/float - Optional. - Default: 1.0 - If count already playing is true, this will determine maximum progress when instance is counted toward playing sounds.
  • remove - Types/bool - Mandatory.
  • count_already_playing - Types/bool - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.

allow_random_repeat

Type: Types/bool

Default: false

audible_distance_modifier

Type: Types/double

Default: 1.0

variations

Type: Types/table (array) of Types/tables

Array of tables with the following members:

  • filename - Types/FileName - Mandatory.
  • volume - Types/float - Optional. - Default: 1.0
  • preload - Types/bool - Optional.
  • speed - [[Types/float] - Optional. - Default: 1.0 - Speed must be >= 1 / 64. This sets both min and max speed.
  • min_speed - Types/float - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be >= 1 / 64.
  • max_speed - Types/float - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be >= min_speed.

filename

Type: Types/FileName

Mandatory if variations is not given.

volume

Type: Types/float

Default: 1.0

Only loaded if variations is not given.

preload

Type: Types/bool

Only loaded if variations is not given.

speed

Type: Types/float

Default: 1.0

Only loaded if variations is not given. Speed must be >= 1 / 64. This sets both min and max speed.

min_speed

Type: Types/float

Default: 1.0

Only loaded if variations is not given. Not loaded if speed is present. Speed must be >= 1 / 64.

max_speed

Type: Types/float

Default: 1.0

Only loaded if variations is not given. Mandatory if max_speed is present, otherwise not loaded. Must be >= min_speed.

Example

   {
     filename = "__base__/sound/ambient/world-ambience-3.ogg",
     volume = 1.2
   }

Prototype properties that use this type