Playing music in Half-Life Created 8 years ago2016-02-07 08:21:43 UTC by Spreen Spreen

Created 8 years ago2016-02-07 08:21:43 UTC by Spreen Spreen

Posted 8 years ago2016-02-07 08:21:43 UTC Post #328741
I'm trying to make music play in Half-Life in the Hammer Editor and I'm trying to get them to play using ambient_generics. Though, ambient_generics only take .wav files and I'm not sure if there's a .wav file for the music.
Somebody please help.
Spreen SpreenThis account is no longer in use.
Posted 8 years ago2016-02-07 09:35:39 UTC Post #328742
If you want the default music from Half-Life, you can use target_cdaudio. This will play the the specified soundtracks from Half-Life. A list of wich sound file correpsonds to wich Hammer value can be found here.
If you want your own music and are making a full mod, you can replace the .mp3 files in the mod's media folder with your own music, as long as they have the same file names as the original Half-Life music files.
Dr. Orange Dr. OrangeSource good.
Posted 8 years ago2016-02-07 09:41:50 UTC Post #328744
You'd just have to save the track as a wav file, using Audacity or a similar program. This would only really work if it's music coming from a stereo or something, since ambient_generic is not meant for background music.

If you're talking about background music heard throughout the map, Dr.Orange has you covered. :D
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-02-16 21:34:21 UTC Post #328907
Hi, i use target_cdaudio in my mod but when saving and reloading game it stops the track :( dosnt restart or continue the musick...
its rly anticlimactic in a gameplay :( is it possible to fix?

sry for reanimating the post ^^"
Posted 8 years ago2016-02-16 23:48:42 UTC Post #328909
Unfortunately it's a bug that comes with Steam Half-Life. It might be possible to fix, but you'd be looking at coding.
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-02-17 00:30:29 UTC Post #328911
Unfortunately, modders can't fix this bug because the CD audio code is within the engine. trigger_cdaudio make the same job as typing "cd play %i" (where %i is the track number) and "cd stop" in the console.
Posted 8 years ago2016-02-17 01:42:03 UTC Post #328912
lol steam hl is all fucked up
Posted 8 years ago2016-02-17 11:17:10 UTC Post #328917
I think WON had that issue too or am I wrong ? It doesn't matter a lot anyways since the "trigger_cdaudio" code didn't changed between WON and Steam.
Posted 8 years ago2016-02-17 15:04:17 UTC Post #328918
The only noticable change is that Steam HL loads mp3 files from the Half-Life files, while WON loads them directly from the currently inserted cd disc music tracks. I believe you could put the HL disc in a music player and it would play the game music right of the bat.
Dr. Orange Dr. OrangeSource good.
Posted 8 years ago2016-02-17 15:46:50 UTC Post #328920
with the play cd command you can make a setlist of songs suitable for each level of the game, bind a key for play-fwd-prev song and start enjoying music in your mod. =p
Posted 8 years ago2016-02-17 18:10:24 UTC Post #328921
eh shame :( so i cant start an mp3 in my mod by a trigger in a boss battle and then stop it by killing the boss :(
btw good to have a gold source working forum where i can get a clear answer nowadays XD might be possible to finish my mod i didn't had time for :(
https://www.youtube.com/watch?v=aHOI2NhTZcU
got more content if you guys whant to see :>
Posted 8 years ago2016-02-17 19:06:06 UTC Post #328922
Why wouldnt you be able to play a mp3 for your boss battle and stop it?

you could use: http://twhl.info/wiki.php?id=161
Posted 8 years ago2016-02-17 19:34:55 UTC Post #328923
eh in the middle of the battle if i save and then load the music is gone.
I can't orchestrate the music with the gameplay when player loads or dies in the fight :( would need to disable player saves so player cant save after target_cdaudio is triggered.
Posted 8 years ago2016-02-17 20:01:33 UTC Post #328924
If you want toggleable or loopable music, you should make it an ambient_generic instead, and the sound file should be a wav file.
Leave the "NOT Toggled" flag off and once the boss have been killed you can toggle it off to stop music. Maybe also toggle another, one-shot ambient_generic to ease the transition.
To sumarise, for the situation you are describing, I would recomend an ambient_generic instead of target_cdaudio.
Dr. Orange Dr. OrangeSource good.
Posted 8 years ago2016-02-17 20:01:35 UTC Post #328925
If you want toggleable or loopable music, you should make it an ambient_generic instead, and the sound file should be a wav file.
Leave the "NOT Toggled" flag off and once the boss have been killed you can toggle it off to stop music. Maybe also toggle another, one-shot ambient_generic to ease the transition.
To sumarise, for the situation you are describing, I would recomend an ambient_generic instead of target_cdaudio.
Dr. Orange Dr. OrangeSource good.
Posted 8 years ago2016-02-17 21:03:23 UTC Post #328926
yea i need to figure it out XD the problem with ambient_generic is the wird stereo effeckt while moving around it and wav files are much larger in file size (not a game braking thing XD) still how to controll the fade in and out timing in game ?
Posted 8 years ago2016-02-17 21:06:05 UTC Post #328927
put 4 of the same ambient generics outside the fighting arena. tick the 'play everywhere' flag and it'll minimize the stereo effect.

maybe turn them on with a trigger_auto? Just force a map load before the fight? This will also turn on the music if the player were to save and then reload during the fight.
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-02-18 13:35:25 UTC Post #328932
put 4 of the same ambient generics outside the fighting arena. tick the 'play everywhere' flag and it'll minimize the stereo effect.
Ah, ghetto play everywhere. :D

We used to have to do that in The Core. :P

Don't forget to reduce the volume of each to 25% what it was, to prevent it being amplified four times.
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-02-19 15:09:42 UTC Post #328948
put 4 of the same ambient generics outside the fighting arena. tick the 'play everywhere' flag and it'll minimize the stereo effect.
Yeah i think this the best way to control the audio with gameplay THX ;]
Posted 8 years ago2016-02-19 18:27:19 UTC Post #328949
and hope they dont go out of sync
Posted 8 years ago2016-03-01 06:40:15 UTC Post #329062
and hope they dont go out of sync
That would make for an interesting Phaser effect. Might be neat to experiment with out-of-phase sounds for non-musical applications.
Posted 8 years ago2016-03-01 15:41:44 UTC Post #329076
You must be logged in to post a response.