New paragraphs when using typewriter

OurJud
How do I make a new paragraph when using the typewriter effect?

Return is disabled when in the UI, and if I go into code and add a paragraph I get an error. <br> doesn't work either.

Please don't tell me I have to create a new typewriter effect every time I want a new paragraph.

OurJud
Well, the only workaround I've managed to come up with for this, is to give each paragraph its own room, and use a (wait x seconds) script which estimates how long it takes each paragraph to finish typing out, before 'moving' the player to the next room / paragraph.

I've managed to get the timing right on the desktop, but online, what with possible lag, this may well turn out a complete mess, with the next paragraph starting while the previous one is still typing.

From what I can gather, the typewriter effect is left wanting. It needs the ability to allow paragraphs, and some kind of 'wait for typing to finish' type function.

i.e

TextFX_Typewriter ("This is one paragraph", 60)
WhenTypeFinish ("This is the second paragraph", 60)

jaynabonne
The problem with a typewriter type effect is that it outputs characters one at a time. That means you can't have style attributes or any sort of HTML markup that requires chunks of text.

For example, let's say you have this: Hello world!<br/>Goodnight moon!

At some point, it will have printed "Hello world!" and then it will print the "<", which makes no sense on its own. Then it will print the "b", which means you have "<b", and then "<br" and then "<br/", etc. It's a real mess.

The way to properly do it would be to parse the text to identify the tags to emit them at once. But even then you'd have to handle pairs like "<b>Foo</b>", to know to emit them together around the text, once the text starts to show up. It's not trivial at all. (It could be an interesting programming project, actually.)

As far as knowing when the typewriter is done, that could be added. I wrote my own similar sort of effect, and I just passed it a function name to invoke when the effect completes. A version of that could be done for typewriter.

OurJud
Thanks, J.

I've now scrapped the typewriter idea, for all the reasons you mention.

It's a nice effect, and I suppose great for a single sentence, but no good when you want to start styling, etc.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums