How do I set HL2 music to play?

In 'C:\Valve\Steam\SteamApps\USERNAME\half-life 2\hl2\sound' create a new folder called 'mp3'. Put your song files in there. Then in Hammer create an 'ambient_generic' entity. Go to it's properties and call that entity 'song01'. In the 'Song Name' field put 'mp3/SONGNAME.mp3'. Change a few other properties to your preferences.

To activate your song you have a few options. You could make a trigger brush that the player can walk into to start playing the song. You could also have it start playing when the level is finished loading.

To make a trigger that a player can walk into to start playing; make a brush and tie 'trigger_once' to it.(press ctrl+t to tie brushes with classes) Name it 'trigger01'. For the texture apply 'toolstrigger'. In the output tab 'add' a new command. 'My output named' should have 'on trigger', 'Target entities named' should be 'song01' and 'Via this output' should be 'PlaySound'. Press 'Apply' then compile your map.

To make your song play automatically when the map loads; create an 'logic_auto' entity. Make sure it isn't touching a wall/floor/outside your level. In the output tab 'add' a new command. 'My output named' should have 'OnMapSpawn', Target entities named' should be 'song01' and 'Via this output' should be 'PlaySound'. Press 'Apply' then compile your map.

If you do both of the above then your song will automatically start playing and you can also have it play again or at the same time(very annoying) when you walk over your trigger.
 
Back
Top