• 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 Gunner shout sound

Mirsaneli

Privateer
Storm Modder
I need help with my GoF 1.2 tweaks. I'm trying to implement the gunner shout sound, just like in New Horizons prior to firing cannons (when you press the fire cannons key). I saw that in New Horizons there is a string called gunner_shout (and gunner_cough for smoke I guess), but I don't know how to implement that to AoP2. Can anyone point me on how to make that (I assume it's not very hard, but I have very little knowledge in coding).
 
Save the sound file (mp3) and implement it in AOP2. For the gunner to shout before firing, perhaps you could refer to the coding, which allows that to happen, and type it in into the code, should be under PROGRAMS; where ever you found the string.
 
Save the sound file (mp3) and implement it in AOP2. For the gunner to shout before firing, perhaps you could refer to the coding, which allows that to happen, and type it in into the code, should be under PROGRAMS; where ever you found the string.

The code doesn't exist. It was never a feature even in POTC. They added it in New Horizons mod.
 
This is where/how it's done in POTC:
The used sounds in the zip.

code placed in PROGRAM\SEA_AI\shipBortFire.c

Code:
 //gunner shout JRH
    if (JRH_GUNSOUNDS == 1 && IsMainCharacter(rCharacter) == true) {
        //ballNumber = 0;
        x = stf(rCharacter.ship.pos.x);
        y = stf(rCharacter.ship.pos.y);
        z = stf(rCharacter.ship.pos.z);
        cannons_qty = GetCannonArcQty(rCharacter, GetQuadFromBort(bortName));
        for (c = 0; c < cannons_qty; c++)
        {
            Play3DSound("gunner_shout", x, y, z);
        }
    }

and in PROGRAM\SEA_AI\AIBalls.c

Code:
if(JRH_GUNSOUNDS && CheckAttribute(rCannon,"sound")) // NK 05-05-03 add toggle and check.
            {
                Play3DSound(rCannon.sound, fX, fY, fZ);
                 if (isMainCharacter(aCharacter)) {
                    Play3DSound("gunner_cough", fX, fY, fZ);
                 }
            } else {
                Play3DSound("cannon_fire", fX, fY, fZ);
            }

and in RESOURCE\INI\ALIASES\sound_alias.ini

Code:
; Jack Rackham -->
[gunner_cough]
minDistance = 40.0
maxDistance = 900.0
volume = 0.75
name = OBJECTS\SHIPCHARGE\c1waitB.wav
name = OBJECTS\SHIPCHARGE\c2waitB.wav
name = OBJECTS\SHIPCHARGE\c4waitB.wav
name = OBJECTS\SHIPCHARGE\c5waitB.wav
name = OBJECTS\SHIPCHARGE\cwaitB.wav
name = OBJECTS\SHIPCHARGE\man1waitB.wav
name = OBJECTS\SHIPCHARGE\man2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke1waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke3waitB.wav

[gunner_shout]
minDistance = 40.0
maxDistance = 900.0
volume = 0.8
name = OBJECTS\SHIPCHARGE\CannonReload-002.wav
 

Attachments

  • gunners sounds.7z
    724.7 KB · Views: 154
This is where/how it's done in POTC:
The used sounds in the zip.

code placed in PROGRAM\SEA_AI\shipBortFire.c

Code:
 //gunner shout JRH
    if (JRH_GUNSOUNDS == 1 && IsMainCharacter(rCharacter) == true) {
        //ballNumber = 0;
        x = stf(rCharacter.ship.pos.x);
        y = stf(rCharacter.ship.pos.y);
        z = stf(rCharacter.ship.pos.z);
        cannons_qty = GetCannonArcQty(rCharacter, GetQuadFromBort(bortName));
        for (c = 0; c < cannons_qty; c++)
        {
            Play3DSound("gunner_shout", x, y, z);
        }
    }

and in PROGRAM\SEA_AI\AIBalls.c

Code:
if(JRH_GUNSOUNDS && CheckAttribute(rCannon,"sound")) // NK 05-05-03 add toggle and check.
            {
                Play3DSound(rCannon.sound, fX, fY, fZ);
                 if (isMainCharacter(aCharacter)) {
                    Play3DSound("gunner_cough", fX, fY, fZ);
                 }
            } else {
                Play3DSound("cannon_fire", fX, fY, fZ);
            }

and in RESOURCE\INI\ALIASES\sound_alias.ini

Code:
; Jack Rackham -->
[gunner_cough]
minDistance = 40.0
maxDistance = 900.0
volume = 0.75
name = OBJECTS\SHIPCHARGE\c1waitB.wav
name = OBJECTS\SHIPCHARGE\c2waitB.wav
name = OBJECTS\SHIPCHARGE\c4waitB.wav
name = OBJECTS\SHIPCHARGE\c5waitB.wav
name = OBJECTS\SHIPCHARGE\cwaitB.wav
name = OBJECTS\SHIPCHARGE\man1waitB.wav
name = OBJECTS\SHIPCHARGE\man2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke1waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke3waitB.wav

[gunner_shout]
minDistance = 40.0
maxDistance = 900.0
volume = 0.8
name = OBJECTS\SHIPCHARGE\CannonReload-002.wav

If I put these codes into AoP2, will it work?
 
Makes sense.
If you find the code for the cannon fire sound, you could add it to the sounds played.
I haven't tried tampering with this but it seems doable.

After all it was added in PotC. ;)
 
This is where/how it's done in POTC:
The used sounds in the zip.

code placed in PROGRAM\SEA_AI\shipBortFire.c

Code:
 //gunner shout JRH
    if (JRH_GUNSOUNDS == 1 && IsMainCharacter(rCharacter) == true) {
        //ballNumber = 0;
        x = stf(rCharacter.ship.pos.x);
        y = stf(rCharacter.ship.pos.y);
        z = stf(rCharacter.ship.pos.z);
        cannons_qty = GetCannonArcQty(rCharacter, GetQuadFromBort(bortName));
        for (c = 0; c < cannons_qty; c++)
        {
            Play3DSound("gunner_shout", x, y, z);
        }
    }

and in PROGRAM\SEA_AI\AIBalls.c

Code:
if(JRH_GUNSOUNDS && CheckAttribute(rCannon,"sound")) // NK 05-05-03 add toggle and check.
            {
                Play3DSound(rCannon.sound, fX, fY, fZ);
                 if (isMainCharacter(aCharacter)) {
                    Play3DSound("gunner_cough", fX, fY, fZ);
                 }
            } else {
                Play3DSound("cannon_fire", fX, fY, fZ);
            }

and in RESOURCE\INI\ALIASES\sound_alias.ini

Code:
; Jack Rackham -->
[gunner_cough]
minDistance = 40.0
maxDistance = 900.0
volume = 0.75
name = OBJECTS\SHIPCHARGE\c1waitB.wav
name = OBJECTS\SHIPCHARGE\c2waitB.wav
name = OBJECTS\SHIPCHARGE\c4waitB.wav
name = OBJECTS\SHIPCHARGE\c5waitB.wav
name = OBJECTS\SHIPCHARGE\cwaitB.wav
name = OBJECTS\SHIPCHARGE\man1waitB.wav
name = OBJECTS\SHIPCHARGE\man2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke1waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke2waitB.wav
name = OBJECTS\SHIPCHARGE\Smoke3waitB.wav

[gunner_shout]
minDistance = 40.0
maxDistance = 900.0
volume = 0.8
name = OBJECTS\SHIPCHARGE\CannonReload-002.wav

I tried applying all these lines as both games have same files with same names, but this is what I get...

OTmhFXP.png
 
If you paste these lines in to the files it won't work.
"JRH_GUNSOUNDS" for example is New Horizons specific.

You can get an idea for how it works, and maybe use parts of the NH code.
But you can't use exactly this.

Unfortunately I don't have CoAS installed, so the help I can give is limited.
 
I appreciate your effort to help. I know for sure that 2.8 engine is not limited in any way, because Jeffrey has added new animals in the Eras mod for COAS. I will have to find a way to make it work, because I'm finishing my improved version of the GoF 1.2 Mod. I chose GoF 1.2 over other mods because I find it very stable and I think it has sufficient items and ships. Also I like that masts fall occasionally, it even happened to me that a pirate ship blew of my ship's mast.
 
Have a look at other instances where sounds are played in CoAS.
How are those coded?

You could add a "Log_SetStringToLog" there for now; just to see if it's indeed triggered; and at the right moment.
 
Have a look at other instances where sounds are played in CoAS.
How are those coded?

You could add a "Log_SetStringToLog" there for now; just to see if it's indeed triggered; and at the right moment.

Can you tell me where they are located in Programs folder? Or you mean the sound aliases file?
 
Back
Top