Randomizing sounds?

Discussion in 'Mapping Questions & Discussion' started by Coolz, Oct 3, 2014.

  1. Coolz

    Coolz L2: Junior Member

    Messages:
    72
    Positive Ratings:
    18
    Okay, so I had a voice actor record some lines depending on whats happening on the map, the problem is I can only play a specific one. Earlier this week I used a bunch of logic_cases to try to randomize it up, but it didn't seem to work-- in fact when the map told it to pick a random case nothing happened, despite the fact I set it up to play a different line depending on what case it landed on.
    How exactly do I use logic_cases to randomize that?
     
  2. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,818
    Positive Ratings:
    4,658
    This is fairly funny, coming from you after writing that tutorial on soundscripts.

    Because Soundscripts is exactly how you would do this. They allow selection from a random selection of wave files to play back each time the script entry is called.

    I suggest you read through the wiki page on them. https://developer.valvesoftware.com/wiki/Soundscripts
     
    • Thanks Thanks x 1
  3. Coolz

    Coolz L2: Junior Member

    Messages:
    72
    Positive Ratings:
    18
    Yes aly, but the sounds I want to edit are things such as "The bomb is nearing a checkpoint" triggered by a trigger. That'd probably call for a randomized logic_case, or would it actually trigger the soundscript by playing that?
    Other than that it calls for things not in the default soundscript at all, and I seriously doubt you can easily add it to the soundscript. It'd probably be easier to do a logic_case for the moment.
     
    Last edited: Oct 3, 2014
  4. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,818
    Positive Ratings:
    4,658
    The trigger just tells an ambient_generic to play. The ambient_generic can reference a soundscript entry (one in game already, or a custom one you put in your level_sounds) or a raw wave file. Instead of referencing a raw wave file like it probably does, you just put a soundscript name in and have the soundscript entry under that name set up using rndwave to randomly select a wave file to play.
     
    • Thanks Thanks x 2
  5. Coolz

    Coolz L2: Junior Member

    Messages:
    72
    Positive Ratings:
    18
    Okay, thanks for the help Aly.
     
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,071
    Positive Ratings:
    832
    You would be better off using the PlayVO, PlayVORed and PlayVOBlue inputs of tf_gamerules. You won't need to use ambient_generics then. You can force only one team to hear the announcement, too.