var/list/q = list(icon_states(src.armor.icon))
if(q.Find("q"))//It's in there
world << "Q"//Returns nothing
Of course, the obj that armor is set to exists. And the icon_state is there, yet it returns nothing...please help me.
Thanks for reading.
ID:268947
Jan 1 2005, 11:00 pm
|
|
var/list/q = list(icon_states(src.armor.icon)) Of course, the obj that armor is set to exists. And the icon_state is there, yet it returns nothing...please help me. Thanks for reading. |
In response to Hiddeknight
|
|
No...it doesn't find the icon_state...so I'm using it wrong somewhere.
|
In response to DeathAwaitsU
|
|
mob/var/equipment/armor
(Note: Equipment is an obj typepath) |
In response to Hell Ramen
|
|
Ok I just tried it on my own and this seems to work if the icon has the icon state:
mob/var/obj/armor/P |
The only reason that that wouldn't work is if src.armor doesn't exist or that its icon is null. Try this:
var/list/q = list(icon_states(src.armor.icon)) |
In response to Wizkidd0123
|
|
It returns the icon...yet, it doesn't do anything...
|
icon_states() returns a list. When you declare q, you're put that list inside another list. =)
var/list/q = list(icon_states(src.armor.icon)) |
In response to YMIHere
|
|
Thanks YMIhere. :)
|
In response to DeathAwaitsU
|
|
This works because you create an empty list, then add the other list to it. With BYOND's += operator handling lists being added to other list differently than objects being added to lists, you end up with an exact copy of what icon_states() returns. =)
|
In response to YMIHere
|
|
So is there anything wrong with the way I did it(minus the extra lines of coding)?
|
In response to DeathAwaitsU
|
|
DeathAwaitsU wrote:
So is there anything wrong with the way I did it(minus the extra lines of coding)? I don't think so...but I didn't try it. You were sending a list to a non-list. |
In response to DeathAwaitsU
|
|
Correct, I was just pointing out why yours worked and his didn't. =)
|
and you also need for it to have [] around it,[q].
var/list/q = list(icon_states(src.armor.icon))
if(q.Find("q"))//It's in there
world << "[q]"//Returns nothing