ShipSort

v5.2.0·Updated 2026-09-22

Highly customizable mod that organizes all items on your ship

About this mod Author’s original text

ShipSort - Item sorting mod for Lethal Company

Documentation for users

Basic usage

After installing the mod, simply type /sort in the game chat.

This should sort all scrap on your ship onto the wall and put all your tools into the

cupboard (or on the floor, if the cupboard is stored)

Some tools are automatically put on the cruiser (if you have one).

For maximum consistency you can only use /sort while your ship is in orbit.

Advanced usage (alternative/custom scripts)

This mod is highly customizable by using lua scripts to create item arrangements.

The default arrangement described above is produced by the bundled sort.lua script, however it can be easily adjusted

by changing the ScriptPath config value.

An alternative script is bundled with the mod: sort_sm.lua - a reimplementation of

the ScrapMagic sorting feature

The bundled scripts contains some options that can be easily adjusted near the top of the file.

Make sure to rename the file if you do this, as otherwise your changes may be lost on updates.

While scripts run in an isolated environment, there is always a risk when running arbitrary code. Only use scripts

from trusted sources

The path is interpreted relative to the BepInEx/config directory in your profile or as an absolute path.

Other config values

  • General/Timeout: To prevent freezes caused by bad scripts, a maximum execution time limit is set. If this expires,

the script execution will be aborted and no items will be sorted.

  • General/AutoSort: When you're hosting a lobby, the mod will automatically sort all items when
  • a save is loaded
  • the ship leaves orbit
  • the ship returns to orbit
  • Networking/ShareConfig: The script you selected will be shared with any clients also using the mod in your lobby.

This results in less config conflicts.

  • Networking/UseSharedConfig: If you joined a lobby where the host has shared their script, this can be used to force

your own script instead.

  • Networking/SharedConfigSizeLimit: Prevents any abnormally large scripts sent by the host from being decompressed.

Command arguments

Command arguments are anything you type after the command: /command argument1 argument2...

Any arguments you pass to the /sort command are passed to the script.

Common errors

  • Script '...' could not be found: The script file referenced in the config is not available. Make sure the path is

valid.

  • Script execution timed out: The script took too long to execute, increase the General/Timeout config value if this

happens too often.

  • Version conflict (...): The script was created for a different version of the mod, things may break.

If it works fine, you can remove the expect_version(...) instruction in the script to remove the warning.

-... items couldn't be sorted: Some positions were invalid, contact the script creator about this and make sure to provide

all error messages found in the game logs.

  • Script error:...: The script failed to execute, contact the script creator about this and make sure to provide the full

error message found in the game logs.

  • Script compilation error:...: The script file contains an error, contact the script creator about this and make sure to

provide the full error message found in the game logs.

  • Script result invalid:...: The script exited abnormally, contact the script creator about this and make sure to provide

the full error message found in the game logs.

Sub-commands

The following sub-commands are available:

  • /sort-reload - Reloads your selected script from disk
  • /sort-status - Displays some information about the mod (such as the current script and information about the previous sort)

Documentation for script developers

When developing scripts, it is recommended to use a debug build of the runtime, as it provides useful tools,

warnings and log messages for script development. See below for more information

Concept

A sorting script receives a table of items and returns a table of positions, both using

arbitrary indexes for item id

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPackbaer1-LethalModUtilsbaer1-ChatCommandAPI

File & checksum

Filename
ShipSort-5.2.0.zip
File size
282.7 KiB