The following code won't compile.
#define ICON_FILE "something.dmi"
var/icon/I = '[ICON_FILE]'
[edit]
I just realized that I could put the ''s in the #define statement instead and it would work. Are there any other ways of doing this?
[/edit]
ID:170076
Mar 23 2005, 4:00 pm
|
|
Is there any way to have a #define'd filename copied into the resource file at compile time?
The following code won't compile. #define ICON_FILE "something.dmi" [edit] I just realized that I could put the ''s in the #define statement instead and it would work. Are there any other ways of doing this? [/edit] |
Why not just do..
mob/icon = 'Whatever.dmi' Then everything thats a mob will have that icon. |
In response to Flame Sage
|
|
mob/icon = 'Whatever.dmi' Then general reason for using a #define is that you are planning on using it in several places. That way if you need to change it you only need to change it once. The object oriented route only works if all the items share a common parent. Plus with a #define you can throw it in some easily accessable place with other constants so you don't have to dig through code to change it. |
You just can't have any #defines directly in a string literal.