[FIXED]Noobish question about sounds/music in hammer
Quote from Villethemina on June 2, 2012, 6:11 amSo I'm making a map on hammer and everything has worked out fine so far. I made the base of the level on the portal 2 ingame editor (PTI) and then modifed it and added some stuff 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!
So I'm making a map on hammer and everything has worked out fine so far. I made the base of the level on the portal 2 ingame editor (PTI) and then modifed it and added some stuff 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!

Quote from ChickenMobile on June 2, 2012, 7:53 amThe reason you probably cannot select your sound is because it is grouped the other object. In order to select individual brushes or entities click the 'objects' button in the top right hand corner.
The output you should be using to stop the sound is StopSound. Hope this gives you some insight.
The reason you probably cannot select your sound is because it is grouped the other object. In order to select individual brushes or entities click the 'objects' button in the top right hand corner.
The output you should be using to stop the sound is StopSound. Hope this gives you some insight.
Quote from Villethemina on June 2, 2012, 10:28 amNope. Still doesn't work. It still selects the whole group.
But the StopSound was useful thanks for that!
Nope. Still doesn't work. It still selects the whole group.
But the StopSound was useful thanks for that!
Quote from Vordwann on June 2, 2012, 11:29 amStrange related question:
What is the best way to fade in and fade out sounds?
Strange related question:
What is the best way to fade in and fade out sounds?
[spoiler][SP] Alternate[/spoiler]
Quote from Villethemina on June 2, 2012, 11:31 amVordwann 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?
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?
Quote from Brainstone on June 2, 2012, 12:01 pmTo the other problem: Press ctrl+u to ungroup. If that doesn't work, the only possibility left is that you selected an instance inside of another instance. In this case, collapse again. To turn the sound off, just delete it. If you want to turn it off later, name it and give it the "stop sound" input.
At last, several special options of ambient_generic cause bugs. Read this to know these bugs.
To the other problem: Press ctrl+u to ungroup. If that doesn't work, the only possibility left is that you selected an instance inside of another instance. In this case, collapse again. To turn the sound off, just delete it. If you want to turn it off later, name it and give it the "stop sound" input.
At last, several special options of ambient_generic cause bugs. Read this to know these bugs.
Quote from Villethemina on June 2, 2012, 12:18 pmI don't know what I'm doing wrong but that doesn't work either.
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?
I don't know what I'm doing wrong but that doesn't work either.
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?
Quote from Brainstone on June 2, 2012, 12:42 pmWell, in order to select the sound, you need to collapse the instance. That is because instances are seen as one object, that stays the same all the time and does not change. However, you don't need to collapse the instance to stop the sound. There are two ways:
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:
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.
Well, in order to select the sound, you need to collapse the instance. That is because instances are seen as one object, that stays the same all the time and does not change. However, you don't need to collapse the instance to stop the sound. There are two ways:
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:
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.
Quote from Villethemina on June 2, 2012, 1:07 pmBrainstone 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)
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
was useful information.
I'll try the second way in a second. (pun not intended)
Quote from Villethemina on June 2, 2012, 4:18 pmOk so I'm making progress in solving this.
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)
Ok so I'm making progress in solving this.
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:
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)