ID:1437242
 
(See the best response by Ss4toby.)
Code:
var/Level1=copytext(num2text(Y.Level),1,2)//This'll output something like 5.
var/Level2=copytext(num2text(Y.Level),2)
var/LV=file("[Level1].png")//Refer to 5.png
var/LV2=file("[Level2].png")
winset(src,"Map.Level1","image=['[LV]']")//Set 5.png as the image file on label.
winset(src,"Map.Level2","image=['[LV2]']")


Problem description:

Unable to set variables inside square brackets, and I'm not sure how else to approach the situation.

Best response
Umm..

mob/verb/Change_Label(i as icon)
winset(src,"default.label1","image=[i];")


The above works fine, so as long as your file finding system works, then this should.
var/Level1=copytext(num2text(Y.Level),1,2)//This'll output something like 5.
var/Level2=copytext(num2text(Y.Level),2)
var/LV=file("[Level1].png")//Refer to 5.png
var/LV2=file("[Level2].png")
winset(src,"Map.Level1","image=[LV];")//Set 5.png as the image file on label.
winset(src,"Map.Level2","image=[LV2];")
I suppose I should explain what you did wrong.

' is used to access a file that is inside the source. Therefore, as a heads up, unless your system sends the files your calling with the host files, then it won't work for people without the source because the image files will not exist.

A solution to this, is to somehow force the image into the rsc file. You can do this by adding them a list using ' so they compile.
Thanks a bunch, works like a charm.
Well crap, I just realized I was wrong..

Either you need to send an image file with your host files (which is risky because then the host could alter them), or convert your system. I can't really tell how your system is suppose to work, so I'm having trouble offering a good solution.

Basicly, something like this will work on other machines.
var/list/IMGs=list('IMG.png','IMG2.png')

mob/verb/LabelSet()
winset(src,"Map.Level2","image=[IMGs[1]];")
That's exactly what I did to include them into the .rsc. Thanks a ton though!