Zigzag-SelfSortingStorage icon

SelfSortingStorage

Adds a special storage container to the shop that automatically sorts equipment items (scraps are also supported).

Last updated a week ago
Total downloads 29856
Total rating 3 
Categories Equipment Furniture Tweaks & Quality Of Life
Dependency string Zigzag-SelfSortingStorage-1.0.9
Dependants 27 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
Evaisa-LethalLib-0.16.1 icon
Evaisa-LethalLib

Personal modding tools for Lethal Company

Preferred version: 0.16.1
ShaosilGaming-GeneralImprovements-1.4.10 icon
ShaosilGaming-GeneralImprovements

Fixes many bugs and adds many QoL improvements and optional tweaks. Very configurable.

Preferred version: 1.4.10

README

Self Sorting Storage

Adds a new unlockable ship ugrade to the game : the Smart Cupboard!

This storage container who looks a lot like the vanilla Cupboard furniture, has the effect to automatically sorts equipment items that you store in.

The Smart Cupboard can be acquired by spending 20 credits in the store.

Compatible with v69 of Lethal Company.

How to use

On the side of this special Cupboard, you can find a storage box where players can dump their tools like flashlights, walkie-talkies, shovels, spray paints and even scrap items.

Preview

The storage will then sort these tools and put them on display in specific sections. Then all items will be organized and ready for players to grab and go!

Preview

Multiple copies of one item

  • If you dump multiples copies of the same item, the storage will have them all 'visually' stacked on top of each other.
  • In vanilla, having a lot of items in the ship can sometimes cause some lags. But with this mod installed, all subsequent copies of the same item are going to be stored in the Cupboard's memory. So, you will no longer have lag issues for buying 30+ shovels!

Preview

Other features

  • All items stored in the Smart Cupboard are saved in the host player's current save file.
  • If you dump a big item in the box, it will be rescaled to fit nicely in the storage!
  • You can customize a lot of things in the config file (such as the price and the color of the cupboard).
  • Some optional upgrades can be activated in the configs.
Preview images of the upgrades (click to reveal)

Wide Cupboard

For those who wants more space!

Preview

Reset Button

Press it to delete everything stored...

Preview

Cozy Lights

Some decorative lights for the storage!

Preview

Items list screen

List every stored items on a GeneralImprovements screen.

Preview

Compatibility notes

  • GeneralImprovements
    • GeneralImprovements is a required dependency because I'm rotating items based on the FixItemsLoadingSameRotation + FixItemsFallingThrough configs. This is needed for items to face the correct direction when stored.
    • ShipPlaceablesCollide config in GeneralImprovements NEEDS to be activated (at least from my personnal observations).
  • Matty_Fixes
    • If you have Matty_Fixes installed, you need to disable either FixItemsFallingThrough in GeneralImprovements OR disable OutOfBounds.Enabled in Matty_Fixes, because these mods do the same thing.
    • For people that don't want or need GeneralImprovements, it is considered as a soft dependency in the code so you can remove it safely. But if you remove it then you'll need to install Matty_Fixes instead.
  • Problems buying the Smart Cupboard in the store
  • CruiserImproved and custom ships
    • If you have a custom ship mod AND CruiserImproved installed, reloading a save when the SSS is already unlocked will break it until a complete reset. Please wait for CruiserImproved to be updated to support custom ships.
  • TerminalFormatter item listing

How to add custom item condition

For items developers! By default, every items are allowed in the storage but if you want to add a custom "condition" to your scraps and tools, so the Smart Cupboard will not accept them, you can do so easily by adding this mod as a soft dependency and then write this code :

public static void AddValidation()
{
    SelfSortingStorage.Cupboard.SmartCupboard.AddTriggerValidation(MyCustomValidation, "[Your custom message]");
    // the custom message is displayed when a player tries to store something checked by your condition
}

private static bool MyCustomValidation(PlayerControllerB player)
{
    var item = player.currentlyHeldObjectServer;
    if (item is MyCustomItem)  // check your item
        return false;  // don't store the item
    return true;  // allow the item to be stored
}

Contact & Feedback

If you want to suggest new features or contact me please go to the mod release page in the modding discord or as a github issue.

Credits

  • Thanks Xu Xiaolan for helping with some parts of the code, and also for suggesting good things!

  • Thanks A Glitched Npc for the initial idea and for testing!

  • Thanks ScienceBird for the help on the 1.0.4 update!

  • Some parts ot the code is based on the ShipInventory implementation by WarperSan, such as the items data structure which has been modified to better fit the SelfSortingStorage mod.

  • Cupboard asset is ripped from Lethal Company.

  • "vent_chute" by jazz-the-giraffe is a free 3D model licensed under Creative Commons Attribution.