Hi. I've spent a lot of time in the docs and maybe I just missed it, but I'd appreciate some help from the pros.
I have three objects, each with a 'status' variable:
obj
stones
red_stone
var/status=0
blue_stone
var/status=1
green_stone
var/status=0
How can I create two lists of these objects, one containing stones with status=0, one for status=1? The idea is I'd like to display both lists in a "stones" statpanel, as "active stones" and "inactive stones," but I can't figure out how to separate them in any streamlined way.
Thanks!
ID:178399
May 18 2002, 9:31 am
|
|
In response to Foomer
|
|
Thanks! Much more elegant-looking solution than what I was futzing around with, I'll give it a try.
|
<code>var/list/inactive = list() var/list/active = list() for(var/obj/stones/S in usr.contents) if(S.status == 1) active += S if(S.status == 0) inactive += S</code>
Then just show stats for the remianing 'active' and 'inactive' lists.