Soundscapes Part 2 - Play Looping

Tutorial collection, comprehensive listings on main site.

Soundscapes Part 2 - Play Looping

Postby Tutorial on Wed Mar 30, 2005 9:38 pm

category
General Half-Life 2/Sound

description
Takes you through the Play Looping function.

keywords
sounds, sound, ambient, soundscape, soundscapes, env_soundscape, scape.

Play Looping

The first thing you need to do is create the file where all your soundscape information will be stored.

Go to your equivalent of this directory C:\Program Files\Valve\Steam\SteamApps\your_account\half-life 2 deathmatch\hl2mp

Once there you want to create a new folder called “scripts”

Image

Now open notepad and save a blank .txt document in your newly created scripts folder called “soundscapes”.

Image

You have now created the file were all the information about your custom soundscapes will be stored.

Okay now its time to build your first soundscape.

We are going to create a “playlooping” soundscape. This soundscape loops a sound file until a new soundscape is triggered.

First we need to name the soundscape for the tutorial. Open up the soundscapes.txt document we created earlier in the scripts folder. To name you soundscape put “yoursoundscapesnamerhere” in your text file, don’t forget the brackets. Your soundscapes.txt document should look something like this now:

Code: Select all
"soundscapes.playlooping"
{


Next we define what DSP effects we want the soundscape to have. If you set the DSP value to one the engine will automatically decipher the best effect. But you can choose your own DSP effect.

Here’s the list of avalible DSP effects:

0 : "Normal (off)"
1 : "Generic"
2 : "Metal Small"
3 : "Metal Medium"
4 : "Metal Large"
5 : "Tunnel Small"
6 : "Tunnel Medium"
7 : "Tunnel Large"
8 : "Chamber Small"
9 : "Chamber Medium"
10: "Chamber Large"
11: "Bright Small"
12: "Bright Medium"
13: "Bright Large"
14: "Water 1"
15: "Water 2"
16: "Water 3"
17: "Concrete Small"
18: "Concrete Medium"
19: "Concrete Large"
20: "Big 1"
21: "Big 2"
22: "Big 3"
23: "Cavern Small"
24: "Cavern Medium"
25: "Cavern Large"
26: "Weirdo 1"
27: "Weirdo 2"
28: "Weirdo 3"


It’s best just to use 1 but its your call. Your soundscapes.txt document should look like this now:

Code: Select all
 "soundscapes.playlooping"
{
         "dsp"   "1"


Now its time to define what soundscape we want to make put in
"playlooping" underneath “dsp”. Your soundscapes.txt document should now look like this:

Code: Select all
 "soundscapes.playlooping"
{
         "dsp"   "1"
         "playlooping"


Okay so now we have named our osundscape, given it its dsp effect and chosen which type of soundscape we want to use its now time to give our soundscape properties.

Here’s a list of keys we can use and their definitions:

Wave - The name of the wave file.

Volume - Sets the wave's volume (0-1).

Pitch - Sets the pitch for the wave (100 is normal).

Attenuation - Sets the attenuation of the wave (only used if a "position" command follows).

NOTE: These can be random intervals - the random value will be chosen once each time the soundscape is triggered.

Position - References a position by index (0-7) that the level designer has pointed to in the env_soundscape entity.


Taken from http://www.valve-erc.com/srcsdk/Sound/soundscapes.html

Definition of Attenuation is “The reduction in intensity of a sound signal.”

I will talk further about Position later on.

Okay it’s easier to show you how soundscapes properties look like than talk you through it. For the soundscape in the tutorial its properties look like this:

Code: Select all
 "soundscapes.playlooping"
{
         "dsp"   "1"
         "playlooping"
         {
                "volume"       "0.5"
                "pitch"        "100"
                "wave"         "ambient/atmosphere/city_beacon_loop1.wav"
         }
    }


You have now created a soundscape that will loop continulasly when triggered. You can add in more layers of sound simple by adding in another “playlooping” as shown in the example below:

Code: Select all
"soundscapes.playlooping"
{
         "dsp"   "1"
         "playlooping"
         {
                "volume"       "0.5"
                "pitch"        "100"
                "wave"         "ambient/atmosphere/city_beacon_loop1.wav"
         }

         "playlooping"
         {
                "volume"       "0.5"
                "pitch"        "100"
                "wave"         "ambient/alarms/apc_alarm_loop1.wav"
         }
}


Okay so now we have created our soundscape its time to get it working in game. Place an “env_soundscape” entity in your map.

Select the entity, and then bring up the “Object Properties” window:

Image

The two keys we are going to focus on are “radius” and “soundscape.”

The radius triggers the soundscape to start playing. You can type in the units you want the radius to cover, or use the red circle and four white squares to define the triggerable area. If you set the radius to -1 then the soundscape will be triggered just by looking a it.

In the key “soundscape” you need to define the name of the soundscape you want to use. Earlier I created a soundscape called "soundscapes.playlooping" in the txt document, so im going to use that one. To do this you simply put soundscapes.playlooping in the space provided:


Image

There you have it compile and run your map and your sorted. Welcome to the world of soundscapes.

*NOTE* The easiest way to get the sound file names is to create an ambient generic, open up its object properties box click on the soundname key then browse. You can get all the paths of the sounds there and preview them.

Part two is coming soon and will cover “playrandom” soundscapes.

Happy mapping y’all

Signy
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby YokaI on Thu Mar 31, 2005 12:54 am

I didnt find it too hard actualy!

thank you!

cant wait till i put this in cs_boa_gold :twisted:
YokaI
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 03, 2004 12:38 am

Re: Soundscapes Part 2 - Play Looping

Postby Token on Mon Aug 15, 2005 4:21 pm

*NOTE* The easiest way to get the sound file names is to create an ambient generic, open up its object properties box click on the soundname key then browse. You can get all the paths of the sounds there and preview them.


wouldent that be the same as opening up the sound browser? (ctrl+shift+s)
[img]
Token
Member
Member
 
Joined: Mon Jul 25, 2005 5:58 pm
Location: Belle River, Ontario

Postby Hellraz0r on Mon Jan 30, 2006 12:09 am

how come nothings fucking playing, I did what you said and I can't hear any bloody alarms. (I put alarms in)
Hellraz0r
Pheropod
Pheropod
 
Joined: Sun Oct 23, 2005 10:42 pm

Postby slayera on Mon Jan 30, 2006 10:19 am

Hellraz0r wrote:how come nothings fucking playing, I did what you said and I can't hear any bloody alarms. (I put alarms in)


post your sound scape here.
Image


"When one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion." -Robert Pirsig
User avatar
slayera
Veteran
Veteran
 
Joined: Wed Dec 08, 2004 3:15 am
Location: Near the world's only super volcano.

Postby Hellraz0r on Tue Jan 31, 2006 3:32 am

"tspawn"
{
"dsp" "1"
"playlooping"
{
"volume" "0.5"
"pitch" "100"
"wave" "ambient/alarms/alarm_citizen_loop1.wav"
}

"playlooping"
{
"volume" "0.5"
"pitch" "100"
"wave" "ambient/alarms/siren.wav"
}
}
Hellraz0r
Pheropod
Pheropod
 
Joined: Sun Oct 23, 2005 10:42 pm

the stupid "playlooping" thingo

Postby carbon_adam on Tue Mar 07, 2006 11:10 am

yeah well some of you might have the problem I've been having with the playlooping thing.. Basically with my mod I have found that with custom sounds there is no actuall relationship with the parameter of "VOLUME".
HERE IS MY CUSTOM SCRIPT
"and_again"
{
"dsp" "1"
"playlooping"
{
"volume" ".25"// does not change volume
"wave" "adam_sound/breath_loop1.wav"
"pitch" "100"
"attenuation" "0"
}
}


But what happens to me is that the sound only plays once. If however i change the volume parameter to "3" then the sound plays 3 times and if i change it to 10 it plays 10 times.

Dont try and tell me my script is wrong..I know that it works because I first tested it with valve sounds..And its straght outa one of the valve script files anyway..Its only when I use my own custom sounds...And I have tried at least 10 differnt versions of bitrate and .wav file types

So yet again valve stuff me around
carbon_adam
Just Joined
Just Joined
 
Joined: Fri Jan 20, 2006 11:55 am

Postby JakeParlay on Wed Mar 08, 2006 4:11 am

i don't know much about sound editing, but i think there has to be a looping 'cue' inside your wav file for it to loop properly... sorry couldnt help more, thats about all i know
User avatar
JakeParlay
Senior Member
Senior Member
 
Joined: Thu Dec 09, 2004 8:40 pm
Location: Oregon

HMmm

Postby monomapmaker on Thu Jun 29, 2006 8:56 am

I did what the tut said but I was wondering. How can I know if it's working because I did'nt hear a lot of noise but I dont know if I would have noticed a diff becaause I never paid attention to sound. Also in the writing of soundscapes do you have to have all those spaces in front of the brackets and stuff or can it all just be aligned to the far right?

Also why do you save the scripts folder in half-life 2 deathmatch, when the sounds are being used in just regular half life?
tharawdeal wrote:I still remember when in HL1 I had my first "headcrab in vent" experience; I damned near threw my mouse across the room.


I'm a nerd, and proud
monomapmaker
Regular
Regular
 
Joined: Mon Jun 19, 2006 10:18 am

Re: the stupid "playlooping" thingo

Postby monomapmaker on Fri Jun 30, 2006 5:53 am

carbon_adam wrote:But what happens to me is that the sound only plays once. If however i change the volume parameter to "3" then the sound plays 3 times and if i change it to 10 it plays 10 times.


The volume is supposed to be set between 0 and 1 so 3 and 10 would go over the limit. Might be your prob
tharawdeal wrote:I still remember when in HL1 I had my first "headcrab in vent" experience; I damned near threw my mouse across the room.


I'm a nerd, and proud
monomapmaker
Regular
Regular
 
Joined: Mon Jun 19, 2006 10:18 am

Postby mendax on Sun Aug 19, 2007 2:25 am

I need help with this, I can't hear anything. I am using hl2 single player.


I have a txt. named soundscapes in the following folder:

C:\Program Files\Steam\steamapps\*myusername*\half-life 2\hl2\scripts

The txt. contains the following:

Code: Select all
"test"
{
     "dsp" "1"
     "playlooping"
     {
          "volume"     "1"
          "pitch"     "100"
          "wave"     "ambient/atmosphere/tone_quiet.wav"
     }
  }


and the env_soundscape is set at follows:

Name empty
Parent empty
Start Disabled No
Radius 200
Soundscape test
Sound Position 0-7 all empty


Also, the Soundscape keyvalue had the following in it's dropdown menu:

Nothing
Automatic
Automatic (dialog)
Indoor
Outdoor


I had to type in test as the value manually.
Any help?

EDIT- I have read that appartently custom soundscapes don't work in hl2 sp, but the article was written about 2 years ago. Can anyone at least confirm whether or not custom soundscapes in hl2 are possable or not?
mendax
Regular
Regular
 
Joined: Sun Oct 23, 2005 9:21 pm
Location: US

Postby .harvey. on Mon Sep 03, 2007 2:06 pm

what is all those brackets?

{
}
{



^^^ those, do i need to add them in?
User avatar
.harvey.
Regular
Regular
 
Joined: Fri Jun 10, 2005 2:15 pm
Location: UK

Postby Cunnah on Mon Sep 03, 2007 2:22 pm

you need them, they work just as brackets in a maths equation work, it tells the computer that it must do that first before moving to the next set of brakets
User avatar
Cunnah
Regular
Regular
 
Joined: Wed Mar 08, 2006 4:53 pm

Postby .harvey. on Mon Sep 03, 2007 2:32 pm

but they don't seem to be wrapped around anything, just scattered randomly.
User avatar
.harvey.
Regular
Regular
 
Joined: Fri Jun 10, 2005 2:15 pm
Location: UK

Postby Cunnah on Mon Sep 03, 2007 2:42 pm

trust me grammatical formating means nothing to a computer

Code: Select all
"test"
{
     "dsp" "1"
     "playlooping"
     {
          "volume"     "1"
          "pitch"     "100"
          "wave"     "ambient/atmosphere/tone_quiet.wav"
     }
  }


is the same as

Code: Select all
"test"
{"dsp" "1" "playlooping" {"volume" "1" "pitch" "100" "wave" "ambient/atmosphere/tone_quiet.wav"}}


but the first way is neater and the computer expects it in that format (although im not sure if the second way would be valid as well).
User avatar
Cunnah
Regular
Regular
 
Joined: Wed Mar 08, 2006 4:53 pm
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users