Dynamic Loot Pools & Tool Update#4
Conversation
…system - Expose `GetAllTarkovItems` in `sh_tarkov_inventory.lua` to allow server access to item registry. - Replace hardcoded `LOOT_POOLS` in `sv_tarkov_loot_bridge.lua` with dynamic generation based on item types (Weapons, Ammo, Gear, Medical, Entities, etc.). - Fix syntax error in `hook.Add` and typo in `LOO_POOLS` in `sv_tarkov_loot_bridge.lua`. - Update `tarkov_loot.lua` tool to include buttons for new categories: Ammo, Gear, Entities.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…system - Expose `GetAllTarkovItems` in `sh_tarkov_inventory.lua`. - Replace hardcoded `LOOT_POOLS` in `sv_tarkov_loot_bridge.lua` with dynamic generation logic. - Fix syntax errors (hook arguments, typos) in `sv_tarkov_loot_bridge.lua`. - Update `tarkov_loot.lua` tool with buttons for new categories (Ammo, Gear, Entities).
- **Dynamic Loot Pools**: Replace hardcoded loot lists with `BuildLootPools`, which auto-categorizes items (Weapons, Ammo, Gear, Medical, Entities) from registered addons. - **Tool Gun Update**: Add buttons for new categories (Ammo, Gear, Entities) to `tarkov_loot.lua`. - **Close with E**: Players can now close an open loot container by pressing 'Use' again (with a 0.5s spam delay). - **Persistence**: Loot containers now correctly remember if a player has searched them, allowing instant re-opening. - **Fixes**: Corrected Lua syntax error in `sv_tarkov_loot_bridge.lua` and ensured `GetAllTarkovItems` is exposed.
- **Loot Logic**: Implemented dynamic item categorization (weapons, ammo, gear, etc.) from registered addons. - **Controls**: Restored `Ctrl+Left Click` for quick-moving items (Equip/Loot/Store). - **QoL**: Implemented "Press E to Close" with spam prevention delay. - **Bug Fix**: Fixed individual items acting as loot crates by refining entity class checks. - **Bug Fix**: Added `Think` hook to auto-close inventory when moving away from the cache. - **Tool**: Updated Admin Tool with new category buttons.
This change updates the Tarkov loot system to dynamically generate loot pools from installed addons and registered items, rather than using a hardcoded list.
Key changes:
sh_tarkov_inventory.lua): AddedGetAllTarkovItems()to expose the localITEMStable.sv_tarkov_loot_bridge.lua):LOOT_POOLSwithBuildLootPoolsfunction.hook.Addand a variable typo.InitPostEntityhook to build pools after items are registered.tarkov_loot.lua): Added UI buttons for the new loot categories.This allows the loot system to automatically adapt to the user's installed content and provides more granular control over loot spawning via the tool gun.
PR created automatically by Jules for task 16686827516742099758 started by @Cautioncrazy