Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
Is it possible to change the sound volume?
like:
Code: playSoundInSpace( sound, location )
{
org = spawn( "script_origin", location );
org.origin = location;
org playSound( sound );
foreach(player in level.players)
{
afstand = distance(location, player.origin);
switch(afstand)
{
case <10:
sound.volume = 100;
break;
case <30:
sound.volume = 60;
break;
case <50:
sound.volume = 25;
break;
case <70:
sound.volume = 10;
break;
case >70:
sound.volume = 0;
break;
}
}
wait 5;
org delete();
}
is this possible?
Posts: 3,704
Threads: 147
Joined: Jan 2011
Reputation:
119
it was in cod4 o.o, but it must work in mw2
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Posts: 2,157
Threads: 120
Joined: Apr 2011
Reputation:
71
(04-10-2011, 12:23)Se7en Wrote: it was in cod4 o.o, but it must work in mw2
Correction,
It's not possible to change the sound volume in MW2...
As Se7en said, It was possible in COD4 since you could edit .csv files... (Example, soundalias.csv)
That's how you could create custom sound too
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
04-11-2011, 19:08
(This post was last modified: 04-11-2011, 19:08 by iAegle.)
(04-11-2011, 18:59)Rendflex Wrote: (04-10-2011, 12:23)Se7en Wrote: it was in cod4 o.o, but it must work in mw2
Correction,
It's not possible to change the sound volume in MW2...
As Se7en said, It was possible in COD4 since you could edit .csv files... (Example, soundalias.csv)
That's how you could create custom sound too 
But on Scrapyard there is an object that makes sound.. which you can hear if you are close to it, otherwise its silent
But i cannot find mp_boneyard.gsc and the other mapfiles =.=
Posts: 2,157
Threads: 120
Joined: Apr 2011
Reputation:
71
(04-11-2011, 19:08)iAegle Wrote: (04-11-2011, 18:59)Rendflex Wrote: (04-10-2011, 12:23)Se7en Wrote: it was in cod4 o.o, but it must work in mw2
Correction,
It's not possible to change the sound volume in MW2...
As Se7en said, It was possible in COD4 since you could edit .csv files... (Example, soundalias.csv)
That's how you could create custom sound too 
But on Scrapyard there is an object that makes sound.. which you can hear if you are close to it, otherwise its silent
But i cannot find mp_boneyard.gsc and the other mapfiles =.=
Ehrm, that's in game xD
If you spawn some model, and add some sound to it
like...
modelname playlooplsound("soundalias");
You will notice that the sound volume changes based on distance... :3
Posts: 3,604
Threads: 265
Joined: Oct 2010
Reputation:
76
place an entity in the air and let it play the sound. place higher for more silence.
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
(04-13-2011, 15:58)SuperNovaAO Wrote: place an entity in the air and let it play the sound. place higher for more silence.
Not sure why its not working .. 
Well i just use:
Code: foreach(player in level.players)
{
if(distance(location, player.origin) < 500)
player playLocalSound("oldschool_return");
}
for now
|