Lethal Company
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
Downloads
997
Size
146KB

LocalDeposit

V81 host-only, clientside mod that cuts ship lag. Deposit scrap and tools off the ship so the game has far fewer objects to run, merge piles of scrap into one item, and sell just part of an item's value. Everything is a terminal command and the other players do not need the mod.

If the HQoL mod is installed, LocalDeposit turns its commands off so the two do not fight over your items.

WARNING

Crashing or Alt+F4 removes all saved scrap into nothingness so keep a spare savefile when using this mod

How it works (/deposit version)

  • Physically deletes all scrap and convert them into stored value in terminal
  • Shows the total deposited value in the terminal (a rainbow by default, color is configurable)
  • Preserves item values and rotation: a deposited item or tool comes back turned the way it was when you deposited it.
  • Everything deposited (scrap AND tools) is physically put back on the ship before the game saves: at the end of the day, when quitting normally, and right before any save. The vanilla savefile cannot see stored items, so this always happens.
  • AutoDepositSave (on by default): right after the game has saved, what you had deposited is deposited again, so you play with the light ship again. See AutoDepositSave below.

Commands

  • /deposit — Deposit scrap.

  • /deposit -b — Deposit with blacklisted items.

  • /deposit -a or /deposit --all — Deposit everything, ignoring the blacklist (Gift Boxes are still never touched).

  • /deposit --list or /deposit -l — List deposited items.

  • /deposit -diag — Short health check: versions, game members found, broadcast and color settings, what is deposited.

  • /deposit -t or /deposit --tools — Deposit extra tools (see Tool Deposit below).

  • /deposit --help or /deposit -h — Show command help.

  • /undeposit — Restore all deposited scrap (big amounts are restored in batches so the game does not freeze).

  • /undeposit -t or /undeposit --tools — Bring deposited tools back.

  • /tools -l or /tools --list — List every tool as Weed killer 60/60 (30) (on the ship / keep limit (stored)).

  • /tools -r or /tools --restock — Refill tools on the ship from storage (see Tool Deposit below).

  • /tools -b or /tools --buy — Buy the tools you are short of from the terminal store (asks first). -b:600 spends at most 600, -b:-600 leaves 600, -bo:-600 leaves 600 counting overtime.

  • /tools -d or /tools --deposit — Deposit tools above the keep amount (same as /deposit -t).

  • /tools -u or /tools --undeposit — Bring deposited tools back (same as /undeposit -t).

  • /undeposit -b or /undeposit --bags — Empty the belt bags on the ship.

  • /undeposit -r (or --recover) — After a crash: review deposits found in the crash journal, then c to import them or d to cancel. --discard forgets them. See Safety features.

  • /broadcast (or /announce) — Turn short chat broadcasts on or off. Default on.

  • /drop -q or /drop 1000 — Split an item: drop a new item worth the quota (or an amount) so you can hand it in yourself.

  • /save — Save the game now (orbit only). See Saving below.

  • /save -1 to /save -9 — Save into a numbered slot file.

  • /save -9 -n:"Dine Save" — Save into a slot with a name.

All commands are typed in the ship terminal. Chat commands are not used.

Confirming (c / d)

/sell, /merge and /undeposit -r never act straight away. They show a preview, like:

preview - nothing would be merged yet
Would merge 83 items into 1 Heartcontainer worth $50000.
confirm or deny type /c or /d in terminal

Type /c (or just c) to confirm, /d (or d) to deny, in the terminal. Any start of the word works: c, co, conf, d, de, deny. A waiting preview expires after 60 seconds and any new command replaces it. On confirm the command runs again against the ship as it is at that moment.

/deposit, a plain /undeposit, the tool commands and Merge Always run immediately.

How it works (less lag /merge version)

  • /merge turns all your scrap into one item that holds all the value.
  • You can still sell from that item. If the item is worth more than what you are selling, the mod does not sell the whole thing. It takes only the amount you need off its value and puts just that piece on the desk. The rest stays on the ship.
  • Example: the quota is 1000 and you have one item worth 10000. /sell quota takes 1000 off it and sells that. The item stays on the ship, now worth 9000.

Tool Deposit

/deposit -t keeps only a set amount of each tool on the ship and deposits the rest. /undeposit -t brings them back.

  • The list is in its own file, Crispy_Depression.LocalDeposit.ToolDeposit.cfg, one number per tool.
  • The ship keeps that number x 2. Example: Weed killer = 30 keeps 60. With 100 on the ship, 40 are deposited.
  • -1 skips a tool. Tools in hands, in pockets, used up, or with an empty battery are never deposited (a respawned tool would come back charged). Tools on ship shelves or in the closet are deposited.
  • Nothing is deposited when a tool is at or under its limit.
  • What counts as "on the ship": tools lying in the ship, tools in the Company Cruiser while it is magneted to the ship, and tools inside belt bags that are on the ship (also a bag someone carries on the ship, and bags inside bags). All of the numbers use this: the ship number in Weed killer 60/60 (30), /tools -b (it never buys what the cruiser or a bag already holds), /tools -r, and the keep amounts. A cruiser that is not magneted to the ship, or a bag that is not on the ship, does not count.
  • What gets deposited: only tools lying in the ship. Tools in the cruiser or in a belt bag are counted but never deposited (a tool could not be put back inside a bag or a moving cruiser). If the extra tools are all in the cruiser or in bags, the terminal says Left on ship: in the cruiser 13.
  • What the terminal shows: after /deposit -t (and /tools -r) every configured tool gets one line: Weed killer 60/60 (30).
    • 60/60 = 60 on the ship right now / the keep limit (config number x 2).
    • (30) = how many LocalDeposit is storing right now (the real stored amount). Weed killer 40/60 (0) means 40 on the ship, keep limit 60, nothing stored.
    • A tool set to -1 shows skip instead of a keep limit. Tools in hands, used up, or with an empty battery are never counted as deposited.
  • If tools above the keep amount were left on the ship, a line like Left on ship: held by someone 2, used up 1 says why.

AutoDepositSave

The game can only save items that are physically on the ship. So before every save LocalDeposit puts everything back, and after the save it deposits it again. That is AutoDepositSave: setting AutoDepositSave in Crispy_Depression.LocalDeposit.cfg under [Deposit], default true.

  • It only deposits what you deposited. /deposit switches it on for scrap, /deposit -t (or /tools -d) for tools. If you never use them, nothing is ever deposited automatically.
  • /undeposit switches the scrap part off again, /undeposit -t (or /tools -u) the tools part. After you restart the game nothing is switched on until you deposit again.
  • What it deposits: scrap the same way your last /deposit did (/deposit -a stays -a), and tools above their keep amount, like /deposit -t. So a tool count that dropped during the day is refilled by the end-of-day return and then trimmed back to the keep amount after the save.
  • It happens after the end-of-day save, after /save, and after any other save of the game. It never happens when you leave the game, and it never touches the save itself.
  • The chat stays quiet by default. Turn on BroadcastDepositSave to get a short line (Re-deposited 120 items $4500 + 30 tools). /save always tells you in the terminal.
  • With AutoDepositSave = false everything simply stays on the ship after a save, until you deposit it yourself.
  • It replaces the old AutoRestock setting and the /tools -ar command, which are gone.

Listing, depositing, bringing back and refilling

  • /tools -l (or --list): shows every configured tool as Weed killer 60/60 (30), how many are stored, and whether AutoDepositSave is on. Changes nothing.
  • /tools -d (or --deposit): the same as /deposit -t.
  • /tools -u (or --undeposit): the same as /undeposit -t.
  • /tools -r (or --restock): checks every configured tool. If the ship has fewer than the keep limit, stored tools come back until the limit is reached or storage runs out. It never goes above the keep limit and never creates a tool (it only brings back tools that were deposited). It shows what was restocked and what is still stored. Tools that are still stored all come back before the next save anyway.
  • /deposit -t -l lists deposited tools. Tools are never sold or merged.

Buying what you are short of (/tools -b)

/tools -b (or --buy) orders every tool that is below its keep limit from the terminal store, so you do not have to type each purchase. Example: 30/40 Pro-flashlights means it orders 10.

  • It asks first. It shows what it would order and what it costs, then waits for c (buy) or d (cancel), like /sell and /merge. Nothing is paid before you confirm.
  • Most important first (the BuyPriority setting): Weed killer, TZP-Inhalant, Stun grenade, Shovel, Belt bag, Spray paint, then the cheaper tools (Walkie-talkie, Flashlight, Lockpicker, Pro-flashlight, Boombox, Extension ladder, Radar-booster), and Zap gun and Jetpack last. You can change the order in the ToolDeposit cfg: a comma-separated list of tool names, tools you leave out are bought last.
  • It never buys twice. Tools on the ship, tools stored by LocalDeposit and tools already ordered but not delivered yet all count as owned. Run /tools -b again and it says "Nothing to buy".
  • Spending limits (all of them ask first):
    • /tools -b:600 (or --buy:600): spend at most 600 credits.
    • /tools -b:-600 (or --buy:-600, or -b:l600): leave 600 credits. It spends everything above 600.
    • /tools -bo:-600 (or --buyovertime:-600, -bo:l600): leave 600 credits counting overtime. The overtime you will get is added to what you have, so you can spend more now. Only real credits can be spent: with 1000 credits and 300 overtime, leaving 600 lets you spend 700.
    • Plain /tools -b spends as much as it needs, up to your credits.
  • Limits: your credits and BuyMaxItems (default 999, the most DropShipDeliveryCapModifier allows; without that mod the dropship only holds 12, so set BuyMaxItems to 12). The order follows the priority list, so the important tools are bought first. If something is left, it says Still short: ...: run /tools -b again after the delivery. Today's sale prices are used.
  • Tools the terminal does not sell (Key, Shotgun, Ammo, Kitchen knife) are reported as Not sold at the terminal.
  • It orders the same way the game's own terminal does for the host (credits are taken, the items go on the dropship order), so the dropship delivers as usual. Orders of any size up to BuyMaxItems work. The result is announced like the other commands (Bought 12 tools for $630).

Emptying belt bags (/undeposit -b)

/undeposit -b (or --bags) drops everything out of the belt bags that are lying on the ship (the same as the EmptyBag mod, now built in). Bags that someone holds, and bags inside another bag, are left alone; a bag that was inside a bag is emptied too. The items drop in a small circle above the bag. It says [EmptyBag] Emptied 2 bag(s), 14 item(s) in the terminal and in the yellow chat line (that line keeps the [EmptyBag] prefix instead of [LD]). Items in a bag are not deposited, so empty the bags first when you want them deposited.

Merging

Combine lots of scrap into ONE item worth the total (great for Dine). Host only, terminal only, always available.

  • /merge — Merge all ship scrap and deposited scrap into one item.
  • /merge -o (--outside) — Also include loose scrap outside the ship.
  • /merge -a (--all) — Also merge blacklisted items.
  • /merge -r (--random) — Merge into a random item that is on the ship. Each kind on the ship has the same chance.
  • /merge -tr (--truerandom) — Merge into a random item of any kind, on the ship or not (same chance for each kind).
  • Random merges never pick a blacklisted item (Gift Box, Kitchen knife, Shotgun by default; see [Blacklist] Items). Also never picked: Body, Apparatus, Maneater, Egg (kiwi) and Gift.

Where the merged item ends up (the same for /merge, /merge -r and Merge Always):

  1. At the item of the merge type with the highest value, even if another item on the ship is worth more. Example: a Robot worth 1000 and a Heartcontainer worth 100: it merges at the Heart. With a Heart worth 10000 and a Robot worth 1000: also at the Heart. That item is kept and grows, so it does not move.
  2. If there is none of that type, at the highest-value item being merged (a new item of the merge type appears there).

It never picks a random spot. The message names the result, for example Merged 100 items into 1 Heartcontainer worth $20000.

Merge Item decides what everything becomes:

  • An item name like Heartcontainer (the default) or Zeddog: always that item, even if it isn't lootable on the moon. A wrong name uses Random.
  • Random: a random scrap kind from the ship (same as /merge -r). Never a blacklisted item, so 100 merged items never become a Gift Box, knife or shotgun.
  • TrueRandom: a random scrap kind of the whole game, on the ship or not (same as /merge -tr). Never a blacklisted item.

Gift Boxes are never merged away. /sell can also sell part of an item: with one item worth 50k, /sell 1000 puts a 1k item on the counter and the original drops to 49k (shown in the scan, or in the terminal deposit total if it was deposited).

Merge Always = true merges automatically right before the end of every day (just before the game's autosave), with no confirmation.

Don't run TooMuchScrap's /merge alongside this one; both use the same command.

Selling (terminal only)

Sell at the Company, host only. Deposited scrap is included: anything deposited that gets chosen for a sale is undeposited first, then sold.

  • /sell quota — Sell just enough scrap to fulfil the remaining quota (exact if possible, otherwise the smallest overshoot).
  • /sell all — Sell all scrap.
  • /sell <amount> — Sell scrap worth at least <amount> (1500, 2k, 1k+500). You can do maths: + - * / and brackets, like 400+300-200 or (1k+500)*2. Amounts are what you receive after the Company's buying rate.
  • /sell item <name> — Sell every item whose name contains <name>.
  • Add -a or --all to ignore the blacklist (e.g. /sell quota -a).
  • /sell <amount> -e — Count the credits you already have, so it only sells the rest.
  • /sell <amount> -o (or --overtime) — Sell LESS, because the overtime from this sale makes up the rest. Example: quota 130, last day, you want 1500: /sell 1500 -o sells about 1285 and about 215 overtime brings you to 1500 (or 1501 if exactly 1500 is not possible).
  • /sell <amount> -eo (same as -e -o) — Both: counts your credits, the overtime you already earned, and the overtime this sale adds. The preview prints the breakdown, for example Plan: $300 in terminal + $54 overtime already earned + $955 sold now + about $191 new overtime = $1500.
  • Overtime uses the game's formula: (total sold - quota) / 5 + 15 x days left. At the Company the day counts as one less than the terminal shows (on the last day that is -15), and the bonus is never below 0. It is an estimate: the game only pays it when the quota period ends, so do not sell more after this.
  • /sell bl / /sell pr — Show the blacklist / priority list.
  • /sell bl + [name], /sell bl - [name] — Add/remove a blacklisted item (no name = the item in your hands).
  • /sell pr + [name], /sell pr - [name] — Same for the priority list. Priority items are preferred when several combinations fit the amount.

Splitting an item to hand in by yourself (/drop)

  • /drop -q (or --quota, quota): drops a new item worth what the quota still needs, split off an item you have. Example: quota 0/1000 and a Heart worth 10000: it drops a Heart worth 1000 next to you and the original keeps 9000. Put the dropped item on the Company counter yourself.
  • /drop 1000 (or /drop -1000): the same for a value of your choice.
  • The item that gets split is the one worth the least that is still worth more than what you ask for. A deposited item is split in storage (the piece appears, the rest stays deposited). The total value never changes.
  • With a buying rate under 100% -q drops enough value to cover the quota. If the quota is already met, or nothing is worth more than the amount, it says so.
  • /drop is not broadcast to the chat.

After /sell the mod asks the game to redraw the quota board in the ship once the Company has taken the items. This is best effort (it uses the game's own refresh): if the board still does not move, tell me and use /drop as the manual way.

/sell only exists in the terminal. Scrap inside the Company Cruiser counts as ship scrap for /sell and /merge. Clients don't need the mod; they just see the items go to the desk and their credits update.

Config

Config files (in BepInEx/config): Crispy_Depression.LocalDeposit.cfg and Crispy_Depression.LocalDeposit.ToolDeposit.cfg

[Blacklist]
Items = ShotgunItem, KnifeItem, GiftBox

[Sell]
Blacklist = ShotgunItem, KnifeItem, GiftBox
Priority = FancyLamp, LungApparatusTurnedOff, Clock, EasterEgg, ComedyMask, Tragedy, Heartcontainer

[Merge]
Merge Item = Heartcontainer
Merge Always = false

[Chat]
Broadcast = true
Broadcast Color = #FFFF00
Broadcast Prefix = [LD]
Broadcast Quota = true

[Deposit]
Value Color = Rainbow
Rainbow Speed = 1
AutoDepositSave = true
BroadcastDepositSave = false

[Debug]
LogItemIdentifiers = false
Config Version = 2

Crispy_Depression.LocalDeposit.ToolDeposit.cfg:

[Tool Deposit]
BuyPriority = Weed killer, TZP-Inhalant, Stun grenade, Shovel, Belt bag, Spray paint, Walkie-talkie, Flashlight, Lockpicker, Pro-flashlight, Boombox, Extension ladder, Radar-booster, Zap gun, Jetpack
BuyMaxItems = 999
Boombox = 5
Flashlight = 5
Jetpack = 10
Key = 5
Lockpicker = 5
Pro-flashlight = 20
Shovel = 10
Stun grenade = 15
Extension ladder = 5
TZP-Inhalant = 15
Walkie-talkie = 10
Zap gun = 5
Radar-booster = 1
Shotgun = 5
Ammo = 5
Spray paint = 10
Kitchen knife = 3
Weed killer = 30
Belt bag = 5
  • Blacklist Items: /deposit skips these (-a ignores the list).
  • Sell Blacklist: /sell skips these (-a ignores the list).
  • Sell Priority: /sell prefers these when several combinations fit.
  • Merge Item: What /merge makes: an item name (default Heartcontainer), Random (random ship scrap, never blacklisted) or TrueRandom (any scrap kind of the game). Neither picks a blacklisted item.
  • Merge Always: Merge automatically before the end of each day.
  • Broadcast Quota: true = the sold broadcast ends with quota progress, like Quota 1285/1500. Default on.
  • Broadcast Prefix: Text before every broadcast. Default [LD]. Leave empty for none.
  • Broadcast Color: Color of broadcast text, as a hex code like #FFFF00 (yellow) or #00FF00 (green). A wrong code uses yellow.
  • Broadcast: true = post short results in everyone's chat, like Deposited 40 items worth $5200, Sold 12 items worth $1000 | overtime $231 | Quota 1000/1500, Sold $1000 from a $10000 item, Merged 100 items into 1 Heartcontainer worth $20000, Undeposited 131 items (toggle with /broadcast). Default on.
  • Value Color: Color of the deposited value $ in the terminal: Rainbow (default) or a hex code like #FF00FF (fuchsia). A wrong code uses Rainbow.
  • BroadcastDepositSave: true = also show a short chat line when AutoDepositSave deposits again, like Re-deposited 120 items $4500 + 30 tools. Default false: the chat stays quiet (the terminal still shows it after /save).
  • AutoDepositSave: true = after the game has saved, deposit again what you had deposited (scrap and tools). Only if you used /deposit, /deposit -t or /tools -d. Default on.
  • Rainbow Speed: How fast Rainbow cycles, in color cycles per second. Default 1. 0 = stands still.
  • BuyPriority: (ToolDeposit cfg) The order /tools -b buys in, most important first. Tool names separated by commas. Tools you leave out are bought last.
  • BuyMaxItems: (ToolDeposit cfg) How many items /tools -b orders at once. Default 999.
  • LogItemIdentifiers: Log every item name when a lobby loads, to find names for the lists.
  • Config Version: (in [Debug]) Do not change. Lets the mod update old settings once.

Names are comma-separated and partial matches count. Use the prefab/object name of the item (KnifeItem, ShotgunItem, Clock, ...). The asset name, display name and scan name also match. Everything else is fixed: saves always restore deposited items first, and a save that would miss deposited items is skipped.

Item identifiers were found using ShipSort alongside Unity Explorer.

Requirements

  • BepInEx 5.
  • Recommended: TooManyItems (vanilla only saves 45 ship items).

Saving (/save)

Forces a save from the ship terminal, without waiting for the game to do it. Orbit only and host only (the same rules as the other commands). A challenge file cannot be saved.

  • /save — Save the current save file now.
  • /save -1 to /save -9 — Save a copy into slot file LCSaveFile1 to LCSaveFile9. Your current file stays the one in use.
  • /save -9 -n:"Dine Save" — Same, with a name: LCSaveFile9 Dine Save. A name needs a slot. Names are cleaned so they work as a file name (no \ / : * ? " < > |, at most 40 letters). Use quotes if the name has spaces.
  • Overwrite protection: if the slot file already exists, the terminal asks first. Type c to overwrite or d to cancel.
  • Deposited items are put back first, so they are in the save (the game would not save items that are not on the ship). The terminal says how many were put back.
  • /save is never broadcast to the chat. Only you see the result in the terminal.

Safety features

  • Crash journal: deposits are mirrored to a small file next to the config (never in the save), together with a checklist of the tools on the ship (flashlights, shovels, ...). After a crash, /undeposit -r shows the checklist (journal vs ship now) so you can see whether the ship loaded back the way it was. Recovery only works when the ship has ZERO scrap: if there is even one scrap item on the ship, the items are probably already in your save, so it refuses rather than risk duplicates.
  • Ship wipe (everyone dies): the game deletes all scrap on the ship, and shotguns and knives are scrap too. Stored scrap (and stored shotguns and knives) is lost in the same way: it is not brought back afterwards. Real tools (flashlights, shovels, ...) stay stored and come back as usual. A yellow line says how many stored items were lost.
  • Version check: a warning appears if the game version is not the one this mod was built for (v81), and the log has a startup self-test of the game members it needs.

Known Issues

  • Undepositing thousands of items is done in batches, but can still cause some lag.
  • Avoid Alt+F4: Use ESC → Leave Game whenever possible.
  • Crashing while items are deposited does not restore them (see the warning above).
  • Do not use HQoL's deposit/storage feature alongside LocalDeposit. If HQoL is installed, LocalDeposit's commands are disabled.
  • /tools -b and the ship-wipe handling use game members that a game update could rename. If one is missing, only that feature stops (restoring before saving never depends on them) and /deposit -diag and the startup log list what is missing.

For developers

  • tests/GuardTests — logic tests (planning, splitting, overtime, journal, config matching). dotnet run --project tests/GuardTests works without the game.
  • tools/compat-check.sh "<game folder>" — after a game update, compiles against a publicized copy of Assembly-CSharp.dll and tells you if a game member this mod relies on has changed.
  • tools/build-with-standins.sh [--test] — builds the mod and runs the tests WITHOUT the game, against small stand-in game assemblies (tools/standin). --test also runs the logic tests and a fake-ship /sell simulation (tests/StandIn).
  • .github/workflows/ci.yml runs the tests on every push. The mod DLL is built locally with ./build.sh "<game folder>".

Suggested mods

LocalDeposit works on its own. These two are not required, but they work well with /tools -b:

  • DropShipDeliveryCapModifier (DrinkableWater): lifts the 12-item limit, so one /tools -b can buy up to 999 items.
  • SkipDropshipCompany (aoirint): the dropship delivers right away.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.