Adding custom music and disable original music

Place to get help with not working mods / modding interface.
Post Reply
GaXyLa
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Feb 28, 2016 11:56 am
Contact:

Adding custom music and disable original music

Post by GaXyLa »

Hey,
So i want to add my own custom music to the game.
With this lua code it is possible:

https://github.com/db48x/original-music ... c/data.lua

but there is one problem. It ADDS music, but doesnt disable the old original music.

So how can i disable the original music that allows me to play only my custom music.
it would be nice if anyone has a solution :)

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Adding custom music and disable original music

Post by Choumiko »

This in front of the data:extend should do it, i think:

Code: Select all

data.raw["ambient-sound"] = {}

Yaua
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Jan 22, 2015 4:26 pm
Contact:

Re: Adding custom music and disable original music

Post by Yaua »

Choumiko wrote:This in front of the data:extend should do it
So,

Code: Select all

data:extend(
should be :

Code: Select all

data.raw["ambient-sound"] = {}
data:extend(
.....
?
(I'm sorry, I don't know a lot in this kind of things, but would be very interested too)


Yaua
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Jan 22, 2015 4:26 pm
Contact:

Re: Adding custom music and disable original music

Post by Yaua »

Ok ! Thank you !

May I ask what are the differences between "early-game" and "main-track" ?

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Adding custom music and disable original music

Post by Choumiko »

Yaua wrote:Ok ! Thank you !

May I ask what are the differences between "early-game" and "main-track" ?
Not sure, my guess would be that songs under "early-game" are only played for a certain time after the start of the map?

Yaua
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Jan 22, 2015 4:26 pm
Contact:

Re: Adding custom music and disable original music

Post by Yaua »

Choumiko wrote:
Yaua wrote:Ok ! Thank you !

May I ask what are the differences between "early-game" and "main-track" ?
Not sure, my guess would be that songs under "early-game" are only played for a certain time after the start of the map?
So, I tried to add the line at the beginning as you advised :

Code: Select all

data.raw["ambient-sound"] = {}
It seems to works, but the musics added by the custom file seems disabled too. Except when you just load your save or start a new game, here you have one track playing, but after, that's silence.
This will may be be a dumb remark, but... can't this be related to the fact the track specified in custom file are labelled ""ambient-sound" ?
Example :

Code: Select all

{
    type = "ambient-sound",
    name = "Original Factorio Haluzsqua (HD)",
    track_type = "main-track",
    sound =
    {
      filename = "__original-music-hd__/FactorioHaluzsqua.ogg"
    }

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Adding custom music and disable original music

Post by Choumiko »

I'm not sure how Factorio decides what to play. In the data file i noticed 3 different track_types:
early game
main-track
interlude

Maybe try making it interlude for all. Or wait for someone to answer who knows it :)

Yaua
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Jan 22, 2015 4:26 pm
Contact:

Re: Adding custom music and disable original music

Post by Yaua »

Choumiko wrote: Maybe try making it interlude for all. Or wait for someone to answer who knows it :)
Ahah, thanks !
Well, unfortunately, it didn't solved the problem. So for now, I simply disabled the music, and I'm using winamp in random and repeat mode (not the ideal but well...). Thank you very much for your help !
But if someone has the answer, please tell us ! :)

Pascali
Fast Inserter
Fast Inserter
Posts: 170
Joined: Wed Aug 23, 2017 8:24 pm
Contact:

Re: Adding custom music and disable original music

Post by Pascali »

GaXyLa wrote: So i want to add my own custom music to the game.
With this lua code it is possible:

https://github.com/db48x/original-music ... c/data.lua
where do i have to copy the lua code?

Post Reply

Return to “Modding help”