Which is easier? (stacked items in limited containers)
mrangel
03 Oct 2017, 10:31I'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
- Enable the "Inventory limits" feature.
- Add to the start script:
foreach (box, FilterByType(AllObjects(), "limited_container")) {
box.addscript => {
// my modified version of the one from CoreTypes.aslx
}
}
Method 2
- Don't enable limited containers.
- Put the limit-checking in a couple of functions.
- Call those functions from the put/drop/take commands.
- 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?
mrangel
03 Oct 2017, 11:05Edit: 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.

Amochure
04 Oct 2017, 01:45I think I speak for everyone when I say thank you for the helpful update, mrangel!