Jump to content
Sign in to follow this  
sic-disaster

Making a dead soldier play a sound in 3d

Recommended Posts

Is it possible?

Basically what I wanted to do was play a sound whenever a soldier dies. So for example, imagine being next to a teammate that gets shot dead, but now I want him to gurgle or scream or something along those lines. Would that be possible?

So far the only workable solution I have found would be broadcasting the sound via HQ on a main channel, with regular playSound command. But I would really like it to be in 3d.

Obviously s1 say3D "Death1" doesn't work because in order for s1 to say anything he needs to be alive.

Also, I tested the functionality with making s2 play the sound when s1 dies, but while it is kind of in 3d the sound still transmits over a very, very long distance. Is there any way to play with the distance the 3d sound travels?

Share this post


Link to post
Share on other sites

Maybe create an object and have the object say the sound, something like this

this addEventHandler ["Killed",{_this execVM "deathScript.sqf"}];

//deathScript.sqf
_unit = _this select 0;

_obj= "HeliHEmpty" createVehicleLocal [0,0,0]; 
_obj attachTo [_unit,[0,0,1.5]];
_obj say3D "sound1";
sleep 10;
deleteVehicle _obj;

The distance a sound travels can be done by editing the "volume" parameter in your cfgSounds.

Share this post


Link to post
Share on other sites

Thanks, I got the sound working!

Only thing I don't get yet is what I should enter in the cfgSounds for the volume, I tried several things but none of them really worked, so now it is back to the way it used to be by default. What I have is this:

class death1

{

name = "death1";

sound[] = {\sound\death1.ogg, db + 0, 1.0};

titles[] = {0, ""};

};

What should I change to make it play the sound to a distance of say, 5 meters?

Share this post


Link to post
Share on other sites

Try

class death1
{
name = "death1"; 
sound[] = {\sound\death1.ogg, db-30, 1.0};
titles[] = {0, ""};
};

Share this post


Link to post
Share on other sites

That did the trick! Awesome. Now I'm going to update some of my missions to incorporate various death screams and gurgles.

I got some from Red Orchestra 2 here, some of them are truely horrific: https://www.youtube.com/watch?v=57mICfWeAVg hopefully it will instill a sense of death and reality to the missions. I'm using @2:03 and @3:24 in the video as well as some other parts, along with some of my own recordings (who aren't nearly as good as those in the video but then again I'm not a professional voice actor). The idea is to use them for players in co-op missions as well as opfor, I want to try and humanise everybody, though ofcourse not all opfor will have a scream.

I'll give you some credit in the briefings as well, I wouldn't have got it working otherwise.

---------- Post added at 18:44 ---------- Previous post was at 17:36 ----------

Little preview video:

The first death sound is me. The second and third are the same sound, and it comes from Red Orchestra 2: Heroes of Stalingrad.

Share this post


Link to post
Share on other sites

It's a nice effect, however the script I posted won't work in MP since the event handler and say command is local. You should change it into a MPEventHandler or use PVEH or CBA if you want synchronized sounds (so they're not random for everyone).

Share this post


Link to post
Share on other sites

That's good to know lol. I don't have a good mind for this type of thing to be honest, all the stuff I use is pretty much copy&paste. I don't have a clue about CBA but I figure MPEventHandler works just as well? If so, what would that look like? Simply like this?

this addMPEventHandler ["Killed",{_this execVM "deathScript.sqf"}];

And would the say command need to be different as well, or will say3d work once the event handler is MP?

Share this post


Link to post
Share on other sites

So basically this would do it?

this addMPEventHandler ["MPKilled",{_this execVM "deathScript.sqf"}];

Share this post


Link to post
Share on other sites

That's correct. I've no clue if what your actually trying to do will work or not. But you use MP tag ie; MPKilled when you add an MP EH ie; addMPEventHandler . Also, only certain MP Eh are available.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×