@fish - you could also probably get away with loading the message you want into a 2 dimensional array character by character so you can allow for multiple lines of text. then run through the array and print out each one by one. (probably too complex for you at the moment tho).
@ben - im guessing theres more to your lua code example to allow for multiple lines?
would you mind posting it for others who have the knowledge to understand it? pretty please?
in c++, character arrays are far more useful than strings. at least thats what you're taught. and i have found it personally so as well.
Well the breakdown of my Lua system is like this (it's not just text it does all sorts, basically cutscene control):
s("This is a line of text.")
s("do you like my system?");
yn("TESTYN","Yeah, I do","Nope!");
if (TESTYN == 1) then
s("Yay! You said yes.");
So what it does is (with some extreme trickyness, that I can't recall exactly) runs through the script and finds which line to execute. So on the first loop it runs line 1, then 2 etc. This allows for both lines that pause and ones that go to the next line and perform their function in one MMF tick.
I've got all sorts in it though, heaps of functions like:
Aye capitan. It's the lack of global support why I decided against the text blitter. I might switch back to it later, I mean I'm using the text blitter for selectable text options since it can calculate how many lines its using. Just couldn't find a proper use for it in speech text!
Yea, that's the easy bit. The tricky part is to get it to print it out properly, without the text jumping around every time it reaches the end of the line (á la the first Underside demo, and pretty much all other klik games that I've seen). One solution is to manually insert linebreaks where needed, but it's possible to do it with code as well.
Yeah axel I've always had trouble with that :\. You can probably count the number of characters in a line and if it's greater than a limit you set it can scan backwards for the last space and insert a line break in the source text. I might have a go at something like that later actually...