• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Music switch....anyone have ideas?

Status
Not open for further replies.

modernknight1

Field Marshall of Hot Tubs
Staff member
Storm Modder
So I'm no novice to adding and changing out music, but I have a couple questions.

After finishing the substitutions and additions for GOF Eras I'm noticing that not all tracks are playing. It could be that the randomizer just hasn't selected them, but I'm not certain. I've double checked format and everything is perfect. Now I'm wondering if certain types of tracks like Seafight and Landfight are limited on the number of tracks that can be randomly selected.

If this is the case does anyone know what file I would look in to increase the numbers?

Also I was wondering much like my question about random loading screens if I could add some code that would better specify what I wanted played where and when. If so how would I go about writing the cases and where would I put this new code?

Along these lines I was also wondering if a switch could be added that would take the user to an alternate set of music tracks. A lot of people like my classical soundtrack, but some folks have wanted different music. So what if I had a switch that in the menu options allowed:

1. Period Music - or - 2. Pirate Movie Theme Music

How would one implement this?

MK
 
Could you upload your current SOUND folder? I've seen so many different versions of that code, both in PotC and other games, that I don't think I can help until I see it.
I know PotC has support for music packs, but that isn't simple coding and I'm pretty sure it doesn't work properly yet.
Pirate_KK completely rewrote the music and sound code at least twice already. o_O
 
Sure will - but it will be a few hours before I get to it. Appreciate you looking at it Pieter.

MK
 
Am I correct to assume it is nearly the same as the unmodified music_alias.ini file? If so, that is pretty much exactly how the stock PotC music system works.
Sounds through INI files are known to do weird stuff though. As Hook found out on PotC many years ago, if you add too much, some of them start "dropping out".
That is the reason why Pirate_KK rewrote the entire system for the PotC Build Mod, but I don't think that would be easily adapted to CoAS.
Plus it still doesn't work quite right in PotC either.

My recommendation for now is to simply try not to add too much. There might be a limitation on the number of sound/music tracks the game will make use of per case.
But I think on both stock games, this is handled internally by the engine somehow, so I'm not sure how that works.
And the source code is far too complex for me to make sense of. I had a quick look, trying to figure out how the music system is set up, but I'm afraid that is beyond me for now. :(
 
See Program\sound.c for the code that decides on sound and music schemes for various locations. Note the various SetMusicAlarm lines.
You might be able to switch between two different packs by using different SetMusicAlarm lines:
Code:
if(PERIOD_MUSIC) SetMusicAlarm("music_spokplavanie_mk");
else SetMusicAlarm("music_spokplavanie");
And make the accompanying copied entries in the music alias file.
 
That's just what I was looking for on the switch!

Well I think you may be right on how the music is handled and I have a LOT of music in there. Maybe I will cut it back a notch.

MK
 
Status
Not open for further replies.
Back
Top