ID:158261
 
If I wanted to let someone use a custom icon, and did something like this: (pseudocode)

mob/verb
change_icon(f as icon)
var/x=input(src,"pick an iconstate") in iconstates(f)
icon=f
icon_state=x


Would there be any way to record the name of their icon file? I want to save it for later usage (I am not currently using a savefile based system).
When you embed any kind of file reference in text, you typically get back the filename. Actually, what you get is the full relative path to the file from the project folder (or when that file is outside that folder, you get the absolute path). If there is no path to the file (e.g. it's a cache file) or when a file is directly in the project folder then the relative path is equal to the filename, you get the bare filename.
var/F = file reference
var/filename = "[F]"
mob/verb/get_filename(F as file)
src << "Filename is [F]"
In response to Kaioken
Ah, suprisingly enough, I hadn't thought of that, thanks!
My closest guess was:
var/f = file ref
var/otherf='[f]'