Container Entities: More inventory control
Posted: Wed Oct 07, 2015 2:24 pm
Similar ideas already mentioned here https://forums.factorio.com/forum/vie ... 772#p78772 by @Factoruser.
Currently container entities have a property that determines how many 'slots' the container has.
Proposed is that it is expanded in the following fashion:
= Use cases =
- slots -
Used in vanilla. The need for slots is obvious, as that is what exists currently as inventory_size.
- filterable -
Used in vanilla (for vehicles only). Filterable would simply be a very convenient option for mods to add in more advanced / specialist storage.
Used in some mods that currently hack in cargo wagons as filterable chests. Forced to use lua to hack around the limitation.
- stack_size_multiplier -
Unused currently, but the compression chest mod does something very similar (although with the additional addition of energy_cost_per_item_moved.)
Would be very useful for mods that want to add warehousing type storage.
Personal tests on containers revealed that (currently) extremely large inventory_size values (>1000) can cause lag when items are being inserted / removed. (I assume because the code has to look for the first empty slot / slot with items in).
Could be helpful for use in rockets, where the amount of 'something' being launched into space on a single rocket might want to be less (or perhaps more?) than the default stack size.
(Example: If satellites could stack to more than 1, the rocket inventory could use this to still only allow 1 satellite to be inserted, regardless.)
- allowed_item_category_list -
Suggested because I've seen several mods around that implement various forms of specialized storage, for both vehicles and stationary storage. (Example: Ore only storage.)
Could also be useful in vanilla to restrict rocket cargo to only allow satellites (and later on the other specific launchable items).
Currently container entities have a property
Code: Select all
inventory_size
Proposed is that it is expanded in the following fashion:
Code: Select all
intentory =
{
slots = 16,
stack_size_multiplier = 1.0,
filterable = false,
allowed_item_category_list: [*]
}
- slots: The size value. (I.e. the number of slots for item stacks the inventory has). Default = 16?
- stack_size_multiplier: The multiplier to the maximum stack size of item stacks placed in this container. (I.e. iron ore normally stacks to 50. So a stack multipier of 2.0 will mean that it can stack to 100 in this container.). Only applies to item stacks with a stack size of at least 2 or more. Default = 1.0 (Values less than 1 will never reduce the stack size to less than 1).
- filterable: True = can apply filters to each item stack slot. (As cargo wagons currently can). Default = false
- allowed_item_category_list: A list of item categories. Only items belonging to a category listed here can be inserted into this container. Applies before user filtering. Default: [ * ] (special wildcard meaning all categories).
= Use cases =
- slots -
Used in vanilla. The need for slots is obvious, as that is what exists currently as inventory_size.
- filterable -
Used in vanilla (for vehicles only). Filterable would simply be a very convenient option for mods to add in more advanced / specialist storage.
Used in some mods that currently hack in cargo wagons as filterable chests. Forced to use lua to hack around the limitation.
- stack_size_multiplier -
Unused currently, but the compression chest mod does something very similar (although with the additional addition of energy_cost_per_item_moved.)
Would be very useful for mods that want to add warehousing type storage.
Personal tests on containers revealed that (currently) extremely large inventory_size values (>1000) can cause lag when items are being inserted / removed. (I assume because the code has to look for the first empty slot / slot with items in).
Could be helpful for use in rockets, where the amount of 'something' being launched into space on a single rocket might want to be less (or perhaps more?) than the default stack size.
(Example: If satellites could stack to more than 1, the rocket inventory could use this to still only allow 1 satellite to be inserted, regardless.)
- allowed_item_category_list -
Suggested because I've seen several mods around that implement various forms of specialized storage, for both vehicles and stationary storage. (Example: Ore only storage.)
Could also be useful in vanilla to restrict rocket cargo to only allow satellites (and later on the other specific launchable items).