ID:178716
 
...an obj's icon_state using:

var/obj/ArmorType = /obj/Armor
ArmorType.icon_state = "Armor"

I get no errs when I compile, but when I try to change the Armor, it tells me it can't change ArmorType.icon_state...
Sabertooth wrote:
...an obj's icon_state using:

var/obj/ArmorType = /obj/Armor
ArmorType.icon_state = "Armor"

I get no errs when I compile, but when I try to change the Armor, it tells me it can't change ArmorType.icon_state...

You're getting confused between a type, and an object of a type. /obj/Armor is a type. It is not an object. If you want an object of type /obj/Armor, you have to use the new proc. Something like this:
var/obj/Armor/ArmorType = new
ArmorType.icon_state = "Armor"


Your code compiled fine because it is perfectly legal to set a variable to a type. But types aren't objects, so they don't have icon_states, and that's what gave the runtime error.
In response to Air Mapster
Dosen't work, instead of changing the Armor, it just vanishes! There's something I seem to forget :(
In response to Sabertooth
Take a look at your armor's icon file... make sure you've actually got an icon_state called "Armor", with a capital A. As far as I know, if you set an icon_state that doesn't exist, it does the only logical thing, and shows you nothing.
In response to Lesbian Assassin
Lesbian Assassin wrote:
Take a look at your armor's icon file... make sure you've actually got an icon_state called "Armor", with a capital A. As far as I know, if you set an icon_state that doesn't exist, it does the only logical thing, and shows you nothing.

Well to be honest, I may be wrong but if I am then go ahead and correct me ;)

I think that icon_state does take higher and lower sensitive cases of text. I typed in the following for a Ewer in my new project:

    Ewer
icon = 'DoodadsSet.dmi'
icon_state = "empty ewer"
Wei = 5


Then it didnt show my icon because it was in lower case letters as you can see in bold. The following fixed that problem:

    Ewer
icon = 'DoodadsSet.dmi'
icon_state = "Empty Ewer"
Wei = 5


As you can see in italics here the icon_state is in higher case letters now and my Ewer shows up in my tree and on my map correctly now. So if its just me then its me but I think that it is because that icon_state takes the letters case wise so he maybe having trouble with his cased letters as you showed it partially in your post Lexy ;)

Lee
In response to Lesbian Assassin
Actually, if BYOND can't find the icon state you assigned to it, it'll go to the default one, "". Assuming it exists, of course. If there isn't one of those, then I think it shows nothing.

-AbyssDragon