Prototype/Sound: Difference between revisions
Jump to navigation
Jump to search
(Set prototype parent) |
(Converted to SMW format) |
||
Line 1: | Line 1: | ||
{{Prototype parent}} | {{Prototype parent}} | ||
Specifies a sound that can be used with https://lua-api.factorio.com/latest/Concepts.html#SoundPath during runtime. | |||
{{Prototype TOC|sound}} | |||
Prototype | |||
== Mandatory properties == | == Mandatory properties == | ||
{{Prototype property|type|[[Types/string|string]]}} | |||
Must be "sound". | Must be "sound". | ||
{{Prototype property|name|[[Types/string|string]]}} | |||
Name of the sound. Must be unique. Used in https://lua-api.factorio.com/latest/Concepts.html#SoundPath. | Name of the sound. Must be unique. Used in https://lua-api.factorio.com/latest/Concepts.html#SoundPath. | ||
== Optional properties == | == Optional properties == | ||
{{Prototype property|category|[[Types/string|string]]|"game-effect"|optional=true}} | |||
One of "game-effect", "gui-effect", "environment", "walking" and "alert". | One of "game-effect", "gui-effect", "environment", "walking" and "alert". | ||
{{Prototype property|aggregation|[[Types/table|table]]|optional=true}} | |||
Table with the following members: | Table with the following members: | ||
* max_count - [[Types/uint32]] - Mandatory. | * max_count - [[Types/uint32|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. | * progress_threshold - [[Types/float|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. | * remove - [[Types/bool|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|bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount. | ||
{{Prototype property|audible_distance_modifier|[[Types/double|double]]|1.0|optional=true}} | |||
{{Prototype property|variations|[[Types/table|table]] of [[Types/table|table]]s|optional=true}} | |||
Array of tables with the following members: | Array of tables with the following members: | ||
* filename - [[Types/FileName]] - Mandatory. | * filename - [[Types/FileName|FileName]] - Mandatory. | ||
* volume - [[Types/float]] - Optional. - Default: 1.0 | * volume - [[Types/float|float]] - Optional. - Default: 1.0 | ||
* preload - [[Types/bool]] - Optional. | * preload - [[Types/bool|bool]] - Optional. | ||
{{Prototype property|filename|[[Types/FileName|FileName]]|optional=true}} | |||
Mandatory if <code>variations</code> is not given. | Mandatory if <code>variations</code> is not given. | ||
{{Prototype property|volume|[[Types/float|float]]|1.0|optional=true}} | |||
Only loaded if <code>variations</code> is not given. | Only loaded if <code>variations</code> is not given. | ||
{{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. |
Revision as of 22:13, 27 July 2019
Prototype definitions » Prototype/Sound
Specifies a sound that can be used with https://lua-api.factorio.com/latest/Concepts.html#SoundPath during runtime.
Prototype/Sound — sound | ||
name | :: | string |
type | :: | string |
aggregation | :: | table (optional) |
allow_random_repeat | :: | bool (optional) |
audible_distance_modifier | :: | double (optional) |
category | :: | string (optional) |
filename | :: | FileName (optional) |
max_speed | :: | float (optional) |
min_speed | :: | float (optional) |
preload | :: | bool (optional) |
speed | :: | float (optional) |
variations | :: | table (array) of tables (optional) |
volume | :: | float (optional) |
Mandatory properties
type
Type: string
Must be "sound".
name
Type: string
Name of the sound. Must be unique. Used in https://lua-api.factorio.com/latest/Concepts.html#SoundPath.
Optional properties
category
Type: string
Default: "game-effect"
One of "game-effect", "gui-effect", "environment", "walking" and "alert".
aggregation
Type: table
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.
audible_distance_modifier
Type: double
Default: 1.0
variations
Type: table of tables
Array of tables with the following members:
- filename - FileName - Mandatory.
- volume - float - Optional. - Default: 1.0
- preload - bool - Optional.
filename
Type: FileName
Mandatory if variations
is not given.
volume
Type: float
Default: 1.0
Only loaded if variations
is not given.
preload
Type: bool
Only loaded if variations
is not given.