Open Silver-Streak opened 4 years ago
The issue is that the "=" is technically working as expected, but because times in games is "discrete", you never reach exactly 1.000000 second (you're for example at 0.9998 second, then at the next frame it's now something like 1.012).
The good way of doing a test like you want to do would be to check if the playing offset is >1 and was the frame before <1 - something that is a bit more complex that a simple "=". I think this would need to be a separate condition, and we should probably warn against using = in such conditions (though it can be useful if you want to test you're at 0.0 - but any other value is not possible).
@4ian Yep, I eventually worked around this by using ">=" and my offset instead of = .
Honestly, since this is very specific to audio offsets, and I'd bet 99% of the time this would be used for proper looping: This may be better solved by updating the sound/music events to allow you to input a "Loop at" attribute that you input the offset you want it to occur at, and then a "loop to" attribute to determine where it loops to? Maybe?
@4ian This still exists as an issue in 5.1.157. Should the = operator be removed from the conditions, or that loop action be added?
Describe the bug
While trying to create a workaround for the general bug/issue with delay on playing sounds/music, I attempted to find an alternative for better looping music that have an "Intro" piece. What I've discovered is that the "The playing offset of the music/sound on channel" condition does not work properly if you use the = operator. It does work with other operators.
For more detail: Many games have a short, unique, "intro" portion of background music. It then has a longer piece that loops endlessly and has a seamless loop transition.
To Reproduce
Steps to reproduce the behavior:
Attached is an example project. Currently set up to use the = operator, which never triggers, change it to >= for it to work. OffsetBug.zip
(License Attribution: music is from YouFulca/Wingless Seraph)
Other details
OS: Win10 Pro GD Version: 5.0.0-beta97 (Long term I'd like to submit a bug or feature request to enhance sound/music playing in general, but I need to spend time thinking through/researching a good alternative solution)