Prototype/Sound: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.18.17)
Line 23: Line 23:
* remove - [[Types/bool|bool]] - Mandatory.
* remove - [[Types/bool|bool]] - Mandatory.
* count_already_playing - [[Types/bool|bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.
* count_already_playing - [[Types/bool|bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.
{{Prototype property|allow_random_repeat|[[Types/bool|bool]]|false|optional=true}}


{{Prototype property|audible_distance_modifier|[[Types/double|double]]|1.0|optional=true}}
{{Prototype property|audible_distance_modifier|[[Types/double|double]]|1.0|optional=true}}
Line 31: Line 33:
* volume - [[Types/float|float]] - Optional. - Default: 1.0
* volume - [[Types/float|float]] - Optional. - Default: 1.0
* preload - [[Types/bool|bool]] - Optional.
* preload - [[Types/bool|bool]] - Optional.
* speed - [[Types/float|float]] - Optional. - Default: 1.0 - Speed must be >= 1 / 64. This sets both min and max speed.
* min_speed - [[Types/float|float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be >= 1 / 64.
* max_speed - [[Types/float|float]] - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be >= min_speed.


{{Prototype property|filename|[[Types/FileName|FileName]]|optional=true}}
{{Prototype property|filename|[[Types/FileName|FileName]]|optional=true}}
Line 40: Line 45:
{{Prototype property|preload|[[Types/bool|bool]]|optional=true}}
{{Prototype property|preload|[[Types/bool|bool]]|optional=true}}
Only loaded if <code>variations</code> is not given.
Only loaded if <code>variations</code> is not given.
{{Prototype property|speed|[[Types/float|float]]|1.0|optional=true}}
Only loaded if <code>variations</code> is not given. Speed must be >= 1 / 64. This sets both min and max speed.
{{Prototype property|min_speed|[[Types/float|float]]|1.0|optional=true}}
Only loaded if <code>variations</code> is not given. Not loaded if speed is present. Speed must be >= 1 / 64.
{{Prototype property|max_speed|[[Types/float|float]]|1.0|optional=true}}
Only loaded if <code>variations</code> is not given. Mandatory if max_speed is present, otherwise not loaded. Must be >= min_speed.

Revision as of 11:33, 6 April 2020

Template:Prototype parent Specifies a sound that can be used with https://lua-api.factorio.com/latest/Concepts.html#SoundPath during runtime.

Template:Prototype TOC

Mandatory properties

Template:Prototype property Must be "sound".

Template:Prototype property Name of the sound. Must be unique. Used as a https://lua-api.factorio.com/latest/Concepts.html#SoundPath.

Optional properties

Template:Prototype property One of "game-effect", "gui-effect", "environment", "walking" and "alert".

Template:Prototype property Table with the following members:

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

Template:Prototype property

Template:Prototype property

Template:Prototype property Array of tables with the following members:

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

Template:Prototype property Mandatory if variations is not given.

Template:Prototype property Only loaded if variations is not given.

Template:Prototype property Only loaded if variations is not given.

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

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

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