ID:225885
 
Keywords: file, list, text
(See the best response by DarkCampainger.)
Well i'm re-writing my whole demo system, i want to take out the list that holds the icon files, but seems like i can't do

var/icon/MyIcon = new('[MyPokemon.Pokenum]b.gif')


Any way to do this?
Best response
The icon has to be directly referenced somewhere, or else it won't be included in the RSC. At the moment, I don't believe there's any method to dynamically access an icon in the RSC. You can use file() to access a file on the system, but then you would have to include the actual .dmi files with your host files (and there will be a performance hit as they're loaded into the RSC and uploaded to players)

I made a feature request for dynamically accessing RSC entries a little while ago. I don't expect it to get implemented any time soon, though--there's a lot of other requests that are more useful.

<edit>
See Nadrew's comment below


<edit2>
Nevermind. Got my hopes up that I might be wrong...
You can use icon() to grab a dynamically-named file from the rsc, but the issue with having to reference the file with single-quotes for it to even be included in the rsc is still present. Unfortunately that's just how the compiler knows what to stick in the rsc file when it gets compiled.
In response to Nadrew
Nadrew wrote:
You can use icon() to grab a dynamically-named file from the rsc

For a second I was really hopeful that was right, cause it would be a great feature. However, upon testing it, it looks like it's actually just running file() on the text string, which means it has the same limitations I mentioned in my post (it looks for a file on the file system, not the RSC)
So mostly if i do something like this:

var/icon/MyIcon = new(file("[A]b.gif"));

File won't be included in rsc? Fu. ;_;
In response to Ocean King
It won't be included in the RSC, and it won't look for it in the RSC.
Oh, so nicely... ;_; Seems like i'll just have to keep the list. ._.