ID:169028
 
Quick question, how do you get text2path() to work? This won't work for me:

var/icon/I = icon(text2path("/icon/[T][a].png"))

Sure it compiles but fails at runtime. Or am I going about getting icon's filename to work according to variable all wrong?
DeathAwaitsU wrote:
Quick question, how do you get text2path() to work? This won't work for me:

var/icon/I = icon(text2path("/icon/[T][a].png"))

Sure it compiles but fails at runtime. Or am I going about getting icon's filename to work according to variable all wrong?

What are you trying to do here?

/icon/something.png

is not a proper object path, which what text2path() is about. If this is supposed to be a file on disk, that's a whole different kind of path...
text2path is for type paths. Like text2path("/mob/Player/[Class]"). I think icon() might accept icon('/icon/[T][A].png') though
In response to Deadron
Basically, I'm trying to loop through some files that follow a specific organization. So by editing the variable a and T accordingly, I need to refer to the actual file.

So my files may be:

Clown1.png
Clown2.png
Clown3.png

I need a way to refer to them as a variable.
In response to DeathAwaitsU
DeathAwaitsU wrote:
Basically, I'm trying to loop through some files that follow a specific organization. So by editing the variable a and T accordingly, I need to refer to the actual file.

So my files may be:

Clown1.png
Clown2.png
Clown3.png

I need a way to refer to them as a variable.

Then ignore text2path() and check out file().
In response to Deadron
This works too:
mob/verb/Test()
var/X = "Player"
icon = icon("[X].dmi","Monkey")