Page 1 of 2
wind in the trees
Posted: Wed Nov 12, 2003 8:00 am
by wacko
i try to get wind sounds where i have trees, but i still have 2 problems:
1st it seems to change direction when the player changes his heading (sound is coming from left/middle/right).
I used
local as the channel to be used, but it didn't work
Code: Select all
local.master aliascache wind_trees sound/amb/Amb_WindTrees3.wav soundparms 0.1 0.0 1.0 0.0 3000 6000 local loaded maps "dm "
is there anything wrong?
2nd, i found two ways i could handle the speaker: with always_draw checked, which will let it play regardless whether i can 'see' it or with always_draw unchecked which turns it off when I can't 'see' the speaker.
with all my vis_leafgroups i now can hear the sound in some places in the building and can not hear it in other places outside where i ought to. Obviously not the effect i aspired...
now, will i have to fill the whole outside area with a trigger to activate the wind sound?
sound
Posted: Wed Nov 12, 2003 9:36 am
by tltrude
A vis_leafgroup brush makes everything inside it vanish--when you are in the the one that targets it. Even a speaker entity will vanish and stop looping its sound.
It is better to use "auto" as the channel. If you uses "local" it has to be in quotes. Don't forget to put...
local.master = spawn ScriptMaster
above your "local.master aliascache" sound lines.
And, you can change how far the sound travels by changing the min/max numbers (3000 6000). The first number is the radius in which the sound will be full volume (3000 from the speaker in all directions). Between 3000 and 6000 the sound will fade. And, at 6000 the sound will cut off.
The easiest way to make a speaker is to make a 16X16 script_object with nodraw texture, and not solid set. Give it a targetname like "tree_speaker1". Then in the script add a thread like this:
------------------------------------
level waittill prespawn
thread start_sound
level waittill spawn
end
start_sound:
wait 1
$tree_speaker1 loopsound wind_trees
end
------------------------------------
I think "wind_trees" is already being used by ubersound, so it may be better to pick a another name for your sound alias.
Hope that helps!
Posted: Wed Nov 12, 2003 5:28 pm
by jv_map
Yup like tltrude said it should be "local":
local.master aliascache wind_trees sound/amb/Amb_WindTrees3.wav soundparms 0.1 0.0 1.0 0.0 3000 6000 "local" loaded maps "dm "
Otherwise 'local' is read as referring to the current ScriptThread object (like local.player) instead of as a string.
Posted: Wed Nov 12, 2003 8:08 pm
by wacko
mmm
in the ubersound.scr, 'local' is used without quotes, like all other channels. But I'll give it a try.
This might solve my 1st problem, my 2nd is still remaining: How could I set my speakers so they're heard just by players that are outside the building?
thanks so far!!
Reading failure
Posted: Wed Nov 12, 2003 9:13 pm
by tltrude
Read my post again, it tells about how to set the range of the sound. it also talks about how the sound can be switch off with a leaf group. So, you could make a tiny leafgroup around the speaker and target it with ones inside the building (only needs to be as big as the sound's max range).
Posted: Wed Nov 12, 2003 9:16 pm
by wacko
Had a idea: if a vis_leafgroup can make a speaker stop playing, then:
i set around each wind speaker a small vis leafgroup brush with targetname wind_box_1 (and _2)
and fill up the building with vis_leafgroup brushes with target wind_box_1 wind_box_2.
This ought to stop playing the sound when players are in the building? Right?
lol: was just writing this post while u did yours!
oh, and "local" (in quotes) worked! weird...
thanks!!!

YES
Posted: Wed Nov 12, 2003 9:21 pm
by tltrude
YES, YES, YES!
But, You don't have to fill the whole building. Just make the range of the sound smaller.
change: 3000 6000
to: 800 1024 or something like that.
Re: YES
Posted: Wed Nov 12, 2003 9:26 pm
by wacko
tltrude wrote:YES, YES, YES!
tltrude wrote:But, You don't have to fill the whole building. Just make the range of the sound smaller.
does this have a special advantage? I think in my case, it'll be easier to completely fill the building and give the speakers rather a min/max of 6000 6000 (big enough to cover the whole map and having no fading
Well, ok
Posted: Wed Nov 12, 2003 9:31 pm
by tltrude
You can go that route if you wish, but to many vis_leafgroups will case vis data to overload (max vis is 2Mb).
Posted: Wed Nov 12, 2003 9:40 pm
by wacko
okay, that's fine! visdatasize is 86224...
thanks for helping!
on the other hand, wasn't it u who said i should add some ambient sound to decalattack?!

(just kidding)
Tutorial
Posted: Wed Nov 12, 2003 10:36 pm
by tltrude
Using leafgroups to turn off sounds indoors is a pretty neat trick. I'm glad "WE" thought of it. Maybe "WE" should make a tutorial for it!
Posted: Wed Nov 12, 2003 10:58 pm
by wacko
Good idea! But I think it'd be better if we made it instead of me, because our English and scripting/mapping knowledge is much better than mine.
If we want me to help us, let me know! Or should I try to write the tut and we turn it into something useful afterwards?

Tutorial
Posted: Thu Nov 13, 2003 1:11 am
by tltrude
I'll make a quick map and you can write the "step-by-step" readme file. For the targetnames, I will use vis1, vis2 etc...
Posted: Thu Nov 13, 2003 2:23 am
by Krane
Sounds awesome guys! The idea is fantastic!!

Interesting!!!
Posted: Thu Nov 13, 2003 9:02 am
by tltrude
I tried using two mp3 files as the sound alias' and found that only the first one would work--using the normal "local.master" lines. But, with this alteration, both of them work!!!
-----------------------------------------
local.master = spawn ScriptMaster
local.master aliascache outside_snd sound/amb_stereo/Amb_M4_CountryExt_02.mp3 soundparms 1.0 0.0 1.0 0.0 5000 5000 "local" loaded maps "dm moh obj train"
local.master2 = spawn ScriptMaster
local.master2 aliascache inside_snd sound/amb_stereo/Amb_M4_CountryInt_02.mp3 soundparms 1.0 0.0 1.0 0.0 256 300 "local" loaded maps "dm moh obj train"
-----------------------------------------