ID:264274
 
//village datum

village
var
name
icon/symbol
New(nm)
name=nm
symbol = icon('villages.dmi',"[src.name]")

//part of world chat verb

Players << "\icon[village.symbol]"

//players is a list (not saved) that contains all mobs currently logged in.

mob/var/village/village

//relate mobs with their village....


Why is the output to Players null ?

Starting to suspect datums can't have vars related to any kind of image. If it is, I'll find an alternative.
Andre-g1 wrote:
Starting to suspect datums can't have vars related to any kind of image.

Of course not. >_>
Read here: [link]
In response to Kaioken
If I use \ref, it returns a weird combination of "NUMxNUM". And I have no idea what to do with that >_>

[By the way, changed the village/var/icon/symbol to a mob/var/tmp/icon/symbol]
In response to Andre-g1
Ah, oops. That must only works with the interface control(s). I suppose using the internal icon.icon var with the \icon macro (or an <IMG> tag) will work, as it's an icon file as needed, but I'm not sure if this is the intended method. If not, you could always explicitly convert the /icon object to an icon file then use it as normal.
In response to Kaioken
Fixed, what I did was :

mob/var/tmp/icon/symbol // assign the var to each mob

//on the load proc

symbol = icon('village.dmi',"[village.name]") // update

// and when the player joins/leaves the village

symbol = icon('village.dmi',"[village.name]") // update


Then I used the \icon text macro and it worked perfectly.