ID:155062
 
Hi,

Ive seen once in a game you would get a verb at a certain lvl wich you could change your name into some fancy html name. Can someone help me out how to make this??

Thank you in advance ;)

Chaokai
When printing out the name, you basically put a <font> tag around each individual letter. To do this you have to get the length of the name, and then have some kind of proc to help you blend the colors.

The following code will produce the HTML for a name with colors going from color1 to color2, using my IconProcs library.

proc/ColorBlendName(name, color1, color2)
if(!istext(name)) name = "[name]"

var/len = length(name)
if(len <= 1)
// This special check avoids a divide by zero below
return "<font color=[color1]>[name]</font>"

. = ""
for(var/i=1, i<=len, ++i)
var/blended = BlendRGBasHSV(color1, color2, (i-1)/(len-1))
. += "<font color=[blended]>[copytext(name, i, i+1)]</font>"
Make a proc, inside the proc, check if the src's level is 10, if so, add to the src's verbs list, the change name verb or whatever you named it. If the src is not level 10, just return it.

For the name change verb, I suggest you to look at the input() proc.

Also, use the proc you made to check the src's level in the Levelcheck proc or whatever you called the proc to check if the src's levels up or not.

That should be enough to help you out.