1. On August 16th at 9pm CST, the site will be put in to read only mode for maintenance. Maintenance should not take longer than an hour.

How can you loop a ambient_generic

Discussion in 'Mapping Questions & Discussion' started by Jellydotjar, May 5, 2016.

  1. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    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?
     

    Attached Files:

    Last edited: May 5, 2016
  2. Three Million

    Three Million L5: Dapper Member

    Messages:
    201
    Positive Ratings:
    65
    Did you make sure to un check "Is not looped" in the flags section?
     
    • Agree Agree x 1
  3. DerpzSpycrab

    DerpzSpycrab L1: Registered

    Messages:
    9
    Positive Ratings:
    5
    Your answer is in the "Flags" tab. I think it's "Is not looped"

    EDIT: ninja'd
     
  4. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    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: May 5, 2016
  5. Three Million

    Three Million L5: Dapper Member

    Messages:
    201
    Positive Ratings:
    65
    What?
     
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    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.
    [​IMG]

    :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.​
     
  7. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    Alright, if this doesn't work I'll just edit the elevator music to make it loop and pakrat the new version in.
     
  8. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    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.
     
  9. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    Last edited: May 6, 2016
  10. Comaaz

    Comaaz L1: Registered

    Messages:
    26
    Positive Ratings:
    7
  11. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    Read all the posts before posting
     
  12. Comaaz

    Comaaz L1: Registered

    Messages:
    26
    Positive Ratings:
    7
    I'll post if i want to, thanks.
     
  13. Comaaz

    Comaaz L1: Registered

    Messages:
    26
    Positive Ratings:
    7
    sorry, didn't mean to sound harsh xD
     
  14. Jellydotjar

    Jellydotjar L1: Registered

    Messages:
    16
    Positive Ratings:
    2
    I programmed the file to loop, problem solved
     
  15. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    834
    The problem here is you did not put a tick in the box for 'Is NOT looped'.
    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.