Page 1 of 1

Stop factorio using vanilla ambient music

Posted: Sun May 24, 2020 10:12 pm
by SpacebladeofWTF
i've seen a cool mod that add communist song but it will also play the vanilla music if someone could create a mod that prevent the game using the vanilla song (or know the lua command i know how to add song but this dunno mate)

Re: Stop factorio using vanilla ambient music

Posted: Mon May 25, 2020 11:03 am
by darkfrei
SpacebladeofWTF wrote: Sun May 24, 2020 10:12 pm a mod that prevent the game using the vanilla song
Place it into the data.lua in your mod (not tested):

Code: Select all

for ambient_sound_name, ambient_sound in pairs (data.raw["ambient-sound"]) do
  ambient_sound.sound.volume = 0
end
or

Code: Select all

for ambient_sound_name, ambient_sound in pairs (data.raw["ambient-sound"]) do
  data.raw["ambient-sound"][ambient_sound_name] = nil -- may be not stable
  -- probably at least one prototype with 
  -- ambient_sound.track_type = "main-track"
  -- and at least one prototype with 
  -- ambient_sound.track_type = "interlude"
end