any container demos or does anyone have a good idea of how to start making containers that was stored in your players contents but have theyre own contents to hold things in?
ID:174247
Sep 8 2003, 10:32 pm
|
|
In response to Wanabe
|
|
yeah Ive got that demo its for container(s) in the world not within a mobs contents.
See this is what I got. I was gonna splain it lastnight but it was 4am and I was WAY too tired. I have an obj /obj/Containers it has all the base info for all container objs. This is basically a get() drop() and use() verb. use() says if you use the obj if its closed open it and if its open close it this is a bool set up in the obj this bool is then check in mob.stat() and if its open it adds a statpanel to display its contents in its own tab named after the container. Everything works perfectly up to this point theres not a care in the world. I have the players contents set up to not hold more than 12 things at a time this includes other containers. In my obj get() thats /obj/verb/get() the parent of all obj get()s it says if your contents is full then move it to a container if you have one if not say you cant carry anymore. Ok this works all fine and good too. Only problem you cause interact with anything inside the container. It still tries to get the obj even tho its in a container cause its not in YOUR contents its in some objs contents within your contents. And thats where Im stuck. I cant figure out how to get around this problem and I tried various things for about 5 hours lastnight til I was finally too tired to think straight. At which point I removed all mention of containers in any verb or proc so it functions like it did before I started messin with containers. Now incase I lost anyone that just might happen to read this what Im tryin to do is this: Every obj in the world can be interacted with with double click. If its in the world then it tries to get it and add it to your contents if its in your contents it tries to use it. The way it was working lastnight was it was still tryin to get the obj even tho it was in some contents JUST because it wasnt in YOUR contents. So how can I fix this? So far Ive tried var/obj/Containers/C for (C in usr) if (src in C) useIt(src) //Calls my useit proc which inturn does the use() verb for src This doesnt work. I can throw all my code thats invovled in here if it would help but I think I splained it pretty good. |
http://developer.byond.com/hub/Super16/ItemStorage