Adding a FadeIn/Out Sound

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Adding a FadeIn/Out Sound

Postby Race » Thu Nov 06, 2008 6:55 pm

On to my next problem, I have an ambience sound file for my age that plays and works fine, but I want to add a different sound in another area and I just cant figure out how to set up the alcscript for it. I selected the sound emitter and loaded the sound I want to use then did the alcscript. Can someone take a look at what I have and tell me how to edit it to get it to at least play in my age. Thanks!

Code: Select all
emitter_crevass:
    type: soundemit
    sound:
    fadein:
         length: 1.00
         start: 0.0
         end: 1.0
         type: linear
         stop: true
Race
 
Posts: 51
Joined: Tue May 20, 2008 9:32 am

Re: Adding a FadeIn/Out Sound

Postby andylegate » Thu Nov 06, 2008 7:24 pm

A good way to fade a sound out and fade it back in for just a certain area, is with the use of softvolumes. That way you can neatly define the area visually on your 3D window of your Age.

Let's say you have a ambient sound of wind, and you want that wind to fade out as the avatar enters a cave let's say. You can put a softvolume region around the cave and have the sound of the wind fade out as the avatar enters the cave. Also, when the Avatar leaves the cave and comes back out side, the wind will fade back in!

Here would be one way to do it:

Create a softvolume region that includes all the areas that you want the wind heard, but make sure the cave is NOT inside the cubic Softvolume.

Now use the scripting like this:

[code]

Windemitter1:
type: soundemit
sound:
flags:
- autostart
- looping
file: MyWindFile
volume: 0.5
type: ambient
softvolume: WindSoftVolumeReg
[/code}

Where Windemitter1 is the sound emitter, MyWindFile is the name of the sound file, and WindSoftVoumeReg is the name of the Softvolume region you put it.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Adding a FadeIn/Out Sound

Postby Race » Thu Nov 06, 2008 7:49 pm

Thanks for the help, but I will have to read up on softvolumes, I tried doing a simple sound region and it didnt work, again I wasnt sure how to script it properly, and the plugin was sending back an error because it wanted the volume to have a material.
Race
 
Posts: 51
Joined: Tue May 20, 2008 9:32 am

Re: Adding a FadeIn/Out Sound

Postby andylegate » Thu Nov 06, 2008 8:31 pm

That sounds like the sound region is not being made right.

There are two ways you an do it:

1) Go to the scripts menu and make a PyPRP Generic Logic Region.
2) Scale it, edit it to the area you want to cover. Make sure you hit Cntl-A after you do so to apply the scaling and any rotation.
3) Go to the Logic Menu (purple smiley face). The first logic string should already be there and say Type and Region.
Add another logic string that says "Regiontype" for the name, and soundregion.
Add a third string that says: "soundemitter" for the name and put in the name of your soundemitter you put in.

OR

Do the first 2 steps above, but instead of step 3, go to your ALCscript and put this in:

Code: Select all
YourRegionName:
    region:
        type: soundregion
        soundemitter: NameOfYourSoundEmitter


Then for the ALCscript for the sound emitter, do like I showed in the post above, except leave the softvolume part out, AND leave out - autostart (autostart will make the sound start playing the moment you link in. By leaving it out, you have to cross into the region to make it start instead:

Code: Select all
Windemitter1:
    type: soundemit
    sound:
        flags:
          - looping
        file: MyWindFile
        volume: 0.5
        type: ambient


NOTE: This will NOT work if you link in to the region...I know, I tried that way way way way way back when I first made Zephyr Cove. No mater how hard we tried, we could not make the sound toggle on if you linked into the sound region. You have to cross one of the regions boundry's

I still say your best bet is to use Softvolumes. They are not that had to use, however, the one article we have in the Wiki is more about theory of them than actual instructions with examples, so good luck.

Also, here is a link to my tutorial on triggering sounds over at the GoMa Froum:

Triggered Sounds
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am


Return to Building

Who is online

Users browsing this forum: No registered users and 9 guests

cron