Auto Collect Loot - PBZAutoCollect
Version 1.4.4 by SLEEP. Phantom Blade Zero on Steam. No other mods or tools needed.

Chests (Chests=On, off by default): a chest in range opens on its own, gives its normal loot once and stays open
after a reload. You do not move and the opening cinematic does not play. Ordinary pickups keep their normal popup.

Settings
Seven settings, in PBZ\ProjectPBZ\Content\Paks\~mods\PBZAutoCollect.txt. The mod creates that file the first time a
prompt shows in the world. Change a value, save the file, and the game picks it up within 2 seconds, no restart. The
settings also appear in the optional Mods Menu, under SYSTEM in the game:
https://www.nexusmods.com/phantombladezero/mods/149
   Enabled=On       loot is taken for you (the default). Off: nothing is picked up for you.
   Mode=All         every loot pile that holds only items, notes, book pages or Remnant Dust, and opted-in chests,
                    including chests with a weapon, medicine or accessory (you get the usual equip choice)
   Mode=Materials   only piles that hold crafting and upgrade materials or Remnant Dust (no notes, no chests)
   Mode=Common      like Materials, but only materials whose pile glows white or pale blue, such as Forged Metal,
                    Solvent and Incense Ash, plus Remnant Dust. Purple and orange glow materials stay on the ground.
                    A pile that mixes both stays whole, because the game takes a pile all at once.
   Chests=Off       the default. Chests stay manual at every distance. On: passive chests in All mode only.
   Range=0          only what you walk up to (the default). 5 to 100: loot piles within that many metres are
                    taken too, nearest first, without walking to them. Mode and the rules below still apply, and
                    safe chests in Mode=All are collected passively when Chests=On. Only actors in the part of the world the game
                    has loaded count, and the pickup starts once any prompt has shown since the area loaded.
   PromptSize=100   size of every interact prompt in percent, 25 to 100. 100 is the game's own.
   PromptOpacity=100  opacity of every interact prompt in percent, 0 to 100. 0 hides the prompts.
                    PromptSize and PromptOpacity also work with Enabled=Off.

All modes leave these for you to pick up yourself:
   loot piles with a weapon, medicine or accessory (they offer an equip or replace choice)
   story and quest items, and notes that belong to a quest (such as the Four Fierce Axes letters)
   locked chests, and chests that hold a quest item or start a quest step, a fight or a cutscene
   anything that starts dialogue, a quest step or a cutscene, memory flowers and story objects
Nothing is collected or opened in combat, mid-air, mid-attack, in dialogue, while a popup is up or while the game
is paused. Each chest gets one attempt per session. A failed visual repair leaves collection running.
A failed chest state, loot or save call stops the mod. Check that chest's loot and opened state before retrying.

Troubleshooting
Taking rare or important materials: Mode=All and Mode=Materials both allow purple and orange materials.
For Remnant Dust and white or pale blue upgrade materials, set Enabled=On, Mode=Common and Chests=Off.
In the Mods Menu, choose Collect > Common materials only. Range changes distance, not the item filter.
Common checks every item's rarity. A pile containing any purple or orange material stays whole.
Common includes B, B1, B2 and B3 pale blue tiers as well as C, D, E and F white tiers. There is no strictly white-only setting.
If a purple or orange material is still collected in Common, report its item name and your PBZAutoCollect.txt settings.

Install
1. Close the game.
2. Open the game folder, steamapps\common\PBZ. It holds the ProjectPBZ, Engine, platform and steam folders.
3. Vortex: install the download as usual. By hand: extract the zip into the game folder, so its ProjectPBZ folder
   merges with the game's. Either way the game needs these three files in PBZ\ProjectPBZ\Content\Paks\~mods\
   zzz_PBZAutoCollect_P.pak
   zzz_PBZAutoCollect_P.utoc
   zzz_PBZAutoCollect_P.ucas
   All three are needed, because the game ignores a .pak without its .utoc.
4. Launch the game.

Updating from 1.4.0: a missing Chests line means Off. Passive chests require Chests=On or Auto Collect Chests in the menu.
An explicit Chests=On already in your settings file stays On. Existing settings files are never overwritten.
Updating from 1.2.0 or 1.3.0: install over the top. Your PBZAutoCollect.txt stays as it is. It has no Range, PromptSize
or PromptOpacity line yet, so they start at the defaults; add a line such as Range=20 or set it in the Mods Menu.
Updating from 1.1.1 or older: install over the top. The All and Materials downloads are gone; the first start runs in
Mode=All, so set Mode=Materials if you used Materials. Later updates never touch PBZAutoCollect.txt, so your settings stay.

Uninstall
1. Close the game.
2. Delete the three files above from PBZ\ProjectPBZ\Content\Paks\~mods\, or remove the mod in Vortex. You can delete
   PBZAutoCollect.txt too.
The mod writes nothing of its own to your save. Items it picked up stay in your bag and opened chests stay open,
as if you had done it yourself.

Compatibility
The mod replaces one game script, InteractionUI.js, which draws the interact prompt. It conflicts with any other mod that replaces that file.
If a game patch changes that file, the mod rolls the change back. After a game update, remove the mod until an update is posted.
If an update renames something the mod looks for, it switches itself off and the game plays as normal.
