[FIXED]Noobish question about sounds/music in hammer
I'm currently making a ratmans denn type of thing on my map and it's almost finished: I've added the music that plays when you enter and stops when you leave and there are scrawlings on the wall and everything but I can't figure out how to stop the music that starts when you start the level. I know that I should use ToggleSound (or something?) and I've located the entity for the starting music but I can't select it since it seems to be somehow connected to a nodraw cube around it. I've tried using collapse but even though it says it collapsed 2 objects I can't select the sound entity.
NEED HELP!!
EDIT: FIXED!!!
Thanks for everyone, especially Brainstone for helping me out. His first post was correct I just didn't understand it properly. Thanks once more!
The output you should be using to stop the sound is StopSound. Hope this gives you some insight.
But the StopSound was useful thanks for that!
What is the best way to fade in and fade out sounds?
Vordwann wrote:
Strange related question:What is the best way to fade in and fade out sounds?
Idk if these are the best ones but they're working great for me, but use the fade in and fade out options in the sound entity properties.
Or do you mean like fade out the further you are?
At last, several special options of ambient_generic cause bugs. Read this to know these bugs.
Here's some more information to help locate the problem better:
- The voice entity is grouped with the .vmf object that's created automatically in the PTI
- The more precise location/file is instances/p2editor/global_ents.vmf
- Collapsing the group is a bad idea since it for some reason screws up other things relating to the elevators, map starting etc.
- I know what to do if I could just select the voice entity.
Also is there a command that somehow force stops the background music even if you can't select the voice entity or don't know the name of it?
- First thing you do is select the instance and click on "Edit instance".
- Now you can see how the instance itself is built, Hammer opened it as new map.
3.a Now you can select the ambient_generic. I suppose it has a name already. Remember it's name.
4a. Close the instance and go back to your map. Now select the instance and give it a Fixup name. For example "GlobalEnts".
5a. Now you can order things inside the instance. Place a logic_auto and give it the following output:
OnMapSpawn--->GlobalEnts-TheNameOfTheAMbientGeneric-->StopSound.
As you can see, if you insert a "-" you can order entities inside an instance.
3b. After you have opened the instance, edit it. Delete the ambient_generic.
4b. Save the instance UNDER A NEW NAME.
5b. use this instance instead of the other instance. I'm pretty sure that nothing will go wrong.
Brainstone wrote:
1. First thing you do is select the instance and click on "Edit instance".
2. Now you can see how the instance itself is built, Hammer opened it as new map.3.a Now you can select the ambient_generic. I suppose it has a name already. Remember it's name.
4a. Close the instance and go back to your map. Now select the instance and give it a Fixup name. For example "GlobalEnts".
5a. Now you can order things inside the instance. Place a logic_auto and give it the following output:
Didn't work 
I don't think it matters but in case it does, I didn't use logic_auto but just used a trigger which you walk on to activate and it fades in the ratman theme and SHOULD fade out the ambient, but it doesn't recognize the ambient sound (checked it's name and it seems to be @music) inside the GlobalEnts, but instead just gives a red text. Maybe PTI renames the @music to something else?
Anyways the > Brainstone wrote:
As you can see, if you insert a "-" you can order entities inside an instance.
was useful information.
I'll try the second way in a second. (pun not intended)
First of all I've figured out that the most obvious way: writing $Volume 0 on the main instance wont work. Also, I've found out that under the GlobalEnts group there is AutoInstance1 and under it global_ents and under it there is finally the @music. So I would have to collapse it like a million times if I wanted to remove the sound... :/
EDIT: Ok so the reason Brainstone's advice: > Brainstone wrote:
As you can see, if you insert a "-" you can order entities inside an instance.
didn't work because the GlobalEnts and everything thats under it are not just entity inside instance but instances inside instances inside instance.(I think it's because of that)
Okay, I've got one last idea: If I remember right, entities starting with an "@" are handled specially.
Simply try the output: Trigger_once-->OnStartTouch-->@music-->StopSound
And remmber the bugs with ambient_generics I sent you the link to.
You've made me curious now. I'll try to stop the sound too. That can't be that hard.
EDIT: Okay, I see that you fixed it. Glad to hear.
Brainstone wrote:
Okay, I've got one last idea: If I remember right, entities starting with an "@" are handled specially.
On your note here, the @ prefix is used so then an instance will not rename the entity. E.g. An instance you have a portalgun named @portalgun and a pedestal called 'pedestal'. You name the instance gunPed. When compiled and in game pedestal is now called gunPed-pedestal however @portalgun is still called @portalgun, meaning you can have inputs straight to it without worrying about the instance prefix.