Scripts / sound in zones

Author
Message
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 23rd Jun 2014 06:41
So, I have an irregular shaped area that I want to have music in. Ive used a zone to do this since I can shape it but when i set my script to play the sound at entry and stop at exit, it works BUT, here is the kicker, the music is garbled. . . . really badly garbled. It actually sounds more like electrical noise.
Id like to figure out how to have it fade in and out as you enter or leave. This is way over my head but I must say, Im learning little by little.

Here is the script:


If you can improve or fix this for me, Please note yourself at the top so i know who helped me.

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
Auger
13
Years of Service
User Offline
Joined: 21st Aug 2011
Location: Out There
Posted: 23rd Jun 2014 07:14 Edited at: 23rd Jun 2014 07:29
Haven't tested this but it should work



You were calling PlaySound() repeatedly which is why it was garbled



[edit]



Just reread your post if your playing music and want it to loop

use LoopSound(e,v) instead of PlaySound(e,v) or it'll only play once and stop.



Auger



smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Jun 2014 10:55 Edited at: 23rd Jun 2014 11:55
edit: improved my soundzone script, should be better for what you are after

http://fpscrforum.thegamecreators.com/?m=forum_view&t=207801&b=2&msg=2491862#m2491862

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Imchasinyou
10
Years of Service
User Offline
Joined: 22nd Mar 2014
Location: OH
Posted: 23rd Jun 2014 23:58
Okj, Ill try both but Small, does your script allow for the music to simply fade away as the player leaves the area? Is that possible?

[img]http://files.enjin.com/191696/UA Members Banners/Imchasinyou.jpg[/img]
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Jun 2014 00:09
sound fades by default it's just that normally zones dont work like that, with mine they will and as there's no volume control inside my script it shouldnt mess up any other sounds
but there's a video example in the link which shows it better

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-12-22 05:40:18
Your offset time is: 2024-12-22 05:40:18