• 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 Adding SFX when sea battle

I know why. (I realised it earlier today.) It does work, I just forgot to mention that this is for making it play when you select the sails setting in the actions menu, not when you quick-set it by pressing the forwards and backwards buttons. Sorry... :oops:

You can implement it for the quick-setting as well, I'm just not sure where the function for that lies. Possibly somewhere in "controls.c"?

Thanks, sadly i don't found where it could be or how it could be called. I will maybe just pass it. As for the Playsound3D i will use playstereosound instead and it will do the job :)
 
To be honest, I have the sails up and down boatswain sounds from the first game implemented in my copy of CT, too, but I found the way it works in the first game to be annoying (with him constantly speaking as I move the ship), so I was content just having it in the actions menu (to use when I desire to hear him speak), and I've never really looked into how to make it work with the movement keys.

I suppose you could add the audio play to the function that the forward key activates (which should be noted in "controls.c"), moving the character forward, by putting it in an "are you sailing" conditional statement -- so that it doesn't play when you move on land or when boarding:

Code:
if (bSeaActive && !bAbordageStarted)
{
    PlaySound("interface\sailsdown.wav");
}
 
I finally got it to work copying the buho's code in gof mod of coas. That nice !

I think ill stop here the sound modification, i wanted to try calm ship deck ambient for when sailing, but i think i stop before make my game crash !

Thanks for all your help everybody.
 
Was TEHO missing all these ambient sound effects by default? o_O If so, that's a rather strange design choice to make from the developers. I wonder what the reasoning behind the removal of these was...
 
Ah, I see. That's fine, then. ^_^ Just keep in mind that each extra layer of sound eats up your computer's RAM (memory). The more simultaneous sounds, the less memory for the game where it really needs it. On a high performance computer with a lot of fast RAM you may not feel this, but it becomes quite noticeable when running the game on a low spec computer -- potentially may even freeze or crash the game if there are too many layers.
 
Yes i stop here i think, Also because now i should play it hahaha. The only thing i would like to add its the bell like in potc mod i played long time ago, Who sound each hour.. Do you know the code for that ?
 
The only thing i would like to add its the bell like in potc mod i played long time ago, Who sound each hour.. Do you know the code for that ?

No, can't say that I'm familiar with that. :no

Making it strike every hour may be a bit challenging, seeing as time is not something that passes at a constant rate in Sea Dogs. What I've done is I've added a ship's bell sound to when all my guns are reloaded at the same time. This means that when I change charge, I hear the ship's bell strike in a while -- usually when making sail. If you like this idea, you can have a look in the Gun Load Audio Feedback patch program files as to how I've accomplished that.
 
Making it strike every hour may be a bit challenging, seeing as time is not something that passes at a constant rate in Sea Dogs. What I've done is I've added a ship's bell sound
I wonder if the same applied in the unmodded PotC.
New Horizons definitely DOES have the time passing at sea.
That suggests to me that it must be possible to get that working in the other Sea Dogs as well.
 
I wonder if the same applied in the unmodded PotC.
New Horizons definitely DOES have the time passing at sea.
That suggests to me that it must be possible to get that working in the other Sea Dogs as well.

We've talked about this earlier, and the code you've shared with me will help. I think @Couchcaptain Charles' DirectSail mod introduced time passing while real-time sailing. The original POTC doesn't even have time noted anywhere, and real-time sailing seems to behave exactly the same way as in CT... frozen.
 
We've talked about this earlier, and the code you've shared with me will help. I think @Couchcaptain Charles' DirectSail mod introduced time passing while real-time sailing. The original POTC doesn't even have time noted anywhere, and real-time sailing seems to behave exactly the same way as in CT... frozen.
It could indeed be a mod-added thing.
I know for sure the on-screen time display was mod-added by @konradk.
But I don't remember for time passing in general.
 
We could add in the ship's bells sounding every half hour. It could be triggered by the hourly update, and we could check the time for the half hour bells, the same thing that changes the time display in the HUD. I thought about adding the bells to TEHO, but figured I'd get pretty tired of it after hearing it every two minutes while I'm sailing. We should probably check for time acceleration and not sound the bells if it is in effect, and I suspect almost everyone uses time acceleration when on deck even when in battle.

How many of us just like to sail, after all?

Hook
 
We could add in the ship's bells sounding every half hour. It could be triggered by the hourly update, and we could check the time for the half hour bells, the same thing that changes the time display in the HUD. I thought about adding the bells to TEHO, but figured I'd get pretty tired of it after hearing it every two minutes while I'm sailing. We should probably check for time acceleration and not sound the bells if it is in effect, and I suspect almost everyone uses time acceleration when on deck even when in battle.
Was it you who added that to PotC?

I changed it a bit so they only sound if you buy a clock and equip it.
That way, players can toggle it on/off that way.
Just an idea. :doff
 
Ideally, you would want to hear the hour-bell only when sailing real-time and in normal speed, I think -- which shouldn't be too hard to implement with the advanced time system in POTC:NH. Check for:
Code:
if (bSeaActive && !bAbordageStarted && Astronomy.TimeScale == 1.0) //we're sailing real-time (at normal speed)

But the hour-bell definitely should be something to be toggled in the game's settings, as not all players will enjoy hearing the bell every so often.
 
Last edited:
I don't think it was me, Pieter. If it was, it would have my LDH initials in that part of the code. For example, I don't remember ever putting together the sound files that cause the bells to sound, and was surprised to see that it wasn't one sound but 8 different ones.

"Astronomy".TimeScale?? That must be from PotC as I don't remember an Astronomy variable in TEHO. I did look at messing with the time scale at one time when thinking about implementing a version of time acceleration that still had normal animations.

Hook
 
I don't think it was me, Pieter. If it was, it would have my LDH initials in that part of the code. For example, I don't remember ever putting together the sound files that cause the bells to sound, and was surprised to see that it wasn't one sound but 8 different ones.
I think there was a realism reason for the 8 different ones.

"Astronomy".TimeScale?? That must be from PotC as I don't remember an Astronomy variable in TEHO. I did look at messing with the time scale at one time when thinking about implementing a version of time acceleration that still had normal animations.
Never heard about Astronomy in PotC before.
 
"Astronomy".TimeScale?? That must be from PotC as I don't remember an Astronomy variable in TEHO. I did look at messing with the time scale at one time when thinking about implementing a version of time acceleration that still had normal animations.

Nope I'm not (yet) modding POTC. It's definitely CT (and onwards?) code -- it's present both on the single-player and multiplayer side in CT. POTC had no multiplayer (to my knowledge). I'm thinking that this is the variable that SetTimeScale uses to set/store the game speed, though I haven't played around with it yet.

Another option, if that doesn't work, is to add your own variable for checking to the turbo speed setting retrieval function in "Program/interface/interface.c":

Code:
float GetSeaTimeScale()
{
   //set your variable's new value
   return 3.0;
}

Then you'll know if the player is currently sailing in turbo mode. Just set the variable back to default in the "Program/interface/interface.c" "TimeScale" toggle:

Code:
case "TimeScale":
       if(IsPerkIntoList("TimeSpeed"))
       {
           SetTimeScale(1.0);
           DelPerkFromActiveList("TimeSpeed");
           //set your variable back to default
       }
       else
       {
           SetTimeScale(GetSeaTimeScale());
           AddPerkToActiveList("TimeSpeed");
       }
   break;

Edit:

Actually, on second thought, this might be easier:

Code:
if (bSeaActive && !bAbordageStarted && !IsPerkIntoList("TimeSpeed")) //we're sailing real-time (at normal speed)
 
Last edited:
I had no problems with changing the time scale, and it worked the way I wanted, but the whole operation was too risky for my tastes. I don't want to publish a mod that might break people's games in odd ways.

I just avoid using time acceleration.

Hook
 
Back
Top