Sound Management In Elements
Posted: Sun Feb 27, 2022 12:57 pm
So, I am doing some experiments with sound in custom elements, and I am having a bit of trouble achieving what I want.
I want to make it so that a custom element plays a sound once upon creation, and then nothing more after that.
I've achieved this in multiple ways, but with a bunch of undesired side effects:
Setting the actual element sound to "changing" will play the sound upon creation, but it will also play it upon changing to another element, which I do not want.
Setting the previous element sound to "changing" will play the sound upon the element's creation, but I can only use this method if the pervious element is there from the start, otherwise the sound will play at undesired moments.
Just setting the element's sound puts it on loop by default, requiring me to make unwanted alterations to the sound or do some shenanigans to get the precise moment at which the element should change and the sound should cut off. Setting the loop mode of the sound to false makes it just not play at all.
Is there something I'm missing? If not, I think having a sound play just like a looping sound except once is a feature that should definitely be added to the game
Forgive me if I was not clear enough with my explanations; I know my wording was a bit rough and some parts don't make sense, but I don't really know the best way to describe my situation.
I want to make it so that a custom element plays a sound once upon creation, and then nothing more after that.
I've achieved this in multiple ways, but with a bunch of undesired side effects:
Setting the actual element sound to "changing" will play the sound upon creation, but it will also play it upon changing to another element, which I do not want.
Setting the previous element sound to "changing" will play the sound upon the element's creation, but I can only use this method if the pervious element is there from the start, otherwise the sound will play at undesired moments.
Just setting the element's sound puts it on loop by default, requiring me to make unwanted alterations to the sound or do some shenanigans to get the precise moment at which the element should change and the sound should cut off. Setting the loop mode of the sound to false makes it just not play at all.
Is there something I'm missing? If not, I think having a sound play just like a looping sound except once is a feature that should definitely be added to the game

Forgive me if I was not clear enough with my explanations; I know my wording was a bit rough and some parts don't make sense, but I don't really know the best way to describe my situation.