ID:167498
 
Any examples or tips I can get? I can create the verb but, am not sure how to affect text colour.
mob
var/colour
verb
Change_text_Colour(color as text)
// you could do a list but ill do it as text for you
src.colour = r


now for the say part

mob
verb
say(t as text)
world << "[src] : <font color = [src.colour]>[t]"
In response to A.T.H.K
Thanks, the only thing I need is what to do with the r. IT comes up as an undefinded var.

Nevermind, I seem to have gotten it! Thanks again!
In response to A.T.H.K
The list would probably be better, unless you want them to be able to enter their own RGB values as well. Still, you could at least check that it's a valid color.

mob
var/color = "black" // good idea to set a default too

verb/Text_color(TC as null|text)
if(!TC) return
if(findtext(TC,"#",1,2) || (TC in list("red","blue",etc...)))
// either they entered an RGB value starting with # or used a valid named color
color = TC
else
src << "Invalid color."


There's a list of named colors here.

And close your tags. If you don't close your tags, a seagull will get ya!
In response to Fuuhaa
Actually the one aboove works for what I need. Im using byond to make a chatroom that can host my D20 game. We only need the basic colours anyways.

I have all the verbs I would need to play the game but, im still working on making ym login announcement work.. I dont like procs much right now.

Thanks for the list verb though, ill put it somewhere incase I need it.
In response to Inutaisho
Inutaisho wrote:
Actually the one aboove works for what I need. Im using byond to make a chatroom that can host my D20 game. We only need the basic colours anyways.

Cool. What campaign setting if you don't mind my asking? Greyhawk/Forgotten Realms/Eberron/Other? It'd be great if there was a nice group on byond to play with.

I have all the verbs I would need to play the game but, im still working on making ym login announcement work.. I dont like procs much right now.

Verbs and procs are about 98% identical in concept. You can even use some procs as verbs in their own right. Once you get the basics down you'll find it's not so hard to create your own.

Thanks for the list verb though, ill put it somewhere incase I need it.

You're quite welcome.
It'd be better to get a list of HTML colours and hex associations and make them into a list on world/New(), then have the player choose.
For hex nums, you could just findtext(string,"#") after copytext()ing the first 7 characters.