Jump to content
  • 0

Need help with sound


P0k3r_OF_Sm0t

Question

So I'm trying to add a sound that plays at the end of Sewaduk's bury corpse script. I have it working but it is very random.  Sometimes the sound will play as soon as I click bury, other times it will play 2 minutes after the body has been buried and you're 300M away, other times it will play right when I want it to which is when you stand up and salute. I have clark17's adapted version of mamu1234's drink water script and that script plays the drink sound everytime at the right time. I did some testing which involved swapping the sound call for each script and the drink water script played my custom sound everytime right on the money but the bury script played drink sounds totally random so I know it has nothing to do with the sound file itself. I will tell you right now that I know very little about scripting, most of what i have done in the past is cut here, paste there until it works so please don't reply with something like: "Oh you just need an "if I had a clue" statement after the 22nd variable on the 4th dimension" or something like that because I'll be just as stuck as I am now. :P Please just show me what I need to add and where.  If someone could help me get this working I'd greatly appreciate it and you'd be forever my hero. :wub:  LOL

This is what done so far:

 

I used this line: _nul = [objNull, player, rSAY, "bury"] call RE;

 

and put it here:

 

        _deathMessage = format["Rest in Peace, %1...",_name];
        cutText [_deathMessage, "PLAIN DOWN"];
        [player,25] call player_humanityChange;
        _id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
        _nul = [objNull, player, rSAY, "bury"] call RE;
        player playMove "AmovPercMstpSlowWrflDnon_Salute";
        
    } else {
        cutText ["The poor bastards been eaten, there's not much left to bury", "PLAIN DOWN"];
                
    };
};

 

This is my class cfgsounds from description.ext:

 

class CfgSounds
{
    sounds[] = {siren,drink_water,bury};
    
    class siren {
        name = "siren";
        sound[] = {custom\sirens\siren.ogg,0.5,1};
        titles[] = {};
    };
    class drink_water {
        name="drink_water";
        sound[]={custom\drink\drink_water.ogg,1,1};
        titles[] = {};
   };
       class bury {
        name="bury";
        sound[]={fixes\bury.ogg,1,1};
        titles[] = {};
   };

};

 

Again, it works but at totally random times.

Also, I got my sound file down to 22kb which is less than 1/4 the size of the drink_water sound file so I'm pretty sure it's not that it's just taking awhile for the sound to load or the drink sound would be even more delayed.

Thanks

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

rSay is to broadcast the sound over network, so other players also can hear it.

so if that is not important for you you could try to simply use:

playSound "bury";

only the player who executed this script will here that, but maybe its enough.

 

 

for the rSay command like you already have it:

 

first of all you dont need to define _nul

[objNull, player, rSAY, "bury"] call RE;

this should be enough

 

next thing would be

 

try it this way:

[nil,player,rSAY,["bury", 10]] call RE;
Link to comment
Share on other sites

  • 0

 

rSay is to broadcast the sound over network, so other players also can hear it.

so if that is not important for you you could try to simply use:

playSound "bury";

only the player who executed this script will here that, but maybe its enough.

 

 

for the rSay command like you already have it:

 

first of all you dont need to define _nul

[objNull, player, rSAY, "bury"] call RE;

this should be enough

 

next thing would be

 

try it this way:

[nil,player,rSAY,["bury", 10]] call RE;

Thanks I'll give it a shot. I just copied the line for the sound from the drink water script so I'm assuming that means that is broadcast server wide as well? Don't need nor want that so I'll see what happens and if it works,  I'll have to edit the drink script as well to keep it local.

Thanks SchwEde, I'll let you know if works.

 

Update. Works great with the playSound "bury" every time right when I want it to. Thanks a lot!! My hero lol!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...