[FIXED]Noobish question about sounds/music in hammer

Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
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!!! :biggrin: :biggrin: Thanks for everyone, especially Brainstone for helping me out. His first post was correct I just didn't understand it properly. Thanks once more!

Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Jun 02, 2012
Replied 1 hour later
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.

Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
Replied 2 hours later
Nope. Still doesn't work. It still selects the whole group.

But the StopSound was useful thanks for that!

Avatar
Vordwann
767 Posts
Posted Jun 02, 2012
Replied 1 hour later
Strange related question:

What is the best way to fade in and fade out sounds?

Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
Replied 2 minutes later

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?

Avatar
Brainstone
401 Posts
Posted Jun 02, 2012
Replied 29 minutes later
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.
Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
Replied 16 minutes later
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?

Avatar
Brainstone
401 Posts
Posted Jun 02, 2012
Replied 24 minutes later
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.

Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
Replied 24 minutes later

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 :sad:

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)

Avatar
Villethemina
40 Posts
Posted Jun 02, 2012
Replied 3 hours later
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: > 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)

Avatar
Brainstone
401 Posts
Posted Jun 03, 2012
Replied 14 hours later
Oh god, what a complete mess.

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.

Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Jun 03, 2012
Replied 13 hours later

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.