ID:171072
 
What I am trying to accomplish is to have a Change Icon verb that when you use it, the icon you pick to have it adds an icon_state to it named dead. I also want the dead icon_state to be just not colored, just like a state. Is this possbile? I would have tryed to accomplish this but I had no where to even start. Help is appreciated.
I don't understand...speak more clearly?
I don't think that's possible..., but then again I'm probably wrong but wouldn't that be interfering with someone else's file? Unless there's a way to add a temporary icon_state...
it is if you have the icon states already in the players icon file and then have a menu to choose from but not if they need to upload them i dont think
In response to Shadowdarke (#3)
Thanks shadow, but I dont think I am using it correctly, tell me if I am (If I am it doesnt work).


mob
verb
admin
admin_change_icon(icon/N as icon)
set category = "Admin"
if(src.alreadyjoined)
var/icon/I = new(N)
var/icon/J = new(N)
I.Insert(J, "dead")
src.icon = I
return



In response to XxDohxX (#5)
Well, you're using it right, but you aren't actually doing anything to the icon. Let's translate it to english so that you can understand why.

Here's our original code
mob
verb
admin
admin_change_icon(icon/N as icon)
set category = "Admin"
if(src.alreadyjoined)
var/icon/I = new(N)
var/icon/J = new(N)
I.Insert(J, "dead")
src.icon = I
return


So, the part we need to translate is:
var/icon/I=new(N)
var/icon/J=new(N)
I.Insert(J,"dead")


Now, as I'm sure you'll agree, when they're created, icon/I is equal to icon/J. The only difference, in fact, is the name. When you add I.Insert(J,"dead"), depending on whether icon/N already has an icon state called dead, you're doing one of two things: You're either making a new icon state called dead which looks exactly icon/I does when icon_state="", or, you're, in essence, deleting the existing "dead" state in icon/N. By "deleting", I mean, overwriting "dead" with an icon that looks exactly like icon/N does w/o a state.

Therefore, either way, you're still ending up with the same thing: an icon state of icon/I called "dead" which looks exactly like icon/I does when it has a null icon state.

In any case, since you aren't trying to create a dynamic icon of any sort, or to dynamically modify an icon, you shouldn't be using icon/Insert()