1. 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
  2. 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
  3. New Horizons logo

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

  4. 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 Music question..?

Discussion in 'Hoist the Colours (Jack Sparrow)' started by Jones, May 6, 2017.

  1. Jones

    Jones Sailor Apprentice

    Joined:
    Apr 16, 2017
    Messages:
    59
    Gender:
    Male
    I know, it's a strange question, but the point is: can you set up a determinate music for (example) 'hoist the colour' storyline and those of 'freeplay'? Because, playing to both, music is always the same... So you can determinate the music in the various storylines?
     
  2. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    There are several music packs, but I think at the moment only the PotC film peach is compatible with recent mods.
    I can't remember if the music pack is saved with the profile though.

    There is also a "storyline main theme" feature, but that needs to be set up properly at different points in the story to live up to its name.
     
  3. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    On a related note, is it possible to change the music which plays while sailing, temporarily replacing the multiple choices with a single file? And then put back the usual setting later? At the moment I've got my "Ardent" end theme playing when you leave the town hall, which is when the storyline ends, but the music is more suitable for the sea so ideally I'd like it to trigger when you put to sea, then revert to the normal sailing music when you go to worldmap or direct-sail to another island, either of which should be triggered by the "MapEnter" quest check. One complication is that there are different choices of sailing music depending on whether it's day, night or storm.
     
  4. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That might require a quest override in the music playing code.
    Maybe @Jack Rackham knows where to do that; must be somewhere in PROGRAM\SOUNDS\sound.c, I think?

    My imagined solution would be to have a "pchar.quest.seamusic" attribute that overrides the default.
    Would that make any sense?
     
  5. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,224
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    This is how I change music temporary in a location I'm already in.

    Code:
    PauseAllSounds();//stops music
                locations[FindLocation("wr_church_outside")].type = "silent_jungle";// new temp sound type
                PostEvent("LoadSceneSound", 0.1);//starts music
    changing back to original would be about the same but

    Code:
    PauseAllSounds();
                locations[FindLocation("wr_church_outside")].type = "Vane_jungle";//default sound type
                PostEvent("LoadSceneSound", 0.1);
    I don't know if you can translate this to the sailing situation.
     
  6. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    One thing I did try, which was messy, was to replace every option with my theme:
    Code:
       ref tmpref; makeref(tmpref, Music_Alias);
       tmpref.music_day_sailing.f1.name = "MUSIC\Mare Nostrum.ogg";
       tmpref.music_day_sailing.f2.name = "MUSIC\Mare Nostrum.ogg";
       tmpref.music_day_sailing.f3.name = "MUSIC\Mare Nostrum.ogg";
       tmpref.music_day_sailing.f4.name = "MUSIC\Mare Nostrum.ogg";
    That was a very temporary fix which went into "console.c" and was just to check that the new theme worked. It would need rather more lines to cover sailing at night or in storm, as well as code to store the original settings and then put them back later, but it did what I wanted, which was to have the new theme play every time I went to sea during non-stormy weather in daytime. (And, incidentally, showed that the music was too quiet compared to other PoTC music, but I have sound editing software which took care of that.)

    How would that "PChar.quest.seamusic" attribute be implemented? Presumably you set it on the player character when you want the quest-specific music to play and then cancel it to resume normal music, but it's the code to have quest-specific music play, then resume normal music, which is the problem. The attribute just seems to be a convenient way to trigger such code.
     
  7. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    No, that's what I tried first. I don't think sea locations such as "Cuba" respond to the "type" attribute. It does work on land, which is how I've currently set the end theme to play as soon as you leave the town hall.
     
  8. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I did just find this code that we added for when the Cursed Dutchman emerges from the depths:
    Code:
                    PauseAllSounds();
                    FadeOutMusic(150);
                    PlaystereoOGG("music_emerge_dutchman");
                    //FadeOutMusic(500);
                    if (!bDisableMapEnter)    PostEvent("LoadSceneSound", 110000);
                    else                    PostEvent("LoadSceneSound", 41500);
    
    Maybe that is of any help?
     
  9. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    What do the numbers in the 'PostEvent' lines mean?
     
  10. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    They're a delay time in milliseconds.
     
  11. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    Why the distinction between whether or not 'DisableMapEnter' is in effect?

    Both the pieces of music for "music_emerge_dutchman" are 10 seconds long. That code would seem to delay normal music being resumed by almost 2 minutes if map is not disabled, and 41.5 seconds if it is. (The piece of music I'm planning to use is a little over 5 minutes, so presumably I'll want a delay of at least 300000.)
     
  12. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I honestly don't remember and was wondering the same thing. :keV

    Maybe because the battle music lasts longer?
     
  13. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    It doesn't work, anyway. Even with that code in place, background music still plays.

    Here's my "compile.log" after loading up a savegame in port, putting to sea, then immediately quitting. It seems the sailing music is set twice:
    Code:
    SEA: sealogin loading island Cuba
    SEA: added pchar to sea
    
    <several ships and their captains generated>
    Code:
    SEA: Did CRs
    SEA: Did any groups
    SEA: added ships
    SEA: Set tasks
    updated AISea
    Seafoam done
    Telescope initiated
    SETTING MUSIC: music_day_sailing
    SETTING MUSIC: music_day_sailing
    ResumeAllSounds
    SEA: SeaLogin end
    Sea_FirstInit
    FLAGS: The 'Santiago Fort' has spotted us at 572.45, but is not interested as we are not hostile
    FLAGS: The 'Anunciación' has spotted us at 863.92, but is not interested as we are not hostile
    PauseAllSounds
    Quest name finale_end_theme FOUND in QuestComplete
    Sea_FirstInit done
    SETTING MUSIC: music_day_sailing
    SETTING MUSIC: music_day_sailing
    ResumeAllSounds
    "Quest name finale_end_theme" is the quest case which is supposed to play the end music, and does - and then the sailing music starts up again anyway. It does that even if I comment out the 'PostEvent' line.
     

    Attached Files:

  14. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Have you tried increasing the number on this line?
    Code:
    FadeOutMusic(150);
    
    Maybe that mutes the music for a set period of time?
     
  15. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    Yes, I did try increasing it, but I imagine that if it mutes the music for that number of milliseconds then the original line is going to have next to no effect for the Dutchman. My guess is that it's supposed to wait that long before starting the fade, or maybe make the fade take that long. Either way, it didn't help, probably because the system does everything the code says and then starts up the music again. This is perhaps because I'm trying to do it right after putting to sea; by contrast, when the Dutchman emerges, you're already at sea.
     
  16. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    So... the search continues then.
    I know there must be a way to do what you want; it's just a matter of figuring out the best way to do it.

    Have you had a look at sound.c already?
     
  17. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,506
    Yes, while trying to find out exactly what 'FadeOutMusic' does. I couldn't figure out what it does because it eventually ends up at a 'SendMessage' command, and I've no idea how those work. It's also how I know I need to deal separately with night and day sailing music. Storm music isn't going to be an issue because the end theme doesn't work too well with a storm anyway, so a 'SetNextWeather' command means it's going to be a clear day (or night) when you sail off into free-play.

    So I'm back to trying a bunch of commands to store the values of the current "tmpref.music_day_sailing.f*.name" attributes, set the attributes all to "Silence.ogg", and play my end theme. A further quest, triggered by "MapEnter", can put the attributes back from wherever I stored them.
     
  18. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Simplest explanation: 'SendMessage' tells the game engine to do something.
    So whatever it does, that's the part where we lose control and cannot influence what it does anymore.

    I think there is code in sound.c that actually plays the sea music; that is also where the day/night difference is handled.
    If you find that, you can probably add a simple quest override in place there.
    I imagine that is the easiest solution, so that's the one I would recommend.
     
  19. Jones

    Jones Sailor Apprentice

    Joined:
    Apr 16, 2017
    Messages:
    59
    Gender:
    Male
    I was interested in a post created by a certain @chri "how to create nation, add music and create a new quest-book?" The part of this post is that of kraken, to add the effect music as soon as the kraken evokes. But the two files modified by @Pieter Boelen do not work for me ...
     
  20. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    65,409
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    You'll have to post a link to the relevant post.
    I haven't a clue what I did back then. :facepalm
     

Share This Page