Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover

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
Prev Previous Post   Next Post Next
  #25  
Old 08-23-2012, 09:22 PM
von Pilsner von Pilsner is offline
Approved Member
 
Join Date: Apr 2011
Posts: 377
Talking

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) { }
    }
Use it with a decent random function and you can have lots of different screams...
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);
This will play the sound scream01.wav one time.

Last edited by von Pilsner; 08-23-2012 at 09:51 PM.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.