ID:156985
Jun 19 2010, 11:11 am
|
|
What is the best way to let text be typed out one letter at a time and have it consider spaces and other punctuation? Would it be better in DM or HTML? Thanks in advance.
|
Jun 19 2010, 12:19 pm
|
|
Can you extrapolate?
|
In response to Darkjohn66
|
|
I'm not sure how much more I can generalize this. I'd like to know the best way to output text one character at a time.
|
In response to DisturbedSixx
|
|
I am sure you can do something similar with HTML with javascript) or even flash.... but for DM:
proc/output_slow_text(ref, txt) // let it be a mob or a list of people, all the same Edit: Can't remember if it was \...[] or []\..., the \... suppresses the new line, so the text are still together. |
In response to GhostAnime
|
|
It works great thanks but I do have a couple questions. Even when I set sleep(1), it's still a bit too slow for me. Is there a way to make it faster? And also, it seems like it gives very little distance between words. Less then it would normally. Is there a way to fix that?
|
In response to DisturbedSixx
|
|
To add to Ghost's example, if you want it to move faster, simply "step". =)
proc/output_slow_text(ref, txt) // let it be a mob or a list of people, all the same On the loop I added a "step 2" which means that i will count upwards of 2 instead of one. Change the copytext from i+1 to i+2 and we're in business. You'll see that's much faster. If you want it even faster, step by 3 and change the copytext to + 3, etc. I also added ref << "" to fix up an oversight Ghost made, that being the next thing outputted to that output control would be on the same line as the last thing. And the spaces between words are fine. Append ref << txt to the end of the proc to check for yourself. ;) |
In response to Tiberath
|
|
Thanks a bunch to both you and Ghost.
|
DisturbedSixx wrote:
Would it be better in DM or HTML? I guess that it would define as what you consider better. Both alternatives offer benefits and disadvantages alike. In order to further illustrate I took the liberty to compile a little (quick and dirty) sample. var/const/SlowText = {" The HTML output is client sided and comes with all the benefits of that concept. There is no delay due to high ping (be it server, or network lag), there is no additional stress on the server and you're independent of tick_lag (which means that you can choose the delay in iterations of next to 20 ms and don't have to display 5 letters each 100 ms to simulate the same effect, without editing how fast everything else in your world is being executed). The 'DM' output is a lot easier to generate and can be used on all BYOND based outputs. |
In response to Schnitzelnagler
|
|
Thanks for showing both sides and their benefits. I'll consider using both and see which one works the best. Thanks.
|