How can you loop a ambient_generic

Jellydotjar

L1: Registered
Mar 31, 2016
15
3
I'm trying to loop an ambient_generic using the soundfile tf_music_upgrade_machine.wav. My current setup has a logic_timer to do the playsound command every 1 min (length of song) but for some reason it doesn't work. I tried looking this up but got little to no information. Any help?
 

Attachments

  • sceenshot 1.png
    sceenshot 1.png
    20.4 KB · Views: 417
  • screenshot 2.png
    screenshot 2.png
    26.4 KB · Views: 390
Last edited:

Three Million

L4: Comfortable Member
Jul 2, 2015
197
75
Did you make sure to un check "Is not looped" in the flags section?
 

Jellydotjar

L1: Registered
Mar 31, 2016
15
3
The sound-file itself isn't looped, I have a setup that plays the sound over and over to emulate it being looped that doesn't work. I researched this but it isn't for what I'm trying to do.
 
Last edited:

Three Million

L4: Comfortable Member
Jul 2, 2015
197
75
The sound-file itself isn't looped, I have a setup that plays the sound over and over to emulate it being looped that doesn't work. I researched this but it isn't for what I'm trying to do.
What?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
You misunderstand, Jelly. Derpz and Three Million weren't talking about whether or not the .wav file was a looping one. They talked about a spawnflag that ambient_generic has named 'Is NOT looped'. This spawnflag changes how the playback of the ambient_generic is controlled. If you tick it, the entity will restart and play its sound whenever it's sent the PlaySound input. If it's not ticked, then the entity must first be stopped before it can be told to play again.

Your logic_timer OnTimer output has a delay of sixty seconds. Assuming your logic_timer has a sixty second refire interval (Class Info tab), your output is actually firing in 120 seconds (60 + 60). Set the refire interval to 60 and remove the delay on its output.
OvnuKQU.png


:hint:
Unticking the 'Is NOT looped' flag will make the game assume the sound file is a looping wav. The game automatically stops any looping sounds when the round is reset, so this is useful for preventing overlapping music.​
 

Jellydotjar

L1: Registered
Mar 31, 2016
15
3
Alright, if this doesn't work I'll just edit the elevator music to make it loop and pakrat the new version in.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
If it doesn't work, it'll be because something hasn't been set up right yet. If you still have problems, take screenshots of each tab of your logic entities and we'll go from there. Or upload a VMF if you like.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
The problem here is you did not put a tick in the box for 'Is NOT looped'.
This spawnflag changes how the playback of the ambient_generic is controlled. If you tick it, the entity will restart and play its sound whenever it's sent the PlaySound input. If it's not ticked, then the entity must first be stopped before it can be told to play again.

I have tested this myself and it works fine. However, the sound did not begin playing on its own, so I used a logic_auto > OnMapSpawn > elevator > PlaySound.

If you perform these two steps you will not need to include a 5MB custom .wav file. However, you may find your looped .wav to be a more seamless loop. If you choose to stick with it, don't tick the 'Is NOT looped' spawnflag, as that will lead to overlapping music when the round resets.