FAQ  •  Login

5: Music

<<

Kenny

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1016

Joined: Sun Mar 16, 2008 3:43 am

Post Sat Apr 12, 2008 5:51 pm

5: Music

How do I get custom music into a mod? I'm having difficulties with that...
Image
<<

tyrtill

User avatar

Specialist
Specialist

Posts: 198

Joined: Tue Feb 05, 2008 4:27 pm

Post Sat Apr 12, 2008 7:11 pm

Re: 5: Music

A simple ambient generic should work.
<<

masterkhufu

Sergeant
Sergeant

Posts: 349

Joined: Thu Apr 10, 2008 1:04 pm

Post Sun Apr 13, 2008 12:40 pm

Re: 5: Music

i think he may mean "getting the custom sound into the correct folder so it can be used by the ambient generic."

i confess, i've tried to find the music/sound folder before, and have had no luck with it.
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Sun Apr 13, 2008 2:28 pm

Re: 5: Music

you need to create your own sound folder in your mod's folder.

i haven't put custom MP3s into a map before, but i think if you put them in the sound folder, then put them in the map with an ambient_generic, it should work. i'll try this out right now.

EDIT: i just tried this, and it worked for me.
<<

Kenny

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1016

Joined: Sun Mar 16, 2008 3:43 am

Post Wed Apr 16, 2008 10:16 pm

Re: 5: Music

But how did you get the ambient generic to work? I made a music folder and entered the filepath to the sound into the ambient generic and it didn't work.
Image
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Wed Apr 16, 2008 11:53 pm

Re: 5: Music

did you give it an input? you should have a trigger of some sort sending an output of OnTrigger, or OnStartTouch, to your ambient_generic, with the input of PlaySound.
<<

DeathSpector

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1076

Joined: Sun Feb 10, 2008 6:05 pm

Location: Kans City

Post Thu Apr 17, 2008 1:57 am

Re: 5: Music

Kenny wrote:But how did you get the ambient generic to work? I made a music folder and entered the filepath to the sound into the ambient generic and it didn't work.


I think you just put it in the folder, you just put the file name, and not the
file path.
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Thu Apr 17, 2008 12:15 pm

Re: 5: Music

Kenny wrote:...I made a music folder and entered the filepath to the sound into the ambient generic and it didn't work.


i just re-read that... you want the file to be in the sound directory. if there is not sound directory create one. it must be called "sound". you can have folders under it (such as music) if you want to.
<<

masterkhufu

Sergeant
Sergeant

Posts: 349

Joined: Thu Apr 10, 2008 1:04 pm

Post Thu Apr 17, 2008 3:29 pm

Re: 5: Music

i have tried doing this before...making folders and whatnot for the sound, but i have no idea where to put the folder.

in an effort to try and find the sound folders, i've done many, many searches looking for .wav files and the like - hoping to glimpse the correct folder. however, my searches never "have any results to display" which is pissing me off a bit because i open up the sound browser for the ambient_generic, and there have to be at least 2 thousand sounds there.

any ideas on how to find the sounds for HL2 ep1?
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Thu Apr 17, 2008 4:28 pm

Re: 5: Music

The sound files themselves are not in the regular file system. they are packaged into GCF files. that's why you can see them in hammer, but not in windows where you expect them.

to put custom sounds in your mod, you create a folder named "sound" in your mod folder... that is, in:

Steam/SteamApps/SourceMods/<your mod name>/

once the sounds are there, to be used in an ambient generic, you simply run hammer (with the source SDK configuration set to your mod), place an ambient_generic, click the browse button next to the sound name, and make sure to choose "Raw" from the sound type drop down list, then pick your sound and give the ambient_generic a name.

once the sound is picked, you need to tell the ambient_generic when to play, by giving it an input. the simplest way to do this is to create a brush for the player to step into, textured with the trigger texture. select the brush, press [ctrl]+t to make it an entity, change the entity type from func_detail to trigger_once. click the "Outputs" tab on the properties window, and click the "Add" button. name the output like this:

OnStartTouch, <name of your ambient_generic>, PlaySound

compile the map, step into the trigger and listen to your sound... if this doesn't work, than there is something wrong with either your setup, or your sound file.
Next

Return to Sound / Music

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.