Changing music in game

Discussion in 'Starbound Modding' started by Slug, Dec 14, 2013.

Thread Status:
Not open for further replies.
  1. Slug

    Slug Scruffy Nerf-Herder

    Hello world of bound.

    (Before I start, let me stress that I love the start music in this game. I bought the soundtrack and it's great, I'm not implying it needs to be changed or anything of that nature.)

    I was fiddling about in the game files as people tend to do, and I noticed the title theme was labeled "TitleMenuMusic.ogg", (that's under assets/music in the base folder) I decided to change it to one of my favorite starter themes (from Tower of Heaven's intro), just by changing the name of my new .ogg file, to "TitleMenuMusic" and replaced it in the folder. Then on starting the game, the title theme was replaced with something a big more... driving. I'm sure this can be done all over (Make backups!) using whatever .ogg file you see fit for a custom music theme.
     
  2. SeanWPayton

    SeanWPayton Void-Bound Voyager

    The battle music is in /assets/client and each biome surface file has its music in the surface file. I added a bunch of music today!

    Files must be in .ogg format though!
     
  3. Slug

    Slug Scruffy Nerf-Herder

    It's actually incredibly nice that this game is so easily moddable, and it seems that the devs support modding. It's games like starbound that make me look forward to the future of games. I'm having trouble isolating a good source of .ogg files, but at least tower of heaven's intro is the new intro. Gets me pumped to strip some planets and fly in a space rectangle!!
     
  4. SeanWPayton

    SeanWPayton Void-Bound Voyager

    Well I have about 40gb++ of video game soundtracks, all I do is convert the song I want to an mp3, point the text in its direction and done! The OST is already amazing so k haven't done much with that. I'll probably add in all the original soundtracks songs at some point.
     
  5. Slug

    Slug Scruffy Nerf-Herder

    No sir, not mp3 files, it takes .ogg files. I'm not sure if there are any converters for mp3 to .ogg
     
  6. SeanWPayton

    SeanWPayton Void-Bound Voyager

    Oops, yeah...convert to an .ogg from mp3. Don't know why I said that. I just use this website to convert my files.

    http://media.io/
     
  7. Slug

    Slug Scruffy Nerf-Herder

    Hey that'll really come in handy! Wouldn't mind Holy Diver playing while under water! (Just kidding, but still it'd be neat)
     
  8. DarthNihilus

    DarthNihilus Scruffy Nerf-Herder

    Is it possible to make custom music while onboard the ship?
     
  9. CptSteam

    CptSteam Aquatic Astronaut

    To jump on to this thread, is it possible to make a placeable item that plays music when you interact with it?
     
  10. MewMan

    MewMan Phantasmal Quasar

    Actually Yes it is. The Jukebox the Apex have plays a song when you turn it on. Simply just change the .Ogg . I imagine. Or make a mod for it out of those files :p And there you go. a jukebox that plays what you want. Idk about the actual music however. It would be nice to change it without editing the assets.
     
  11. coolsp0t

    coolsp0t Phantasmal Quasar

    Dont change files in Assets! Thats a dirt solution, when you got a nice mod system like this. Start to write a Mod by your own. Its so easy to make an object that starts to play music, when you are activate it. Its also possible that you declare more as one soundfile.
     
  12. MewMan

    MewMan Phantasmal Quasar

    I know not to edit the Assets. what I meant was that you could copy the files. and what not. make a mod out of it. Like I said It would be nice to change without editing the assets. In fact I've already worked on it xD
     
  13. D1v1d3m4n

    D1v1d3m4n Intergalactic Tourist

    I'm putting My Innermost Apocalypse from The Binding Of Isaac as the fight music for everything!!
     
  14. biadesman

    biadesman Void-Bound Voyager

    What's the name of the boss battle theme's, I can't figure it out for the life of me :'(
    I mean, I can obviously tell by the names of the files which are battle themes, but like I said, which of those are boss themes?
     
  15. D1v1d3m4n

    D1v1d3m4n Intergalactic Tourist

    My Innermost Apocalypse is when you fight Isaac.
     
  16. Wise Nyt

    Wise Nyt Subatomic Cosmonaut

    Is there any chance you could show us a code example of how you'd go about doing that? I've been learning to mod but I'm having a diffcult time trying to replace the apexrecordplayer sound with another in game sound (music).
     
  17. Olxinos

    Olxinos Scruffy Nerf-Herder

    Open the vanilla objects/apex/apexrecordplayer.object you should see something like that:
    Code:
    {
      "objectName" : "apexrecordplayer",
      "rarity" : "Common",
      "objectType" : "noisy",
      [...]
      "sounds" : [ "/sfx/objects/jungleloveall.ogg" ]
    }
    
    ([...] means it's a bit long to copy/paste here, it isn't in the vanilla file of course)
    You notice a "sounds" array which contains the path to an audio file (.ogg are audio files, see here).
    Let's say you want to change that sound, the clean way is to replace the path in your .object file to the sound with another, for instance "/sfx/objects/teleport_down.wav".
    To do that in the unstable version, you need to patch the .object file. Here you want to change the content of "sounds", so you could make something like this:
    Code:
    [
      {
        "op":"replace",
        "path":"/sounds",
        "value":["/sfx/tools/teleport_down.wav"]
      }
    ]
    Let's check it with a json patcher (copy/paste the content of apexrecordplayer.object in data and the patch code in patch; remove any commented line i.e. anything following a "//" and the "//" itself as it isn't standard json, here there isn't any).
    You should get that:

    Patch result: success
    Code:
    {
      "objectName" : "apexrecordplayer",
      "rarity" : "Common",
      "objectType" : "noisy",
      [...]
      "sounds" : [ "/sfx/tools/teleport_down.wav" ]
    }
    If you do, congratulations, your patch is correct.
    Now, name your patch "apexrecordplayer.object.patch", then put in your mod in some kind of mimicked subdirectory. For instance, apexrecordplayer.object is in objects/apex/apexrecordplayer/ so put your patch file in [your mod directory]/objects/apex/apexrecordplayer/.
    Add a .modinfo file in [your mod directory]/ so that the game knows it's a mod (you can check out other mods to see what you should write in your .modinfo file), for instance:
    pak.modinfo
    Code:
    {
      "name" : "my mod",
      "version" : "Beta v. Upbeat Giraffe",
      "path" : ".",
      "dependencies" : [ ],
      "metadata" :
      {
        "displayName" : "my mod",
        "author" : "me",
        "description" : "Change the sound of the apex record player.",
        "version" : 0,
        "support_url" : "http://community.playstarbound.com/index.php?resources/my-mod.42/"
      }
    }
    then simply put your mod inside the mods folder (without trying to pack it or anything, it's fine, just move the whole directory) and test it (fastest way: use "/admin" and "/spawnitem apexrecordplayer" if you don't already have one). If you have any problem, check starbound.log, if there's no error (but the mod still doesn't work), then you probably modified something irrelevant to the issue (that includes misplacing your patch file, misnaming what you want to change, trying to change deprecated attributes which should have been cleaned...).

    If you want to use one of your sounds instead of a vanilla sound, no problem, just put it in the mod folder and change the path to the sound to match its path (if possible, try to put it in a directory coherent with the vanilla assets structure, it may not be necessary but it helps other modders to understand how your mod works and where to find some specific file). Also make sure it doesn't have the same name as an already existing sound. To ensure compatibility with other mods try to avoid common names, or even include your name/starbound forum id in your file names when you're adding new files (btw the "my mod" name i used for this example is an horrible one, too abstract, too common).
    I attached a zip file with the mod example, although it's not really complicated.
     

    Attached Files:

  18. Wise Nyt

    Wise Nyt Subatomic Cosmonaut

    Thanks man.:up:
    With this I've manged to get it to work but I made a silly mistake of deleting the problem before finding out how I did it wrong. I got the patching right but when I tried loading up the game it failed before it started. In any case I'll try to do another music mod some time next week and see if I make the same mistake or if I get it right, maybe then I can see where I stand on this situation. Thanks again, I appreciate the quick response.
    Edit:
    I worked out the problem. It was a silly and small mistake, I forgot to put a "/" before music.
    Code:
    ["music/desert-exploration1.ogg"]
    Code:
    ["/music/desert-exploration1.ogg"]
    I should of saw it when reading your post. I think I just learnt how important a tiny error really is.
     
    Last edited: Jan 18, 2015
  19. Nice_Enderdragon

    Nice_Enderdragon Void-Bound Voyager

    I really want to try this but when i go to assets i can't see any folders named 'client'. I instead find a folder named 'user'. When i go there all there is is a 'songs' folder containing the playable instrument songs. what am I supposed to do?
     
  20. DaDasterdlyJurd

    DaDasterdlyJurd Intergalactic Tourist

    Its been two years since this was posted but, where exactly in the files do I look to find the main menu music?
     
Thread Status:
Not open for further replies.

Share This Page