Prototype/AmbientSound: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added prototype type to page)
m (Protected "Prototype/AmbientSound": Migrated prototype doc to separate website ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Basics==
'''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/prototypes/AmbientSound.html https://lua-api.factorio.com/latest/prototypes/AmbientSound.html]
Prototype type: '''ambient-sound'''


This prototype is used to make sound, while playing the game. This includes background noise, such as trees and wind, or the in-game's music, composed by Daniel James Taylor.
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].
==Properties==
=== type ===
'''Type''': [[Types/string]]


{{Prototype parent}}
This prototype is used to make sound while playing the game. This includes the game's [https://store.steampowered.com/app/436090 music], composed by Daniel James Taylor.
{{Prototype TOC|ambient-sound}}
==Mandatory properties==
{{Prototype property|type|[[Types/string|string]]}}
Specification of the type of the prototype. Must be "ambient-sound".
Specification of the type of the prototype. Must be "ambient-sound".


=== name ===
{{Prototype property|name|[[Types/string|string]]}}
'''Type''': [[Types/string]]
 
Unique textual identification of the prototype.
Unique textual identification of the prototype.


===track_type===
{{Prototype property|sound|[[Types/Sound|Sound]]}}
'''Type''': [[Types/string]]
The sound file and volume.


{{Prototype property|track_type|[[Types/string|string]]}}
This lets the game know in what instances the audio file is played.
This lets the game know in what instances the audio file is played.


The following types are recognized:
The following types are recognized:


  "early-game"
* "early-game"
  "main-track"
* "main-track"
  "interlude"
* "interlude"
  "late-game"
* "late-game"
===sound===
* "menu-track"
'''Type''': [[Types/Sound]]


The sound file and volume.
"menu-track" is only played in the main menu. "early-game", "late-game" and "main-track" are all considered main tracks and played interleaved (alternating) with "interlude" tracks. "early-game" and "late-game" have no special effects compared to "main-track" meaning that are functionally the same.


=== weight ===
== Optional properties ==
'''Type''': [[Types/double]]


'''Default''': 1
{{Prototype property|weight|[[Types/double|double]]|1|optional=true}}


==Example==
== Example ==
   {
   {
     type = "ambient-sound",
     type = "ambient-sound",

Latest revision as of 09:27, 16 August 2023

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/prototypes/AmbientSound.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.


Prototype definitions » Prototype/AmbientSound


This prototype is used to make sound while playing the game. This includes the game's music, composed by Daniel James Taylor.


Prototype/AmbientSound — ambient-sound
name::string
sound::Sound
track_type::string
type::string
weight::double (optional)

Mandatory properties

type

Type: string
Specification of the type of the prototype. Must be "ambient-sound".

name

Type: string
Unique textual identification of the prototype.

sound

Type: Sound
The sound file and volume.

track_type

Type: string
This lets the game know in what instances the audio file is played.

The following types are recognized:

  • "early-game"
  • "main-track"
  • "interlude"
  • "late-game"
  • "menu-track"

"menu-track" is only played in the main menu. "early-game", "late-game" and "main-track" are all considered main tracks and played interleaved (alternating) with "interlude" tracks. "early-game" and "late-game" have no special effects compared to "main-track" meaning that are functionally the same.

Optional properties

weight

Type: double
Default: 1

Example

 {
   type = "ambient-sound",
   name = "world-ambience-4",
   track_type = "interlude",
   sound =
   {
     filename = "__base__/sound/ambient/world-ambience-4.ogg",
     volume = 1.2
   }
 },