Solon-ScrapSack icon

ScrapSack

A red, scrap-only belt bag sold in the terminal. Holds loot instead of tools - and unlike a vanilla bag, you carry the weight of everything inside it. Host-authoritative.

By Solon
Last updated 3 hours ago
Total downloads 49
Total rating 0 
Categories Mods Server-side Items AI Generated
Dependency string Solon-ScrapSack-1.0.0
Dependants 0 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-1.2.0 icon
Evaisa-LethalLib

Personal modding tools for Lethal Company

Preferred version: 1.2.0

README

ScrapSack

SCRAP SACK

Lethal Company BepInEx Version License

Language / Язык: English · Русский

SCRAP SACK

Author: Solo00n

A red belt bag sold in the terminal that holds loot instead of tools — and unlike a vanilla bag, you carry the weight of everything inside it.

WHAT IT DOES

  • A new item in the shop — order scrap sack from the terminal for 60 credits. It is a separate item, not a change to the bag you already know.
  • Scrap only — flashlights, the shotgun, keys and every other tool are refused. One-handed loot by default; bulky two-handed loot can be switched on.
  • It weighs — every piece inside adds its weight while you carry the sack. A vanilla belt bag is weightless, which makes it strictly better than your hands; the sack trades that away.
  • Red, not blue — the bag is recoloured by swapping the red and blue channels of its textures, so the shape, seams, stitching and baked shadows all survive the change.
  • The vanilla belt bag is untouched — every patch checks which bag it is looking at first, so vanilla bags behave exactly as vanilla and other belt bag mods keep working.

HOW IT WORKS

There is no Unity project and no AssetBundle. At startup the mod finds the vanilla belt bag prefab in the NetworkManager's prefab list, clones it with its own deterministic GlobalObjectIdHash — derived from the mod name, so every client computes the same one — clones the Item asset alongside it, recolours the clone's materials and registers the result as a shop item through LethalLib. The mesh, animations, sounds and icon come along for free, and nothing about the vanilla item changes.

The recolour is a red/blue channel swap rather than a tint. Tinting red over a blue albedo multiplies towards black and gives a muddy maroon; swapping the channels maps the blue exactly onto red and keeps every texture detail. Because the game's textures are not CPU-readable, each one is copied through a RenderTexture on the GPU before its pixels are rewritten.

MULTIPLAYER (HOST-AUTHORITATIVE)

A bag that carries loot is worth cheating on, so the host decides everything that could be an advantage and clients are given no say in it.

  • The host's rules are sent on connect — capacity, the scrap-only rule, the deny list, grab range and both weight settings travel to every client in the handshake. Clients apply the host's values and ignore their own config, so editing the file cannot buy you a bigger or lighter sack.
  • Every add is validated server-side — capacity, what counts as storable and the distance to the item are re-checked on the host when the client asks to bag something, and refused there if they do not hold. A client that lies about any of it is simply told no.
  • Weight is synced rather than enforcedcarryWeight only exists on the machine that owns the player, so no server check can reach it. That is exactly why the host's weight settings are sent instead of trusted locally: without it, switching weight off in the config would turn the sack into a free, weightless loot crate.
  • Inert until the host confirms — a client's sack behaviour stays off until the host says it has the mod, so a mismatched lobby degrades quietly instead of desyncing.

Everyone needs the mod. The sack is a network prefab, so a vanilla client cannot spawn it. This is unlike a pure tweak mod where only the host needs to be modded.

REQUIREMENTS

  • Lethal Company V81
  • BepInEx 5.4.21 or newer
  • LethalLib — used to register the shop item and the network prefab

INSTALLATION

Mod manager — install through Thunderstore Mod Manager or r2modman; LethalLib comes with it.

Manual

  1. Install BepInEx 5 (BepInExPack for Lethal Company) and LethalLib.
  2. Put Iron.ScrapSack.dll in Lethal Company/BepInEx/plugins/.
  3. Launch once to generate BepInEx/config/Iron.ScrapSack.cfg.

CONFIGURATION

BepInEx/config/Iron.ScrapSack.cfg

Section Key Default Meaning
General Enabled true Master switch.
Shop Price 60 Terminal price. Needs a game restart.
Shop Item Name Scrap sack Terminal command and HUD name. Needs a restart.
Slots Capacity 4 How many pieces fit. Host's value is used.
Slots Resize Inventory UI true Rebuild the slot grid to match Capacity.
Slots Slots Per Row 4 Columns in the rebuilt grid.
Items Allow Two-Handed Scrap false Paintings and other bulky loot. Host's value is used.
Items Denied Items Apparatus, Body Never fit, even though they are scrap. Host's value is used.
Weight Enabled true Carry the weight of the contents. Host's value is used.
Weight Multiplier 1.0 0.5 = half weight, 0 = weightless. Host's value is used.
Appearance Recolor Mode SwapRedBlue SwapRedBlue / Tint / Off. Needs a restart.
Appearance Tint Color #C81E1E Used by Tint mode. Needs a restart.
Misc Grab Range 4 Max reach when bagging. Host's value is used.
Misc Tooltips true HUD tip when something is refused.
Misc Empty Bag Action true Right-interact dumps the sack.
Host Enforce Capacity true Server-side capacity check.
Host Enforce Restrictions true Server-side scrap-only check.
Host Enforce Range true Server-side grab-range check.

The Apparatus is denied by default because bagging it interferes with leaving the facility.

INTEGRATIONS AND COMPATIBILITY

  • Other belt bag mods — a mod that patches BeltBagItem patches the class, not the instance, so it sees the sack too. This mod only ever acts on its own bag and hands everything else back. For the reverse direction, ImprovedBeltBag 1.2.0+ learned the same manners and leaves the sack alone.
  • The shared inventory panel — the slot grid is returned to its original size whenever a different bag is opened, so two bag mods with different capacities do not fight over it.

BUILD

dotnet build -c Release

Or .\build-package.ps1 to build and stage a Thunderstore zip in dist/.

CREDITS

Built on ImprovedBeltBag. The server-side enforcement and handshake patterns trace back to BagConfig by The Matty, MIT. Shop and network prefab registration use LethalLib by Evaisa. See THIRD_PARTY_LICENSES.md.


SCRAP SACK — Русское описание

Автор: Solo00n

Красная поясная сумка, покупаемая в терминале. Носит лут вместо инструментов — и, в отличие от ванильной, ты чувствуешь вес всего, что в неё сложил.

ЧТО ДЕЛАЕТ МОД

  • Новый предмет в магазине — заказывается в терминале командой scrap sack за 60 кредитов. Это отдельный предмет, а не переделка привычной сумки.
  • Только скрап — фонарики, дробовик, ключи и прочие инструменты не влезают. По умолчанию одноручный лут; двуручный включается в конфиге.
  • Она весит — каждый предмет внутри добавляет свой вес, пока ты несёшь сумку. Ванильная сумка невесома, из-за чего она строго лучше рук; эта сумка меняет невесомость на вместимость.
  • Красная, а не синяя — перекраска сделана обменом красного и синего каналов текстур, поэтому форма, швы, строчка и запечённые тени полностью сохраняются.
  • Ванильная сумка не тронута — каждый патч сперва проверяет, с какой сумкой имеет дело, так что ванильная ведёт себя ровно по-ванильному, а другие моды на сумки продолжают работать.

КАК ЭТО РАБОТАЕТ

Ни Unity-проекта, ни AssetBundle. При запуске мод находит ванильный префаб сумки в списке сетевых префабов, клонирует его с собственным детерминированным GlobalObjectIdHash — он выводится из имени мода, поэтому у всех клиентов получается одинаковым, — клонирует рядом ассет Item, перекрашивает материалы клона и регистрирует результат в магазине через LethalLib. Модель, анимации, звуки и иконка достаются бесплатно, а ванильный предмет не меняется вообще.

Перекраска — это обмен каналов R и B, а не тонирование. Красный тон поверх синей текстуры умножается в сторону чёрного и даёт грязный бордовый; обмен каналов кладёт синий точно на красный и сохраняет все детали. Текстуры игры недоступны для чтения процессором, поэтому каждая сперва копируется через RenderTexture на видеокарте, и уже копия переписывается попиксельно.

МУЛЬТИПЛЕЕР (HOST-AUTHORITATIVE)

Сумку, которая носит лут, есть смысл читерить, поэтому всё, что может дать преимущество, решает хост, а клиенту голоса не даётся.

  • Правила хоста передаются при подключении — вместимость, правило «только скрап», список запретов, дальность и обе настройки веса уходят каждому клиенту в хендшейке. Клиент применяет значения хоста и игнорирует собственный конфиг, так что правкой файла нельзя выдать себе сумку побольше или полегче.
  • Каждое добавление проверяется на сервере — вместимость, пригодность предмета и расстояние до него перепроверяются на хосте в момент, когда клиент просит что-то положить, и отклоняются там же. Клиенту, который соврал, просто отвечают отказом.
  • Вес синхронизируется, а не проверяетсяcarryWeight существует только на машине, которой принадлежит игрок, и серверная проверка до него не дотянется. Именно поэтому настройки веса приходят от хоста, а не берутся локально: иначе выключенный в конфиге вес превратил бы сумку в бесплатный невесомый ящик.
  • Не работает без подтверждения хоста — поведение сумки у клиента выключено, пока хост не сообщит, что мод у него есть. Несовпадающее лобби тихо деградирует вместо рассинхрона.

Мод нужен всем. Сумка — сетевой префаб, у ванильного клиента она просто не заспавнится. Это отличается от чистых твик-модов, где достаточно мода у хоста.

ТРЕБОВАНИЯ

  • Lethal Company V81
  • BepInEx 5.4.21 или новее
  • LethalLib — регистрация предмета в магазине и сетевого префаба

УСТАНОВКА

Через менеджер модов — Thunderstore Mod Manager или r2modman; LethalLib подтянется сам.

Вручную

  1. Установить BepInEx 5 (BepInExPack для Lethal Company) и LethalLib.
  2. Положить Iron.ScrapSack.dll в Lethal Company/BepInEx/plugins/.
  3. Запустить игру один раз, чтобы создался BepInEx/config/Iron.ScrapSack.cfg.

НАСТРОЙКА

BepInEx/config/Iron.ScrapSack.cfg

Секция Ключ По умолчанию Значение
General Enabled true Общий выключатель.
Shop Price 60 Цена в терминале. Нужен перезапуск игры.
Shop Item Name Scrap sack Команда в терминале и имя в HUD. Нужен перезапуск.
Slots Capacity 4 Сколько предметов влезает. Берётся у хоста.
Slots Resize Inventory UI true Перестраивать сетку слотов под Capacity.
Slots Slots Per Row 4 Столбцов в перестроенной сетке.
Items Allow Two-Handed Scrap false Картины и прочий крупный лут. Берётся у хоста.
Items Denied Items Apparatus, Body Не влезают, даже будучи скрапом. Берётся у хоста.
Weight Enabled true Нести вес содержимого. Берётся у хоста.
Weight Multiplier 1.0 0.5 — половина веса, 0 — невесомо. Берётся у хоста.
Appearance Recolor Mode SwapRedBlue SwapRedBlue / Tint / Off. Нужен перезапуск.
Appearance Tint Color #C81E1E Для режима Tint. Нужен перезапуск.
Misc Grab Range 4 Дальность подбора в сумку. Берётся у хоста.
Misc Tooltips true Подсказка в HUD при отказе.
Misc Empty Bag Action true ПКМ вываливает содержимое.
Host Enforce Capacity true Серверная проверка вместимости.
Host Enforce Restrictions true Серверная проверка «только скрап».
Host Enforce Range true Серверная проверка дальности.

Apparatus запрещён по умолчанию, потому что в сумке он мешает уходу с завода.

СОВМЕСТИМОСТЬ

  • Другие моды на сумки — мод, патчащий BeltBagItem, патчит класс, а не экземпляр, поэтому видит и нашу сумку. Этот мод работает только со своей и отдаёт остальные обратно. В обратную сторону ImprovedBeltBag 1.2.0+ научился тому же и не трогает нашу.
  • Общая панель инвентаря — сетка слотов возвращается к исходному размеру при открытии любой другой сумки, поэтому два мода с разной вместимостью не дерутся за неё.

СБОРКА

dotnet build -c Release

Либо .\build-package.ps1 — соберёт и упакует zip для Thunderstore в dist/.

АВТОРСТВО

Построен на ImprovedBeltBag. Серверная валидация и хендшейк восходят к BagConfig от The Matty, MIT. Регистрация в магазине и сетевого префаба — через LethalLib от Evaisa. Подробности в THIRD_PARTY_LICENSES.md.