Skip to content

Choice Containers

gl326 edited this page Dec 14, 2021 · 4 revisions

Choice containers play one item at a time. By default, when you play a choice container, it picks one of its contents at random and plays it.

Actually, what it does is it shuffles the order of its contents, and then plays them in order one at a time, shuffling them when it gets to the end. This way it makes sure that no given sound ever plays twice in a row, hiding repetition.

If you have just one item inside it, it’s basically the same as playing a single sound with audio_play_sound().

  • SEQUENCE: when enabled, this container doesn’t shuffle the order of its elements. This is useful if you want to play one container over and over again, but each time it plays a more intense sound, or plays the next note in a musical sequence. In Wandersong sometimes we would set it up so that your footstep sounds played a sequence, so that it felt like there was a musical pattern in your footsteps.

  • CHOOSER: Lets you manually set which sound is chosen to play, typically with a Parameter. Drag and drop a parameter into this box to attach it. This way you can use the game state to change what sound plays, rather than it being random. Parameters can have a value between 0 and 100… 0 means the first sound plays, 100 means the last sound plays, 50 means the middle one, etc.

  • Spec min and spec max: are generally for “spec” sounds, which are sounds that play occasionally. They set a minimum and maximum time that the sound will repeat within if it’s set to ONGOING. So for example you could have a bunch of bird calls, and use these settings to say a bird call plays every 5 to 10 seconds.

  • RANDOM XYZ: places the sound at a random spatial position each time it plays, so the aforementioned bird calls could sound like they’re coming from all around you. Make sure you've also enabled 3D here! The random distance is based on the default sound size and attenuation you set, so you hear a variety of volumes.

  • ONGOING: makes it so that the container just keeps playing sounds as soon as the previous one ends, until the container is manually stopped.