Looking For Typing/Scrolling Effect For Messages

TextStories
I would like to know if there is a way in Quest to make the speech between characters scroll out slowly, like it does in RPGs usually. You do not see one huge block of text pop up, but the words one at a time in it's "bubble" or "box", sometimes slowly and sometimes in quick succession. Is there a way to mimic that effect? (The bubble or box is less important then the speed itself.) Also is there a way to take it a step further and also be able to press a button to make the rest of the text come out all at once, since some people like to speed up conversations more than others or depending how I set up my conversations, my NPCs may be repeating themselves quite often. If you still have no idea what I mean, think of reading over the shoulder of someone typing on a computer or even better a type writer. It is not agonizingly slow, but not bam in your face the entire text either. I want it to be smooth and maybe ways to adjust the speed if possible to my liking or other's suggestions. Thanks.

Silver
The only way I can think of with the UI is to run a timer to print each word which would both be a major programming headache and plus you're limited to doing things by seconds and not milliseconds.

Beyond that there's probably a way to do it with jquery.

http://jquery.com

HegemonKhan
here's some links:

--------

http://docs.textadventures.co.uk/quest/ ... riter.html (this is what you want)
http://docs.textadventures.co.uk/quest/ ... amble.html

I'm not sure where in the GUI~Editor that you find these 2 options... it might be under the 'Advanced' in the left side's tree of stuff, but I am not sure. Try also under 'add -> functions' and look for it... (you may need to: Filter -> Show Library Elements, too).

--------

http://docs.textadventures.co.uk/quest/ ... ttime.html (this is useful too)
http://docs.textadventures.co.uk/quest/ ... /wait.html

--------

for option to skip or not:

there's always the manual 'if' check (you have two messages: one quick and one slow~special) that you can do, or you can use an 'ask~tell:yes~no' Script too:

msg ("Do you want to skip~speed through message? (1) yes or (2) no")
get input {
if (result = "1") {
// fast message script, or skip message entirely
} else if (result = "2") {
// slow~special message script
}

-----------

other 'poor-man' methods:

use a Timer (Element)

use a X blank spaces between your words:

msg ("XXX          XXX                               XXX                                           XXX")


use X blank lines between your sentences:

msg ("XXXXXXXXXXXXXXXXXXXXXXXXXXXX")
msg ("")
msg ("XXXXXXXXXXXXXXXXXXXXXXXXXXXX")
msg ("")
msg ("")
msg ("XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

jaynabonne
HK has listed ways to do it, but they don't allow ways to bypass the dynamically slow text output (which would be a real drag for any great amount of text). You should be able to do it with some Javascript. Perhaps if I have time soon, I'll give it a shot. ;)

jaynabonne
Attached is a sample that overrides the Quest typewriter text to:

1) allow the text display to be interrupted, and
2) invoke a "TypewriterDone" function when done

The sample has some large text blocks which are invoked with "test". There are three blocks, and they are shown in order, with the last repeated indefinitely.

I doubt this is the setup you want, but the overall function in the "js" attribute is what you need. The start script shows how to inject it using JS.eval, and it replaces the built-in one. So you can call the TextFX_Typewriter function as you would normally.

One thing to keep in mind is that, since the text is output one character at a time, you cannot use any HTML style tags within it, as they don't work when only partially displayed. (This is a problem with the Quest typewriter function as well, and it's not a simple problem to solve.)

Let me know if you need any changes or assistance.

Avantar
This works much better; since the speed at least stay constant. :)

All of this is way above me and speaking of speed:
I know the text is called from attributes of 'game' and I understand the index increases by 1 everytime you type text.
Where will I change speed and perhaps a slight pause/delay before the next sentence that I think I am seeing.

Thank you for sharing!

Pertex
Avantar wrote:This works much better; since the speed at least stay constant. :)


The speed is constant? When testing Jays demo the text becomes slower and slower (if you do not move the mouse). Strange thing is that it works really fast when you move your mouse when Quest types some text. Any idea why this happens?

jaynabonne
That's really odd. I hadn't noticed the slowdown as I hadn't let it go that far. (I was too busy testing the ability to interrupt it.) What I just found is that if you set the timeout to 20 instead of 10, then it goes a little slower but doesn't slow down over the length of the text. It's possible that setting the timer to 10 is swamping the system. (I really have no idea, but something weird is going on.) And moving the mouse? I'm not sure why that has an effect either, unless the slow down is related to memory usage, or maybe events firing in the system ease the timer a bit.

jaynabonne
I did make one change: the JS had a ".each" that I don't understand and didn't seem to do anything. If you remove that, the code seems better. I don't know if it affected the slowdown, but I do know that that's the code that I was testing. To modify it, change the "<js>" tag to this:

    <js><![CDATA[

(function ($) {
var typewriter_interrupted = false;
window.onkeydown = function(e) {
typewriter_interrupted = true;
};
window.onmousedown = function(e) {
typewriter_interrupted = true;
};
$.fn.typewriter = function (speed) {
typewriter_interrupted = false;
var $ele = $(this), str = $ele.text(), progress = 0;
$ele.text('');
var timer = setInterval(function () {
$ele.text(str.substring(0, progress++) + '_');
if (typewriter_interrupted) {
$ele.text(str);
progress = str.length;
}
if (progress >= str.length) {
clearInterval(timer);
var completion = "TypewriterDone";
var args = completion.split(" ");
ASLEvent(args[0], args[1]);
}
}, speed);
return this;
};
})(jQuery);

]]></js>

Pertex
Unfortunately it doesn't solve the problem, still becomes slower and slower

Avantar
I played and replayed this and I am not experiencing the same.

I did get different speeds when testing but it stays constant:
The first time it played at reading speed for all paragraphs, but constant.
The last time I played it was considerably faster, but constant...mine does not go slower and slower - but I have different speeds it plays at sometimes.

jaynabonne
Pertex wrote:Unfortunately it doesn't solve the problem, still becomes slower and slower


Is that with the delay set to 20 as well? That's what made it consistent for me (more or less).

Pertex
On my PC it seems to work with a delay of 20. But no change if I test it on my laptop. It's even more strange: when moving the mouse while the text is displayed, the text becomes faster and faster. It seems to ignore the delay of 20

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

Support

Forums