How would I go about making code-efficient, but usr-friendly (as in very quick to access with only 1 button press) containers for my world? I never quite understood how to do this, and being out of the loop for a while fried my BYOND lobe in my brain D:
Thanks for the pointers/suggestions!
ID:160768
Jul 24 2008, 6:11 pm
|
|
Jul 24 2008, 7:18 pm
|
|
Start here
|
In response to Jemai1
|
|
I'm not trying to come off as rude, but I've been with byond for 4 years. I wouldn't have made any progress without those tutorials.
However, I don't think I've ever seen a container code or suggestion in any of them, unless it's in a new one. Once again, not trying to sound rude, but give me just a slight bit more direction than that. Or a practical application of something I missed that could be used? |
Pakbaum wrote:
How would I go about making code-efficient, but usr-friendly (as in very quick to access with only 1 button press) containers for my world? I never quite understood how to do this, and being out of the loop for a while fried my BYOND lobe in my brain D: What on earth does "containers for [your] world" mean? If you mean universal programming conceptual containers such as stacks and queues, look up hub://UnknownPerson.upContainers. If you're referring to something else, you have to understand that you can't just make up a word for something and hope that everyone knows what you're talking about---details are vital. |
In response to Pakbaum
|
|
Well, I'm not trying to come off as rude either (and things tend to seem simpler after you know about them, I suppose), but this seems like quite a simple thing to do if you already know about DM (it's basically like programming a normal item Get() verb). For 'simple', see:
obj/container That's the basic gist of it. I'm not sure if you wanted something more specific or different (or not), though. If that wasn't the example/thing you were after, then ask for whatever it is (since you weren't very descriptive, I had to take a guess). =) |
In response to Kuraudo
|
|
...What? I never inclined that the containers in question were special or "for my world", just efficiently coded.
|
In response to Kaioken
|
|
No no, it's quite alright. The question was supposed to be somewhat vague anyways.
And I was thinking and remember any time I'd seen anything having to do with containers in the past, it was always list controlled. In all honesty, I didn't even think about obj's having -contents-. >< Anyways, thank you for your help. EDIT: Also, could you eleborate just a mite on the \icon bit you threw in there? I'd like to have just the icon for the items in question, if possible. |
In response to Pakbaum
|
|
Pakbaum wrote:
No no, it's quite alright. The question was supposed to be somewhat vague anyways. What Kuraudo said, correctly, is that you were not very elaborate or detailed in your question. The only clue you've given to what you want is a single word, but that is vague and one can possibly mean different things by it, to 'outsiders'. Even if the basic point is able to be conveyed by a single word (I actually took a guess this time), it is customary to detailedly describe exactly what it is that you want, so the readers can get a better idea. And I was thinking and remember any time I'd seen anything having to do with containers in the past, it was always list controlled. In all honesty, I didn't even think about obj's having -contents-. >< Looks like you should look that list up. ;) All atoms (Areas Turfs Objs Mobs, incidentally) have that list, including turfs and areas, yes. It is tied into the movement/locatopm system. When you are standing on a turf, your mob is in that turf's contents list. Also, mobs and objs aren't all that different. There are multiple differences, but not all that big, mainly extra vars like group,sight,client (of course, the client var is the largest difference - players can connect to mobs only). It is possible to use a custom /list for this kind of things (ie inventory or whatever), however the contents list is suitable already, and more importantly it's generally more robust to use and tied into the movement system. This means you can already have a system (the movement system) at your disposal - the previous code example could be expanded like this: obj/container/Entered(atom/A) //called when an atom enters our container obj/container/Enter(obj/item/O) //called when something attempts to enter our container, and is used to determine if it should be allowed to or not EDIT: Also, could you elaborate just a mite on the \icon bit you threw in there? I'd like to have just the icon for the items in question, if possible. Sure, but I'd like you to try to figure it out by using the documentation first, if possible. =P |