Types/Sound: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Prototype property type usage)
(Removed old prototype docs)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/Sound.html https://lua-api.factorio.com/latest/types/Sound.html]
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.


== Optional properties ==
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
=== 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.
 
=== audible_distance_modifier ===
'''Type''': [[Types/double]]
 
'''Default''': 1.0
 
=== variations ===
'''Type''': [[Types/table]] of [[Types/table]]s
 
Array of tables with the following members:
* filename - [[Types/FileName]] - Mandatory.
* volume - [[Types/float]] - Optional. - Default: 1.0
* preload - [[Types/bool]] - Optional.
 
=== filename ===
'''Type''': [[Types/FileName]]
 
Mandatory if <code>variations</code> is not given.
 
=== volume ===
'''Type''': [[Types/float]]
 
'''Default''': 1.0
 
Only loaded if <code>variations</code> is not given.
 
=== preload ===
'''Type''': [[Types/bool]]
 
Only loaded if <code>variations</code> is not given.
 
==Example==
    {
      filename = "__base__/sound/ambient/world-ambience-3.ogg",
      volume = 1.2
    }
 
{{Prototype property type usage|{{FULLPAGENAME}}}}

Latest revision as of 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/Sound.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.