Background Music For Level

Posted By: jmasterx

Background Music For Level - 03/16/08 12:50

Hello,

I am using A7 Pro and i'm building an FPS using the shooter template, I was wondering how I can add background music (sort of like a media handle)to each level, a song that plays over and over, I dont want to "add sound" because that has a range which is no good for me (fades out randomly) I don't see a way to import a script either, not for bg music,

Thank you,
Posted By: Nidhogg

Re: Background Music For Level - 03/16/08 13:16

Wrong forum to ask this type of question.
Posted By: jmasterx

Re: Background Music For Level - 03/16/08 14:24

Hi,

where should I post it then?
could you give me a hint anyways?
Posted By: WretchedSid

Re: Background Music For Level - 03/16/08 16:08

Try this:

Put this in your script before loading the levels:
Code:
SOUND* Level01Snd = "Level1.mp3";
SOUND* Level02Snd = "Level2.mp3";



And change your Level load function to this:
Code:

//Level 1
level_load("Level01.wmb");
snd_loop(Level01Snd, 100, 0);

//Level 2
level_load("Level02.wmb");
snd_loop(Level02Snd, 100, 0);


and so on
Posted By: jmasterx

Re: Background Music For Level - 03/16/08 19:54

Hi,

it didn't work for me, I keep getting unknown keyword SOUND* and unknown parameter snd_play.....
It does however work in a new script.c file, (just a test one) is it because my script is .wdl instead of .c?

thanks
Posted By: WretchedSid

Re: Background Music For Level - 03/16/08 20:09

Yes, that code snippet was for Lite-C (.c files) and not for C-Script (.wdl files).
Posted By: jmasterx

Re: Background Music For Level - 03/16/08 20:22

ok how could I implement it as c script?
thanks
Posted By: jmasterx

Re: Background Music For Level - 03/16/08 20:50

nevermind, got it by doing this:

//Level 1
level_load(level_str);
var sTest;

sTest = snd_create("haunted1.wav");
// play the sound
snd_play(sTest,70,50);


thanks anyways
© 2024 lite-C Forums