1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Need Help Create a Music Pack

Discussion in 'Storm Coding' started by danitim1, Jun 21, 2016.

  1. danitim1

    danitim1 Sanka Da Vinci Storm Modder

    Joined:
    Apr 11, 2012
    Messages:
    169
    Gender:
    Male
    Location:
    Brazil, MG
    Hi everyone! I need some help with creating a music pack for POTC and I really can't figure it out why isnt the game registering my music pack, everything is in place, here is my code, I toke and example of LegendarySpider music pack, and his code works but mine doesnt, I wanted to know why. Here is my code.
     

    Attached Files:

  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,620
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    At the moment I'm unable to check this. Please remind me later.

    In the meantime, I wonder if perhaps @Grey Roger could have a look?
     
  3. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,411
    I don't know in detail how this works. All I've done music-wise is to add a few files to the normal location and add a few lines in "music_standard.c" to integrate them into the general sound scheme.

    The differences between the above attached "music_piratesofthecaribbean.c" and the normal "music_standard.c", apart from the file name are:

    All music files are now loaded from "MUSIC\Pirates\" instead of "MUSIC\" - presumably, by extension, the actual folder names would be "RESOURCE\Sounds\MUSIC\Pirates" and "RESOURCE\Sounds\MUSIC\Pirates" respectively. @danitim1: do you have folder "RESOURCE\Sounds\MUSIC\Pirates" containing copies of all the music sound files you don't want to replace as well as the specific files you do want to use? (I'm assuming that, for example, 'tmpref.silence.f1.name = "MUSIC\Pirates\silence.ogg"' is not a new version of a file containing silence. ;))

    At the end is this code:
    Code:
    void RegisterMusicScheme()
    {
       ref rms; makeref(rms, registered_music_schemes);
       int n = GetAttributesNum(rms);
       string lnode = "l" + n;
       rms.(lnode).id = "PotCgame";
       rms.(lnode).resdir = "Pirates";
       switch (LanguageGetLanguage())
       {
         case "Polish":
           rms.(lnode).name = "Piraci z Karaibów";
         break;
         // default:
           rms.(lnode).name = "Pirates of the Caribbean";
       }
    }
    This is different to what's in the normal file:
    Code:
    void RegisterMusicScheme()
    {
       ref rms; makeref(rms, registered_music_schemes);
       string lnode = "l0";
       rms.(lnode).id = "standard";
       rms.(lnode).resdir = "";
       switch (LanguageGetLanguage())
       {
         // default:
           rms.(lnode).name = "Standard";
       }
    }
     
  4. danitim1

    danitim1 Sanka Da Vinci Storm Modder

    Joined:
    Apr 11, 2012
    Messages:
    169
    Gender:
    Male
    Location:
    Brazil, MG
    Hi Roger, I do have a folder with the copy of the musics, but in game it doesnt show in the Options>Sound. It just shows the standard, If I change the
    string lnode = "l1"; to string lnode = "l0"; it changes the name from the "Standard" to "Pirates of the Caribbean".
     
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,620
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    One thing you could do:
    1. Move your changes to a safe spot
    2. Install the PotC Music Pack that does work
    3. Slightly modify it to be more in line with your file, then see if it still works
    4. Repeat until it stops working

    At the moment I am too tired to check it properly.
    I don't see anything stand out as being obviously wrong, so the above is probably what I'd end up doing myself. :facepalm
     

Share This Page