![]() |
|
|||||||
| IL-2 Sturmovik: Cliffs of Dover Latest instalment in the acclaimed IL-2 Sturmovik series from award-winning developer Maddox Games. |
|
|
Thread Tools | Display Modes |
|
#25
|
|||
|
|||
|
A few minutes work, here is a sound player in .cs form. You can call it from within the mission script quite easily.
The wav files go here: Steam\steamapps\common\il-2 sturmovik cliffs of dover\parts\Sounds If you use the loop be sure and kill the sound when the pilot dies or the mission ends. Code:
public void playSound(string sound, int trigger)
{
try
{
SoundPlayer singleSound = new SoundPlayer("parts\\Sounds\\" + sound + ".wav");
if ((trigger < 0) || (trigger > 2))
{
trigger = 2;
}
if (trigger == 0) // To play a sound
{
singleSound.Play();
}
if (trigger == 1) // To loop a sound
{
singleSound.PlayLooping();
}
if (trigger == 2) // to stop looping
{
singleSound.Stop();
}
}
catch (Exception e) { }
}
and / or Check the amount of damage done to pick more intense screams (or sobs). EDIT: call the function like this: Code:
playSound("scream01", 0);
Last edited by von Pilsner; 08-23-2012 at 08:51 PM. |
|
|