Which is easier? (stacked items in limited containers)

I'm trying to make a limited-container system that works with my stack objects and ^put (?<text>\d+\s+)?(?<object1>.+) (in|on) (?<object2>.+)$ command.

The existing limit system doesn't work neatly if an object is actually multiple objects. Fair enough. I can change the addscript to make it work as desired (put in as many items as will fit). But because of the eccentricities of the web editor, it's a bit of a pain adding attributes. So, before I get started, can I ask suggestions on what will be less effort in the long run?

Method 1

  1. Enable the "Inventory limits" feature.
  2. Add to the start script:
foreach (box, FilterByType(AllObjects(), "limited_container")) {
  box.addscript => {
    // my modified version of the one from CoreTypes.aslx
  }
}

Method 2

  1. Don't enable limited containers.
  2. Put the limit-checking in a couple of functions.
  3. Call those functions from the put/drop/take commands.
  4. Use initialisation scripts (bah) to set the limit and maxitem attributes of all the containers.

Method 3
Is there an easier option I'm missing?


Edit: I notice that the existing "limited containers" feature has more than a few crazy gotchas. It's looking like method 2 is more appropriate.

Among other things, it looks like you have to make sure every container is a "limited container"; because putting limited containers inside each other will check the limits of all of them, but putting things in an unlimited-volume bag doesn't check the limit of the box it's inside. Also, limited containers seem to count invisible objects, which I'd rather not do.


I think I speak for everyone when I say thank you for the helpful update, mrangel!


Log in to post a reply.

Support

Forums