Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Stop or pause reading by script

A topic by Rekize created Feb 08, 2019 Views: 91 Replies: 8
Viewing posts 1 to 9
(1 edit)

Hello, may I ask if there are ways to stop or pause the reading by script? Setting the Read Delay to a very large number does the trick, but are there dedicated functions to achieve the stopping and pausing effects?

Also, is there a way to get the length of the STM text that has been read?



If you want to stop reading at certain points, you can use the <pause> tag, and then call Continue() to keep reading from there. You can also use the timing tag <t=5.0> to make the following letters start reading from a specific time.

If you mean length as in time, you should be able to use...[stm.latestNumber].readTime. That should give you the time the latest character was printed out at.

I hope this works for you! Let me know if I misinterpreted what you meant!

(1 edit)

Thanks for your reply.

Actually I am using a third party tool to control the dialog, thus putting <pause> into the dialog may not be feasible in my case. Because of my would be great if there are ways to fully control the reading and pausing using scripts.

About the length, I mean the number of characters had been read out. Like if the full text is "Hello World", and it is has been read out as "Hello W", I wish the function can return 7. Would[stm.latestNumber] do the trick?


For the length, stm.latestNumber will give you the index you need!

Another option for stopping text is to use Append() when you need to add more text to a string. Will this work for your needs?

stm.latestNumber seems to be the right direction to go.

But for the pause, if I use Append(), I seem not being able to use the Fade (or others) read out effects;

if I change the readDelay parameter to achieve pause, I need to call stm.Read() or stm.Rebuild() each time I change the STM setting by script, and the stm will read from the start again. This happens even I checked stm.rememberReadPosition. What else can I try?


Remember read position is for enabling/disabling meshes. You can change the delay mid-string with <readDelay=0.1> I believe? Or insert a manual delay with <d=0.1>. Will this achieve the effect you're after?

(1 edit)

I am trying something like:

if (superText.latestNumber <= TMPDummytext.text.Length) {
superText.readDelay = 0.02f;
superText.Read (dummytext.text.Length*0.02f);
} else {
superText.readDelay = 99999999f;
superText.Read (dummytext.text.Length*0.02f);

where dummytext is the text being controlled by the third party tool. But the stm.Read(float time) sometimes don't match the dummytext reading time. Is there a way to do  stm.Read(int characterIndex) to make STM read from the character index?


You can try...

stm.Rebuild(), //make sure read automatically is off


What is this 3rd party tool by the way?

I am using Adventure Creator. I solved the problem by using STM to control the dialog display of the Adventure Creator system. Before I was doing it the other way round and it driven me nuts...

Thank you very much for all the suggestions, I have much more understanding on STM now :)