Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

[Solved] Voice clips not working with <pause>

A topic by Scarlet String Studios created Oct 18, 2018 Views: 91 Replies: 5
Viewing posts 1 to 6
(1 edit)

Hey there. Just found what might be a bug with the <pause> tag. I noticed that the voice clips stop playing after using the tag:

These are my STM settings:

At runtime, I didn't see any changes to the Audio Source or to STM's audio settings. Everything is enabled, but it seems to be not playing for some reason.

With my setup, I have an <e> tag just before the pause, which triggers an event that caches the mesh's read time (via currentReadTime). When the player presses A, I call Continue() and Read(cachedReadTime) on the mesh. It's been a while since I implemented this so I'm not sure if this is the correct approach.



Looking through my code now, I can't believe I made it so Continue() relies on the autoRead variable, so I've changed that. Doesn't really make any sense in practice... So now within the "Continue()" function, I've changed the line of code reading "Rebuild(totalReadTime, autoRead);" to "Rebuild(totalReadTime, true);".

That said, you should be able to use "Read(stm.currentReadTime)" so you don't have to cache the time using an event! (currentReadTime gets set to where the mesh last left off when Continue() is called)

There was a bug related to <e> tags being right next to <pause> tags that got fixed in v1.8.2, maybe it could be related to that?

Besides that, I can't seem to be able to reproduce the bug. Hopefully this is enough to get it fixed? If this doesn't work, I'll take a closer look!

Thanks for the tip on currentReadTime! That part works now without caching the read time.

But, unfortunately, the problem still persists. I have a little debug script that gets all Audio Sources in the scene (via FindObjectsOfType) and prints what they're playing — so I can see that the STM's Audio Source is playing while the characters are talking normally, but not after Continue(). For one reason or another, it seems like the Audio Source just isn't playing even though the text is reading.


Are any events after <pause> being called? Audio clips and events are called during the same part of code, so this will help me narrow down the issue. Would it be possible for you to email me a sample project?

There's an event before pause, e.g.

Here's some text.<e=waitforinput><pause> And here's some more text

I tested just now, and it looks like this only happens when autoRead is off (maybe related to that first issue you were explaining with Rebuild()). I'll email you the sample project I was using just now.


Just an update as this was solved through email. The above solution I had ended up working.