Please or Register to create posts and topics.

Timing Lights to flash on/off with music?

Page 1 of 2Next

The title says it all folks, I want to know if it's possible to make lights (just normal lights in the room) flash on and off to the beat of music. If it is possible a step-by-step tutorial on doing so would be nice.

Also I followed the method of entering custom sounds to the letter, and I haven't gotten any of them to play in the map at all!

First, about the custom music:

You need to pack the .wav/.mp3 into the mapfile by using a program like Pakrat, else they won't play unless you rebuild the soundcache.

About turning lights on and off: I would use logic_timers. Depending on your music you could have the light go out and on after a specific amount of time or in a random fashion.

I won't go into detail though. You can find step-by-step-guides for as good as everything when you just google for the entity at hands and add "hammer" or if needed "portal 2". Also, instructions how to use these entities in other source games like Counter-Strike work for Portal 2 as well. This one for example: CSSBANANA: Playing sounds with a logic timer.

Timers are wonderful things if you happen to know the second by second beat of the music. By that, I mean if you know the exact beat the music follows from one second to the next then timers are a great way to go. The only problem is that you need a lot of timers to pull it off.

On the other hand, if you use an object which is able to respond to the music directly, you have a much better chance of getting the effect you are looking for. However, as far as I know, there is no such object in the game.

Wow! That was...uh, yeah. Just, yeah.

Just a warning: it's not necessarily bad, but naming lights and switching them on and off a lot can be bad for your map, sometimes it causes visual problems in the map if you have too many named/switched lights.

If you name all your flashing lights the same thing, though, they'll only use one lightmap page. It's a lot better for your map.

Falsi sumus crusto!

I really am not going to be timing everything to the music as that would make the boss battle too complex. Lights will activate in the room according to the first few seconds of the song. Lasers will start and stop etc. I don't know exactly how I'm going to pull it off, but the song is "The Final Countdown" from Europe.

Of course I have to get the music to PLAY in my maps first ...
I can get them to preview inside hammer, but when I play them in-game nothing happens...just silence and standard game sounds...

Sorry to burst your bubble, but the song is copyrighted and you aren't allowed to distribute it.

Falsi sumus crusto!
FelixGriffin wrote:
Sorry to burst your bubble, but the song is copyrighted and you aren't allowed to distribute it.

I'm not making money off of distributing it, and it's only usable in the map files.
SO
It's not much of a problem to use copyrighted stuff, it's under the "Fair use" segment of the copyright laws. My projects are all non-for-profit and I'm not making money off of add revenue. The close to zero chance of them even finding my content(Or caring about it...) is also a factor.

No, the closest fair use gets to that is that you can use either 10 seconds or 5% (whichever is shorter) of a copyrighted song so long as it's for a personal, noncommercial, educational purpose. It's easy to rip the music out of the map as well, so you are redistributing the file.

Falsi sumus crusto!

This song is his problem and not part of this topic I'm sure.
I suggest to keep talking about his problem.

Sounds added by user aren't recognized in the game automatically (since Portal 2's Source Engine).
You either need to rebuild your sound cache or (which is the better I mean) put that sound file into your map via Packrat.
How to do so -> search it in the forums. It's explained. Or use google.

Page 1 of 2Next