ID:1931240
 
(See the best response by Super Saiyan X.)
Code:
ob/proc
Gatherbuilds()
for(var/A in buildables)
contents+=A

obj/buildable
ash
icon='Ash1.dmi'


_2
icon='Ash2.dmi'
_3
icon='Ash3.dmi'

mob/Login()

var/logString = "<B>[time2text(world.realtime)]</B>: <BR>"
src.onlogin=1
src.One()
src.CheckStats()
src.Gatherbuilds()

    statpanel("Building")
for(var/obj/buildable/A in contents)
stat(A)

Problem description:

Am i missing something?

I am trying to basically call all the objs under /obj/buildables to appear into a statpanel tab.

Everything I've tried so far has been giving me a blank/empty tab, or would appear as just saying buildable instead of showing the actual objects in buildables.

mob*
statpanel()/stat() should be in the Stat() proc.

mob
Stat()
statpanel("Building",buildables)


No reason to add buildables to the contents. No reason to loop through anything. Just keep them in their own list.
Sadly that does nothing for me "/

Instead it shows this:


& this is the code:

mob/var/list/buildables = list(/obj/buildable/ash)
That's the expected behavior.

What's wrong?

To actually show the actual objects, you would need to create them. If you have a list of paths, it would only show a list of paths.
I know has me thinking I'm crazy.

I tried removing mob from var/list, but that just made the building tab empty again.

I'm just having the hardest time trying to get buildable objects into a statpanel tab >.<
They are created :


        
obj/buildable
ash
icon='Ash1.dmi'


_2
icon='Ash2.dmi'
_3
icon='Ash3.dmi'
In response to HaxRp
There is a difference between /obj/buildable/ash and new /obj/buildable/ash. The first is an object prototype (recipe), and the second is an object instance (product).

You can change that list() to either newlist(/obj/buildable/ash) or list(new /obj/buildable/ash).
Aaha thank s alot, but is there anyway I can make it show every obj under /obj/buildable instead of having to waste time and put them all in one by one?

so far I have

mob/var/list/buildables = list(new /obj/buildable/ash) // it shows a tab with just the ash obj, which means it works so thanks.

//But is there a way to gather all of the sub-objcs underneath buildables?


obj/buildable
ash
icon='Ash1.dmi'


_2
icon='Ash2.dmi'
_3
icon='Ash3.dmi'
You can loop through all types of /obj/buildable, create them, and add them to a buildables list at runtime. (be sure to do this only once per world)
Explain in code please
list var buildables
during a new world
call parent proc
buildables equals new
for x in typesof parenthesis parent type of all buildable objects parenthesis minus parent type of all buildables
buildables plus equals new x
I don't think that works out for me .
Why not?
Not sure,

mob/Login()

var/logString = "<B>[time2text(world.realtime)]</B>: <BR>"
src.onlogin=1
src.One()
src.CheckStats()
for(var/x in typesof(new /obj/buildable))
buildables+=x
Well, that's not what I said to do.

Login is called once per connection of a client to a mob, not once per world.
Typesof takes a type path, not an object.
mob/var/list/buildables



mob/proc
Gatherbuilds()
for(var/x in typesof(new /obj/buildable) - /obj/buildable)
buildables+=x


Thats all i understood from your explanation and that still doesn't work, now shows a blank tab.

Idk which proc you're referring to when you mean "per world". So i just put that same proc at login.
Best response
world/New() is called once per world. Just once. You can guarantee this because world/New is called when the world is created, you see.

Once again, "new /obj/buildable" refers to an object. You want just a type path.

You do NOT want this list to be created for every user every time they log in. That would kill your environment pretty fast.

So, something like this, which you should have been able to figure out on your own from plain English a bit of research in the BYOND Reference:
world
New()
..()
Gatherbuilds()

var
list
buildables

proc
Gatherbuilds()
buildables = new
for(var/x in typesof(/obj/buildable)-/obj/buildable)
buildables += new x

obj
buildable
test
thing
wow

mob
Stat()
statpanel("Building",buildables)