-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containers #115
Comments
If we end up switching to a specific |
Given an
We will also need versions that don't do anything to your inventory but simply describe a container with some entity inserted or removed, like |
Would it be okay to consider the container placed in the current cell available just like those in the inventory? 🤔 With If I have robots running around my future base storage, I do not want them to pick up boxes and then not return them. 😅 |
Hmm, I like that idea, though I'm not sure how exactly it would work in practice. Maybe it would be cleaner/less confusing to just have special commands for manipulating a container in the current cell? |
@byorgey why? We now have It would be harder for the player to understand and for us to maintain twice as many entity functions. |
I don't really like the idea of having two versions of every command either, but I haven't had any better ideas. The purpose of I'm very open to other ideas. |
Crazy idea: what if we make a function something like |
I assumed we would provide predicates for testing that a container contains something? Why would you compare hypothetical entities? |
I don't know, a box containing a tree was just a random example. Sure, we can have predicates for testing that a container contains something. But the bigger point is that you should be able to create |
Every entity is in theory capable of holding an inventory of other entities, but at the moment we only take advantage of this with robots themselves. However, the idea has always been to have other entities besides just robots that can contain other entities. As a first example the plan is to make a
box
capable of holding (possibly a limited number of) other entities. This will be useful for several reasons:give
command takes a single tick to execute, so it takes a while to give a bunch of entities one at a time. Using a box, you can instead put the items you want to give into a box (putting an item in a box will not take a tick), and then justgive
the box in one tick.So we need some commands for manipulating container entities; here's what I propose.
container
property, which governs entities that can contain other entities.insert : string -> string -> cmd ()
will insert the first entity into the second, throwing an exception if you don't have either one, or if the second entity is not a container.remove : string -> string -> cmd ()
is the converse. Note that the entity to be removed gets taken out of the container and placed in your inventory.unpack : string -> cmd ()
unpacks a container, rendering it empty and placing its entire contents in your inventory. This way you don't have to know in advance what you expect to get in the box.for : string -> (string -> cmd ()) -> cmd ()
.grabber
.The text was updated successfully, but these errors were encountered: