The Ambient_generic entity lets you play sounds
in your map. If you want background ambience, like wind or traffic, you’re better off using
a soundscape. Watch my tutorial on that instead. MAKING AN AMBIENT GENERIC
Click on the entity tool and place it in your level where you want the sound to play.
Choose the selection tool and double-click on it. Choose ambient_generic from the Class
drop-down list. Click on Sound Name and Browse.
Tick ‘autoplay sounds’ to automatically play the sounds you select. Find the one you like
and double-click on it. Well done. Give the ambient_generic entity a name- this
will help later on and is a good habit. GENERIC OPTIONS
You won’t need to change most of these options- they’re simple to use, but I’ve used the defaults
for this tutorial. The one you might like to adjust is Max Audible
Distance, it determines the furthest distance away that this sound can be heard, shown by
the yellow circle here. Click on how you would like for it to be triggered
to go to that part of the tutorial. TRIGGERED BY WALKING INTO AN AREA
Make a block, select it and press ctrl+t. Choose trigger_once, or trigger_multiple if
you want it to work more than once. Go to the Outputs tab, click add and in the first
box put ‘OnStartTouch’, the name of the ambient_generic entity in the second and PlaySound in the
third. TRIGGERED BY A BUTTON
Make a block as before, select it, press ctrl+t and choose func_button. Go to the Outputs
tab and in the first box put ‘onpressed’, the name of the ambient_generic entity in
the second and PlaySound in the third. PLAYING ALL THE TIME AUTOMATICALLY
In the ambient_generic entity’s properties, click on the Flags tab and disable ‘Start
Silent’. If you want it to repeat forever, untick ‘Is NOT Looped’. Some sounds won’t
loop, it depends on whether the audio file has a cue or not, but I won’t cover that here.
PLAYING FROM EVERYWHERE If you want it to sound like it’s coming from
everywhere instead of from where it’s placed in the map, tick ‘Play everywhere’. It doesn’t
matter where it’s placed in the level when this is ticked.