ID:139476
 
Code:
/obj/computer
icon = 'computer.dmi'
density = 1

var/list/active_users = list()
var/state = 0
var/obj/folder/rootfolder

New()
icon_state = "off"
rootfolder = new /obj/folder(src)
world << "[rootfolder]" //this is not printing...


/obj/folder
var/obj/folder/parent
var/obj/folder/items[]


Problem description:
Basically the problem is that the newly created folder is not being assigned to the rootfolder variable. Why?
You're not calling ..() in New(), so the parent isn't actually created so the folder has nowhere to be created. Try throwing ..() at the top of the New() call.
In response to Nadrew
I tried that but the code beneath the ..() was not executed. The icon_state wasn't even assigned.
In response to Lcooper
Then probably you are missing ..() somewhere else.
In response to Ripiz
Nope, every proc I've overridden includes it.
In response to Lcooper
Hard to say, can't see everything, but you could do something like this:
/obj/computer
icon = 'computer.dmi'
density = 1
icon_state = "off"

var/list/active_users = list()
var/state = 0
var/obj/folder/rootfolder = new /obj/folder(src)
In response to Ripiz
I changed my code to:
/obj/computer
icon = 'computer.dmi'
density = 1
icon_state = "off"

var/list/active_users = list()
var/state = 0
var/obj/folder/rootfolder = new /obj/folder()

verb/view_root()
set src in oview(1)
world << src.rootfolder

/obj/folder
var/obj/folder/parent

When I run the view_root() proc it gives this runtime error:
runtime error: bad output value
proc name: view root (/obj/computer/verb/view_root)
usr: Lcooper (/mob/human)
src: the computer (/obj/computer)
call stack:
the computer (/obj/computer): view root()
In response to Lcooper
Change
world << src.rootfolder
to
world << "[src.rootfolder]"

In response to Nielz
Whats the difference?
In response to Lcooper
One is an object reference and the other, text