In the game are several voice overs, and I need to make sure they don't overlap as it sounds terrible, but also make sure that each is played.
Now, if say sound 1 is playing, and I want to play sound 2, I need something like:
If (sound 1 still playing) {
create new event:
Audio on "1" ended: Audio play sound 2.
}
or similar.
The problem I see with this approach (even if creating events dynamically were possible), is that there is a window of opportunity for the sound 1 to end before the "on 1 ended" is registered or active, which means sound 2 will never get played.
So perhaps we need a sound queue plugin, which will maintain a First in First out queue of voice overs to play in sequence, at the same time and independent of a other sound effects playing.
Its logic would be more like:
Every tick: (if no sound with tag "voiceOver" playing) {
pop next sound item off queue.
If item found, play item.
}
C2 has no Queue structure, and an array would be less than ideal.
any ideas? This must be a common issue.