ID:262396
 
In DM, this doesn't work. It merits no compiler errors, it just doesn't change the color. But it's only on turfs, doing this for a mob or obj would work perfectly fine.

turf/grass
var/bgcolor="#00a500"
New()
..()
text="<font bgcolor=[bgcolor]> "


Prodigal Squirrel



Works fine for me, are you sure they aren't just covered up by an /obj's background color? =)
In response to YMIHere
The verb I'm using is changing the text of the square underneath the mob. The mob uses no bgcolor, however. Could that be what is messing things up?

Also, the proc the verb is using will work on any mobs or objects, but not just any turf. I simplified my question because my original post addressing this dilema was a little lengthy. If you would like to read the original post with the proc that's messing up, read this post.

One last thing, I have the following code in my game:

atom
var
ColorObj/color //Each ColorObj contains values for red, green, blue, and a hex version
ColorObj/bgcolor
char=" " //Default char will be blank
New()
..()
text="<font bgcolor=[bgcolor.hex] color=[color.hex]>[char]"


I had to type that out (not at home), so it's a little simplified. under New() is some checking if color and/or bgcolor exist, then it sets the text based on what does and doesn't exist. I would think that work to fill out the text var for a turf.

Prodigal Squirrel
In response to Prodigal Squirrel
If the mob doesn't use a bgcolor then it will be transparent, so unless there's another atom above the turf that's not the problem. The only other thing I can think of is that the ColorObj's hex variable doesn't contain a # (or one isn't put into the mix when setting the text variable).
In response to YMIHere
proc/SetRGB(var/red,var/green,var/blue)
r=red;b=blue;g=green
hex=rgb(r,g,b)


That's the proc that sets the ColorObj's hex variable. rgb returns a string in hex color format.

Prodigal Squirrel
In response to Prodigal Squirrel
It doesn't put the # before it.
In response to Hell Ramen
Yes it does. Check it.

Prodigal Squirrel