HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Continuing a 3D Sound Out of Range

10-08-2004, 07:35 PM#1
Guest
Hello there, I was wondering if anyone could help me with an issue I've been having with a sound trigger I'm working on.

I was wondering if it is at all possible to continue a 3D sound after you leave its cutoff range and reenter it instead of the sound starting over from the beginning.
I am creating a trigger that uses TFT music as a 3D sound and applying it to a unit. The idea is that players only hear the music (which is really classified as a sound) when they are within a given range of that unit, in addition to having a nice fade in and fade out rate. Now that all works fine so far. My problem is when I leave the sound's range and it fades out completely, when I come back within range the sound plays from the beginning. I want it to continue playing even when I am out of range. I have a feeling it is not possible but I thought I would ask and hope anyways. Thanks.


Also, this is my first time to this site and posting here so I just thought I'd say this is an incredible site and an even more incredible wealth of information. Thanks to those keeping this place going. While my knowledge is limited to only the basics of world editing and what tangents JASS has with C++, I will do what I can to return the favor with my help.
10-09-2004, 07:53 PM#2
Guest
Mmmm, don't listen to me too much right now, but maybe you could make a region around the unit where music is positioned; set the cutoff distance to more than the region; now, when the player unit leaves the region, set sound volume to 0.01% and change cutoff distance to A LOT so sound doesn't stop, and it will be virtually non-audible. That's all I can't think of right now. Hope it helps.

Salutions®
10-10-2004, 07:25 AM#3
Guest
Quote:
Originally Posted by Mara.Jade
Mmmm, don't listen to me too much right now, but maybe you could make a region around the unit where music is positioned; set the cutoff distance to more than the region; now, when the player unit leaves the region, set sound volume to 0.01% and change cutoff distance to A LOT so sound doesn't stop, and it will be virtually non-audible. That's all I can't think of right now. Hope it helps.

Salutions®

Actually that was a great idea, Mara! I even took it one step further and added a trigger that periodically changes the volume using an equation based on the distance between the triggering unit and the center of the regoin, so it will actually have the effect of fading in and out as opposed to jumping right to 0.01 percent volume and back up again. Now I just need to deal with the impossible task of making it work for multiple players and multiple units coming in and out of the region. If player 1 moves into the region right after player 2 moves out of it, then the cutoff range will contract again, putting player 2 outside of it thus causing the sound to restart to him. Eh, I'm tired right now. I'll tweak it some more and post a few pics of the trigger later.

Thanks for pointin me in the right direction
10-10-2004, 09:05 AM#4
Guest
Quote:
Originally Posted by Krug
Actually that was a great idea, Mara! I even took it one step further and added a trigger that periodically changes the volume using an equation based on the distance between the triggering unit and the center of the regoin, so it will actually have the effect of fading in and out as opposed to jumping right to 0.01 percent volume and back up again. Now I just need to deal with the impossible task of making it work for multiple players and multiple units coming in and out of the region. If player 1 moves into the region right after player 2 moves out of it, then the cutoff range will contract again, putting player 2 outside of it thus causing the sound to restart to him. Eh, I'm tired right now. I'll tweak it some more and post a few pics of the trigger later.

Thanks for pointin me in the right direction

LOL, yeah, multiple players, i forgot :\ . If the units where music is positioned are always at the same point/place, you can just make a small region at the unit and attach the music to that region. But I don't know of that will auto-fade music when walking far...

Salutions®
10-10-2004, 07:57 PM#5
Guest
Quote:
Originally Posted by Mara.Jade
LOL, yeah, multiple players, i forgot :\ . If the units where music is positioned are always at the same point/place, you can just make a small region at the unit and attach the music to that region. But I don't know of that will auto-fade music when walking far...

Salutions®

Aye the unit would be moving around...a lot. I'm starting to thing it might not be so bad for the sound/music to start over, lol. :\

On a side note, what is the difference between max distance and cutoff distance on a 3D sound? It seems like they are just the same thing as far as I've manitpulated them.
10-10-2004, 10:15 PM#6
Guest
I've tweaked it around a bit. I've took out the sound region and made it so it constantly adjusts the volume based on the distance between the current center of camera view and the unit the sound is attached to. My hope is that the volume is adjusted for each individual players' current camera point of view. The cutoff range of the sound is always near infinite now.

I've just tested the trigger and for what I can tell it works for me. Now will it for everyone else?

Here's some pics of the trigger:
10-11-2004, 10:24 AM#7
Guest
Quote:
Originally Posted by Krug
I've just tested the trigger and for what I can tell it works for me. Now will it for everyone else?

No it won't. Sounds and musics are played for everyone.


Quote:
Originally Posted by Krug
Aye the unit would be moving around...a lot. I'm starting to thing it might not be so bad for the sound/music to start over, lol. :\

On a side note, what is the difference between max distance and cutoff distance on a 3D sound? It seems like they are just the same thing as far as I've manitpulated them.

Max distance is the distance where the 3D sound level is 0. Cutoff distance is the distance where the 3D sound is stopped. This means, if you have a max dist of 1000 and a cutoff dist of 500, the sound will stop when its at 50% volume.

Hey, actually it is NOT that bad for music to start over!

Salutions®