ID:156598
 
Hi, I need to know a way to make a game that looks like ace attorney (with text appearing one letter at a time with beep sounds after each letter) without the tedious "

" method shown below. The method shown below not only is tedious but also does not work for fast scrolling messages like "Phoenix: Wait a secon-" where it has 1 second of message time before the judge slams his gavel.

mob/proc
Turnabout1()
usr << "<h3>T"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>i"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>m"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>e"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>:"
usr << sound('Talk Printer.wav')
sleep(1)
usr << 'space.gif'
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<b>?"
usr << sound('Talk Printer.wav')
sleep(3)
usr << "<h3>L"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>o"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>c"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>a"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>t"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>i"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>o"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>n"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>:"
usr << sound('Talk Printer.wav')
sleep(1)
usr << 'space.gif'
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<b>?"
usr << sound('Talk Printer.wav')
alert(" ")
usr << sound('Select.wav')
usr << sound('101 Gyakuten Kenji - Prologue.ogg')
usr << "???:"
usr << "<h3>I"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>a"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>m"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>a"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>p"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>r"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>o"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>g"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>i"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>d"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>y"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>a"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>m"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>o"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>n"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>g"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>p"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>r"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>o"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>s"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>e"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>c"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>u"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>t"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>o"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>r"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>s"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<b>."
usr << sound('Talk Boy.wav')
sleep(3)
sleep(3)
usr << "<h3>A"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>g"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>u"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>i"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>l"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>t"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>y"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>v"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>e"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>r"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>d"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>i"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>c"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>t"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>i"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>s"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>a"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>l"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>l"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>I"
usr << sound('Talk Boy.wav')
sleep(2)
usr << 'space.gif'
sleep(2)
usr << "<h3>s"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>e"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>e"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<h3>k"
usr << sound('Talk Boy.wav')
sleep(2)
usr << "<b>."
usr << sound('Talk Boy.wav')
sleep(3)
sleep(3)
somethinglike this would work:

proc
typetext(ref, text, increment=1)
for(var/i=1, i<=length(text), i+=icrement)
ref<<copytext(text, i, i+increment)+"\..."
ref<<""//so it doesn't mess up :p
In response to Masschaos100
Masschaos100 wrote:
somethinglike this would work:

> proc
> typetext(ref, text, increment=1)
> for(var/i=1, i<=length(text), i+=icrement)
> ref<<copytext(text, i, i+increment)+"\..."
> ref<<""//so it doesn't mess up :p
>

So basically you are saying to place this to "replace" my example proc, or are you saying that is a proc I should include so when I do " src << "blah blah" " it shows up one letter at a time?
In response to Masschaos100
Masschaos100 wrote:
somethinglike this would work:

> proc
> typetext(ref, text, increment=1)
> for(var/i=1, i<=length(text), i+=icrement)
> ref<<copytext(text, i, i+increment)+"\..."
> ref<<""//so it doesn't mess up :p
>

I tried putting that in. It did make the text appear, but it did not make it show up one letter at a time. Plus it made the server slightly slower. What I put in is below. Feel free to correct any errors.
proc
typetext(ref, text, increment=1)
for(var/i=1, i<=length(text), i+=increment)
ref<<copytext(text, i, i+increment)+"\..."
ref<<""//so it doesn't mess up :p
mob/proc
Turnabout1()
typetext(src,"Time ??? Location ???",1)
usr << "<h3>T"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>i"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>m"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>e"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>:"
usr << sound('Talk Printer.wav')
sleep(1)
usr << 'space.gif'
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<b>?"
usr << sound('Talk Printer.wav')
sleep(3)
usr << "<h3>L"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>o"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>c"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>a"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>t"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>i"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>o"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>n"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>:"
usr << sound('Talk Printer.wav')
sleep(1)
usr << 'space.gif'
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<h3>?"
usr << sound('Talk Printer.wav')
sleep(1)
usr << "<b>?"
usr << sound('Talk Printer.wav')
alert(" ")
usr << sound('Select.wav')
In response to Narutorox123456
well first, this was suppose to replace your example :P, and could you tell me the error your getting O.o?
In response to Narutorox123456
yea new proc for the text thing

proc
Typetext(ref, text, increment)
for(var/i=1, i<=length(text), i+=increment)
ref<<copytext(text, i, i+increment)+"\..."
sleep(1)
ref<<""


and im not sure whats making it slow...maybe its because your constantly using that sound?
In response to Masschaos100
Masschaos100 wrote:
yea new proc for the text thing

> proc
> Typetext(ref, text, increment)
> for(var/i=1, i<=length(text), i+=increment)
> ref<<copytext(text, i, i+increment)+"\..."
> sleep(1)
> ref<<""
>

and im not sure whats making it slow...maybe its because your constantly using that sound?

No. It was much faster before I added the stirng of code.
In response to Masschaos100
Masschaos100 wrote:
well first, this was suppose to replace your example :P, and could you tell me the error your getting O.o?

The error I am getting is:
I am expecting it to post one letter at a time without using H3 AKA a tedious
src << "Phoenix:"
src << "<h3>H"
src << sound('Talk Boy.wav')
sleep(1)
src << "<h3>i"
src << sound('Talk Boy.wav')
sleep(1)
src << "<b>!"
src << sound('Talk Boy.wav')
and having something less time consuming/less copy/paste method that takes up too much code space.
The string of code does not do that. I typed in my message:
typetext(src,"Time ??? Location ???",1)
and it shows that whole string of text in one second as if I just put
src << "Time ??? Location ???"
and not that H3 compound that I want to have replaced with a less tedious and less space consuming method with the same effect.
In response to Narutorox123456
if you want it to type faster change the increments O-O
In response to Masschaos100
Masschaos100 wrote:
if you want it to type faster change the increments O-O

That's not what I mean. I am saying it is typing too fast. Meaning it all shows in one second. What value do I need to put the increment to, just to make it go slower? I also get a lag spike when I put it in my example and then displays the whole message at once.
In response to Narutorox123456
You would want the increment to be 1 so it does one letter at a time. What you want to do is increase sleep(1), which is 1/10th of a second (assuming you didn't change the world's tick value).

The whole lag & display issue sounds like there was no sleep() in your procedure.

Edit:
Let me comment that snippet for you, since I am in a nice mood (and I added in a delay argument):
proc
Typetext(ref, text, increment, delay=1)
/*
ref = who the text is going to
text = text you want to display
increment = # of letters to show at a time
delay = amount of time (in ticks) you want the letter to appear
*/

for(var/i=1, i<=length(text), i+=increment)
ref<<copytext(text, i, i+increment)+"\..." // This displays the letter at a time. If you want h3, to "<h3>[copy...]</h3>\..."
// If you want a typing sound, here is the spot to put it
sleep(delay)
ref<<""
In response to GhostAnime
GhostAnime wrote:
You would want the increment to be 1 so it does one letter at a time. What you want to do is increase sleep(1), which is 1/10th of a second (assuming you didn't change the world's tick value).

The whole lag & display issue sounds like there was no sleep() in your procedure.

Edit:
Let me comment that snippet for you, since I am in a nice mood (and I added in a delay argument):
proc
> Typetext(ref, text, increment, delay=1)
> /*
> ref = who the text is going to
> text = text you want to display
> increment = # of letters to show at a time
> delay = amount of time (in ticks) you want the letter to appear
> */

> for(var/i=1, i<=length(text), i+=increment)
> ref<<copytext(text, i, i+increment)+"\..." // This displays the letter at a time. If you want h3, to "<h3>[copy...]</h3>\..."
> // If you want a typing sound, here is the spot to put it
> sleep(delay)
> ref<<""

Ok I am going to test it.

Edit:
I tested it and it works fine! Thank you for your help!
Oh.
<font size=2>My.</font>
<Font size=3>GOD.</font>

Seriously, loops. Just... just loops.