Page 1 of 1

How to turn off the original music?

Posted: Tue Nov 20, 2018 3:46 am
by Artanis_Mattias
Good afternoon, I'm new here.
I must warn you right away, I do not know English very well, I am from Russia, and I am only learning it.
I made a couple of music mods, but my friends wanted something to turn off the original songs.
You do not know how this can be done?

Code: Select all

data:extend(
{
{
    type = "ambient-sound",
    name = "1",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/02_Blood_Dragon_Theme.ogg"
    }
  },   
  {
	type = "ambient-sound",
    name = "29",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft_II_Legacy_of_the_Void.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "30",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/Warhammer_40000_Dawn_of_War_II.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "31",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran1.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "32",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran2.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "33",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran3.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "34",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran4.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "35",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-01.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "36",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-02.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "37",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-03.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "38",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-04.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "39",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-05.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "40",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/ZSwarm_Music_Terran7_Action.ogg"
    }
  },
 }
)

Re: How to turn off the original music?

Posted: Tue Nov 20, 2018 8:13 am
by darkfrei
Not tested, but it must be like that:

Code: Select all

for i, sound in pairs (data.raw["ambient-sound"]) do
  if sound.track_type and sound.track_type == "main-track" then
   data.raw["ambient-sound"][i] = nil
  end
end
Just add it before adding your music.

(Updated)

Re: How to turn off the original music?

Posted: Tue Nov 20, 2018 4:01 pm
by Artanis_Mattias
Thanks for the answer!
I did everything right? If yes, then, unfortunately, it did not work.

Code: Select all

for i, sound in pairs (data.raw["ambient-sound"]) do
  if sound.track_type and sound.track_type == "main-track" then
   sound = nil
  end
end
data:extend(
{
{
    type = "ambient-sound",
    name = "1",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/02_Blood_Dragon_Theme.ogg"
    }
  },   
  {
	type = "ambient-sound",
    name = "29",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft_II_Legacy_of_the_Void.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "30",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/Warhammer_40000_Dawn_of_War_II.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "31",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran1.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "32",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran2.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "33",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran3.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "34",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran4.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "35",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-01.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "36",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-02.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "37",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-03.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "38",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-04.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "39",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-05.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "40",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/ZSwarm_Music_Terran7_Action.ogg"
    }
  },
 }
)

Re: How to turn off the original music?

Posted: Tue Nov 20, 2018 4:45 pm
by DaveMcW

Code: Select all

for key,_ in pairs (data.raw["ambient-sound"]) do
  data.raw["ambient-sound"][key] = nil
end

Re: How to turn off the original music?

Posted: Tue Nov 20, 2018 8:09 pm
by darkfrei
Artanis_Mattias wrote: Tue Nov 20, 2018 4:01 pm Thanks for the answer!
I did everything right? If yes, then, unfortunately, it did not work.
Yes, it was my bug, it must be deleted with the key, see above.

Re: How to turn off the original music?

Posted: Wed Nov 21, 2018 6:27 pm
by Artanis_Mattias
Unfortunately, all the music from the game is gone. Including added music added by this mod.

Code: Select all

for key,_ in pairs (data.raw["ambient-sound"]) do
  data.raw["ambient-sound"][key] = nil
end
data:extend(
{
{
    type = "ambient-sound",
    name = "1",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/02_Blood_Dragon_Theme.ogg"
    }
  },   
  {
	type = "ambient-sound",
    name = "29",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft_II_Legacy_of_the_Void.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "30",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/Warhammer_40000_Dawn_of_War_II.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "31",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran1.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "32",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran2.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "33",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran3.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "34",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/SC1_Terran4.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "35",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-01.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "36",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-02.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "37",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-03.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "38",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-04.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "39",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/TerranSC2-05.ogg"
    }
  },
  {
	type = "ambient-sound",
    name = "40",
    track_type = "main-track",
    sound =
    {
      filename = "__CustomMusicfromMattiasPart1__/music/StarCraft/ZSwarm_Music_Terran7_Action.ogg"
    }
  },
 }
)