ID:157877
 
I am learning DML, and i use this code:
turf
grass
icon = "grass.dmi"

I use this code to give a icon to the grass, and draw it on the map, but when i compile, system draw a error:

Lessons.dm:3:error: "grass.dmi": bad file

But i have the icon grass.dmi... help me Please??
Compare your code snippet to whatever it is you're using to learn. atom.icon takes a file, not a text string.

Thus, it would be either
icon = 'grass.dmi' // The file has to exist at compile-time

or
icon = file("grass.dmi") // The file has to exist at run-time
In response to Schnitzelnagler
thanks, i solve my problem...
i just change "icon.dmi" for 'icon.dmi'
In response to Twinsen99
Basically what he is saying is that if you have '' it will load up the first blank icon in that folder. But, if you wanted to load a certain file (say you had two grass files)
you would use:

turf
icon = 'grass.dmi'
icon_state = "grass2"
In response to Darkjohn66
Actually, if I recall correctly, "file" searches for the said file name in the game directory location (when the game runs) where as 'file' caches the file into the RSC