I can help, if needed, as I have a game that does the text scrolling thing.
- A game attribute (list or text) to store text
- Another game attribute to store what position the text is currently in (X-axis), and another for what row of text it belongs in.
Basically, it stores text through a game attribute, and then draws the characters on screen from the start of the text, to the current character it has reached.
The NPCs can probably use a bool-based function to change the text every couple seconds (contact with an NPC could set a variable like "able to speak" to true), when that bool goes true, it increases character in text drawn, then sets to false, and then when it goes false, after a bit (maybe 0.16 seconds), it goes true and repeats.
But. If character in text drawn reaches the length of the text string, it stops the recursive code, and lets you talk to the NPC again.
Now, here's a snippet of code that tells the game how to lower the Y axis of drawn text: (note the censored bool was a test variable to see if it worked right)
This works that if the text has gotten too long, it saves the current location of character in text drawn, and uses that to continue another row of text to draw from the start of the saved location, to the character in text drawn, it simply just lowers the Y-position and keeps drawing more.
And note, I have a simple check to see if the text is going to run into blank space on the next row, it simply removes the space, and draws without it. Causing the line to not look misaligned compared to the one above. You could probably also use some sort of internal scripting to determine when the lines should move down manually, but that's out of my skill range for coding.