ID:2544090
 
(See the best response by Nadrew.)
Code used to pull and store icon
            var/F = input("Please select an icon file.","Choose a *.dmi") as null|icon
if(!F) return
usr.memory_cback = icon(F)


string being used to display icon
usr << {"<IMG SRC=\ref[memory_cback] ICONSTATE="" ICONDIR=NORTH>"}


When I try to display this icon, I get no image result. Does anyone know what I'm doing wrong here? I'm uploading an icon file, storing it as a var on the player

icon/memory_cback

and then trying to display the north dir of the state in the output line. But I get an empty result.
Take a look at the browse_rsc() proc.
In response to Nadrew
Nadrew wrote:
Take a look at the browse_rsc() proc.

I'm trying to display this in chat output, not the browser window.
Best response
Try just using the \icon text macro itself.
In response to Nadrew
Nadrew wrote:
Try just using the \icon text macro itself.

So...

usr << {"\icon[usr.memory_cback]"}

This does show the icon in chat, but it shows the south DIR and I need it to show the north DIR.


I've been doing a lot of testing on this and I have the following...

            var/F = input("Please select an icon file.","Choose a *.dmi") as null|icon
if(!F) return
usr.memory_cback = icon(F)
usr << "Custom Card Back Set!"

var/test_string = {"[F]"}

var/icon/test_icon = icon(usr.memory_cback)


usr << browse_rsc(usr.memory_cback,"[test_string]")

usr << {"File Name - [test_string]"}

usr << {"1 - <IMG SRC=\ref[usr.memory_cback] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"2 - <IMG SRC=\ref[usr.memory_cback] ICONDIR=NORTH>"}
usr << {"3 - <IMG SRC=[usr.memory_cback] ICONSTATE="xx" ICONDIR=NORTH>"}
usr << {"4 - <IMG SRC=[usr.memory_cback] ICONDIR=NORTH>"}

usr << {"5 - <IMG SRC=\ref[test_icon] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"6 - <IMG SRC=\ref[test_icon] ICONDIR=NORTH>"}
usr << {"7 - <IMG SRC=[test_icon] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"8 - <IMG SRC=[test_icon] ICONDIR=NORTH>"}

usr << {"1b - <IMG SRC=\ref[icon(usr.memory_cback)] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"2b - <IMG SRC=\ref[icon(usr.memory_cback)] ICONDIR=NORTH>"}
usr << {"3b - <IMG SRC=[icon(usr.memory_cback)] ICONSTATE="xx" ICONDIR=NORTH>"}
usr << {"4b - <IMG SRC=[icon(usr.memory_cback)] ICONDIR=NORTH>"}

usr << {"5b - <IMG SRC=\ref[icon(test_icon)] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"6b - <IMG SRC=\ref[icon(test_icon)] ICONDIR=NORTH>"}
usr << {"7b - <IMG SRC=[icon(test_icon)] ICONSTATE="" ICONDIR=NORTH>"}
usr << {"8b - <IMG SRC=[icon(test_icon)] ICONDIR=NORTH>"}

usr << {"1x - <IMG CLASS=icon SRC=\ref[usr.memory_cback] ICONSTATE='' ICONDIR=NORTH>"}
usr << {"2x - <IMG CLASS=icon SRC=\ref[usr.memory_cback] ICONDIR=NORTH>"}
usr << {"3x - <IMG CLASS=icon SRC=\ref[test_icon] ICONSTATE='' ICONDIR=NORTH>"}
usr << {"4x - <IMG CLASS=icon SRC=\ref[test_icon] ICONDIR=NORTH>"}

usr << {"5x - \icon[usr.memory_cback]"}
usr << {"6x - \icon[test_icon]"}


All of these lines are giving me a blank output except for 5x and 6x.
Alright, so after playing around a bit more, I seem to only be able to display the icon if its assigned as the icon var of a mob or obj. If I just try to save it as an icon var, i can only display the south DIR using the \icon macro.

Can anyone find a way around this? I dont mind creating an obj to hold the icon but it seems clunky.