ID:148006
 
You open the chest, the chest opens, no object is created, Im calling new on the object, I cant figure out why its not creating a new object.

    Chest
icon = 'chest.dmi'
icon_state = "closed"
density = 1
var/list/enclosed_item = list()
var/list/access_item = list()
var/list/has_opened = list()
Chest1
enclosed_item = (new/obj/Items/Boomerang)
access_item = (new/obj/Access/Boomerang)
Chest2
enclosed_item = (new/obj/Items/Lantern)
access_item = (new/obj/Access/Lantern)
Chest3
enclosed_item = (new/obj/Items/Red_Tunic)
access_item = (new/obj/Access/Red_Tunic)
Chest4
enclosed_item = (new/obj/Items/Wood_Sword)
access_item = (new/obj/Access/Wood_Sword)
Chest5
enclosed_item = (new/obj/Items/Blue_Tunic)
access_item = (new/obj/Access/Blue_Tunic)
Chest6
enclosed_item = (new/obj/Items/Bow)
access_item = (new/obj/Access/Bow)
Sign
icon = 'turfs.dmi'
icon_state = "sign"
density = 1
mob
proc
Open(obj/Chest/C)
if(!C.has_opened.Find(src))
C.icon_state = "open"
src.frozen = 0
for(var/obj/B in C.enclosed_item)
B.loc = locate(src.x,src.y+1,src.z)
src << "You found a [B]!"
sleep(15)
for(var/obj/D in C.access_item)
D = new(src.acess)
C.icon_state = "closed"
C.has_opened += src
src.frozen = 1
del(B)
else
C.icon_state = "open"
src << "You open the chest and find it empty!"
sleep(10)
C.icon_state = "closed"
Read the reference about how new() works. It's in the format new Type(args).
In response to Jon88 (#1)
Eep, I never could figure out how they wanted that to work.
In response to Jotdaniel (#2)
Its not wanting to read the lists, not quite sure why. Heres the proc after a little edit:

    Chest
icon = 'chest.dmi'
icon_state = "closed"
density = 1
var/list/enclosed_item = list()
var/list/access_item = list()
var/list/has_opened = list()
Chest1
enclosed_item = (/obj/Items/Boomerang)
access_item = (/obj/Access/Boomerang)
Chest2
enclosed_item = (/obj/Items/Lantern)
access_item = (/obj/Access/Lantern)
Chest3
enclosed_item = (/obj/Items/Red_Tunic)
access_item = (/obj/Access/Red_Tunic)
Chest4
enclosed_item = (/obj/Items/Wood_Sword)
access_item = (/obj/Access/Wood_Sword)
Chest5
enclosed_item = (/obj/Items/Blue_Tunic)
access_item = (/obj/Access/Blue_Tunic)
Chest6
enclosed_item = (/obj/Items/Bow)
access_item = (/obj/Access/Bow)
Sign
icon = 'turfs.dmi'
icon_state = "sign"
density = 1
mob
proc
Open(obj/Chest/C)
if(!C.has_opened.Find(src))
C.icon_state = "open"
src.frozen = 0
C.enclosed_item = new
C.access_item = new
for(var/obj/B in C.enclosed_item)
var/obj/E = new(B)
E.loc = locate(src.x,src.y+1,src.z)
src << "You found a [B]!"
sleep(15)
for(var/obj/D in C.access_item)
D = new(src.acess)
C.icon_state = "closed"
C.has_opened += src
src.frozen = 1
del(B)
else
C.icon_state = "open"
src << "You open the chest and find it empty!"
sleep(10)
C.icon_state = "closed"
In response to Jotdaniel (#3)
For the open VERB, it should be:
obj/Chest/verb/Open()
set src in oview(1)
usr.Open(src)

It may be cause for the proc, you didnt define (/obj/Chest/C)
In response to JackGuy (#4)
You have NO idea what im doing here do you?
In response to Jotdaniel (#5)
Your proc is Open(/obj/Chest/C)
and you didnt show a verb, so i figured, you didnt make the verb clear with calling the proc. And YES i do know what ur doing, im actually a pretty good scripter. *heads back to help newbies in the newbie forums* Get help from someone else...
In response to JackGuy (#6)
I just looked in your script, and, here is my suggestion..
   Chest1
New()
src.enclosed_item.Add(/obj/Items/Boomerang)
src.access_item.Add(/obj/Access/Boomerang)
..()

You had nothing to give the chest the item, so, use the New() proc, to give the item to it
In response to JackGuy (#7)
I know, my freind did that, weve got it working. It should have worked the way I did it(ive done it that way with other things). The proc is called inside of the attack proc.
Savefiles arent saving lists. Ive got a list called src.chests, I add a chest to it when the user opens up a chest, but its not saving, heres my read and write procs:
mob/Write(savefile/F)
F << src.x
F << src.y
F << src.z
F << src.contents
F << src.acess
F << src.chests
..()
mob/Read(savefile/F)
var {saved_x; saved_y; saved_z}
F >> saved_x
F >> saved_y
F >> saved_z
F >> src.contents
F >> src.acess
F >> src.chests
..()
src.Move(locate(saved_x,saved_y,saved_z))