|
complex Apprentice
Joined: 12 Apr 2004 Posts: 134 Location: USA
|
Posted: Wed Oct 13, 2004 1:30 am
Colored speach |
Just a quick one, either my brain is not working, or i have just not done anything like this. I simply want to take the first letter of anything is say and make it one color and make the rest anouther color
so if in game I said
Hello how is it goen?
i would want to make the first letter of each word and make them red, and the rest of them grey.
to make a letter red, you use {R, and to make a letter grey you use {D. also at the end of every sentance you need to use a {X to cancel the color string, so as not to bleed the color. |
|
_________________ <Clever text here> |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Oct 13, 2004 4:23 am |
#AL say {#VAR saystring {~{R%-1~{X};#LOOP %len( @saystring),1 {#IF (" " = %copy( @saystring, %i, 1)) {#VAR saystring {%insert( ~{R, %insert( ~{D, @saystring, %i + 2), %i + 1)}}};'@saystring}
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
complex Apprentice
Joined: 12 Apr 2004 Posts: 134 Location: USA
|
Posted: Wed Oct 13, 2004 8:24 pm |
Thanks lightbulb!
Only one thing, The first word of any sentance is all red, The rest of the words look fine. Any ideas? |
|
_________________ <Clever text here> |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Oct 14, 2004 1:37 am |
#AL say {#VAR saystring {~{R%-1~{X};#LOOP %len( @saystring),1 {#IF (" " = %copy( @saystring, %i, 1)) {#VAR saystring {%insert( ~{R, %insert( ~{D, @saystring, %i + 2), %i + 1)}}};#VAR saystring %insert( ~{D, @saystring, 4);'@saystring}
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|