ShipSort
Highly customizable mod that organizes all items on your ship
模組介紹 作者原文
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
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: