Custom Music

Tutorial collection, comprehensive listings on main site.

Custom Music

Postby Tutorial on Tue Mar 08, 2005 12:26 am

category
Miscellaneous

description
Learn to bring your own music in-game.

keywords
custom, music, sounds, sound.

First you need to make a folder named "sound", that folder should be placed in the mod folder
Example:
Wherever you have installed steam.
...\Valve\Steam\SteamApps\SourceMods\"modname"\sound


My folder in my mod
modname
--cfg
--DownloadLists
--maps
--resource
--SAVE
--scripts
--sound (thats your sound folder)

Copy some sounds into that folder *.wav or *.mp3 works.
Then in your map, construct whatever you want to or maybe you have an already finished map\testmap
place a Entity named "ambient_generic" where you want your sound\music
go on properties, fix a name for your "ambient_generic" and stuff like that

Well, to the music\sound, go to the Keyvalue named "Sound Name" (Here you have to be specific)
Type the name of the sound\music you want to be played.

Example:
sound
--music1.mp3
--effect1.wav

Let's take the music first

Put music1.mp3 as the value in "Sound Name" (note you cannot play it in the editor)

Use some Outputs to activate the "ambient_generic" (with your desired name)

Remember to set the Keyvalue "Start Volume" to a number between 1-10 (1 lowest - 10 highest)
I used a func_button to trigger the sound
and on Outputs on the func_button:
My output named - OnPressed
Targets enteties named - "ambient_generic"(ur sound\music)
Via this input - PlaySound

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

Postby serpent666 on Tue Jun 07, 2005 4:44 am

didnt work for me... i tried mp3 & wav
Image
User avatar
serpent666
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Apr 07, 2005 1:03 pm
Location: Perth , Western Australia

Postby slayera on Tue Jun 07, 2005 4:54 am

serpent666 wrote:didnt work for me... i tried mp3 & wav


Could try to post more helpful infomation...?


Can you play your wav file in the editor? If not, you need them correct folder.

I also suggest you make a sub-folder in your sound folder, like sound/mymap.

Also you need to make sure you have a copy in both your SDK folder for the editor and copy in your games folders, and the paths must match.
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 serpent666 on Thu Jun 09, 2005 4:00 am

yes. i can play the sound in the editor

and i did make a subfolder it was called custom/loop.wav

but i did place it in my counter-strike folder... under sounds....
Image
User avatar
serpent666
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Apr 07, 2005 1:03 pm
Location: Perth , Western Australia

Postby jacc0s on Thu Dec 01, 2005 4:43 pm

hmmm mp3 not working for me tho..
jacc0s
Member
Member
 
Joined: Sat Jul 23, 2005 5:54 pm

Postby slayera on Fri Dec 02, 2005 12:39 am

Check your console after you load the map and see if you have any messages about files not found. Make sure you scroll back up the messages list if you have to.
Instead of using an mp3, test with a .wav file in the same folder (you cannot play mp3s in the editor), that will let you know that you can hear the sound playing in the editor then copy to your games folder. If you know for sure you can play .wav file, then you should have no problems with mp3's.
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 jacc0s on Wed Mar 22, 2006 11:30 am

wavs works for me ingame but not mp3
jacc0s
Member
Member
 
Joined: Sat Jul 23, 2005 5:54 pm

Postby slayera on Wed Mar 22, 2006 1:09 pm

Wow, took you fricking long enough to reply back.

Have you tried other mp3's or just one? I know this works I just released a map with 16 mp3's in it.

I don't know if you have to trigger it either, since I had to do it anyway in my last map.

If your trying to make this work for a soundscape then it won't work. Mp3's only work on ambient generics.

Get a .wav file and and an mp3, put both in the a sub folder under sound, call it test or whatever. Make a copy in your mods game folder too (you should have 2 copies on your HD now). Setup a test map and add two ambient generics, point each to one of the sound file. Give both the same name and make trigger to set both. You might place the trigger away from the player spawn for testing. You will need to adjust the flag settings for the ambient generics for the sound type you are using. Make sure you have a volumn of 10 and check play everywhere, so your not to miss it playing. Compile and test. If it still does not work post your compile and console log in the Help thread.
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.

Return to Tutorials

Who is online

Users browsing this forum: No registered users