mob
proc
AddText(var/text,mob/M)
var/leftspot=round((length(text)/2)*-3.65)
for(var/i=1,i<=length(text),i++)
var/obj/Text
Text.icon_state="[copytext(text,i,i+1)]"
var/icon/N = new(Text.icon,Text.icon_state)
N.layer=10000
var/r=0
var/g=0
var/b=0
switch(M.Village)
if("Leaf")
r=0
g=238
b=0
if("Rock")
r=133
g=94
b=66
if("Cloud")
r=255
g=215
b=0
if("Mist")
r=198
g=226
b=255
if("Sand")
r=235
g=199
b=158
if("Rain")
r=0
g=150
b=150
if("Grass")
r=0
g=225
b=0
if("Dark")
r=0
g=0
b=0
if("Sun")
r=253
g=208
b=104
if("Moon")
r=159
g=217
b=229
if("Thunder")
r=208
g=255
b=77
if("Waterfall")
r=77
g=214
b=255
if("Sound")
r=213
g=246
b=255
if("Star")
r=156
g=0
b=178
if("Snow")
r=255
g=255
b=255
else
r=0
g=0
b=0
N.Blend(rgb(r,g,b))
N.pixel_x=leftspot
src.overlays+=N
leftspot+=8
obj
Text
icon='Arial7pt.dmi'
icon_state=""
layer=MOB_LAYER+99999999999
pixel_y=-32
Problem description:
Ok..so basically. I'm trying to make something that displays text under mobs. I made it work, but I decided to make it seperate colors for certain Villages, so I did "switch(M.Village) if("Leaf") etc...", but after all that I didn't know how to like.. Blend the new color into the text, anyone know how I can make this work?
By the way,
I'm new at this don't laugh if my post sucks D:
runtime error: type mismatch: Text (/obj/Text) += "#00ee00"
proc name: AddText (/mob/proc/AddText)
source file: TextStuff.dm,83
usr: Yusuke11 (/mob)
src: Yusuke11 (/mob)
call stack:
Yusuke11 (/mob): AddText("Yusuke11", Yusuke11 (/mob))
Yusuke11 (/mob): Name()
I don't think I did anything wrong.