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"
ID:148006
Aug 13 2003, 1:21 pm
|
|
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.
|
Aug 13 2003, 1:29 pm
|
|
Read the reference about how new() works. It's in the format new Type(args).
|
In response to Jon88
|
|
Eep, I never could figure out how they wanted that to work.
|
In response to Jotdaniel
|
|
Its not wanting to read the lists, not quite sure why. Heres the proc after a little edit:
Chest |
In response to Jotdaniel
|
|
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
|
|
You have NO idea what im doing here do you?
|
In response to Jotdaniel
|
|
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
|
|
I just looked in your script, and, here is my suggestion..
Chest1 You had nothing to give the chest the item, so, use the New() proc, to give the item to it |
In response to JackGuy
|
|
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) |