BatterySystem 1.6.0

Please do not ask when mod authors will update their mods to 3.9.X
Bothering mod authors will lead to warnings and repeat offenses will lead to eventual bans.

Electronics now require drainable batteries.

Huge thank you to Jiro for making this mod!

This mod is not mine, I have only refactored the code & fixed some of the largest issues!

Features

  • All Headsets, Tactical devices, Sights & Thermal/NVGs now require batteries and have a slot reserved for them. Batteries are drained over time when the item is equipped and in use.
  • Without batteries Sights lose their reticle (you can still see through them!) and NVDs & tactical devices won't work.
  • Bots have batteries in their gear & backpacks. Lower level enemies generally have more drained batteries.
  • Several crafts in the hideout make it possible to recharge & make batteries.
  • Device description lets you know which battery type is required, but generally headphones always take AAs, Sights take either AAs or CR2032s, Holographic sights (like EOTECHs) and flashlights take CR123s.

Replaces Existing items:

D Size Batteries => CR2032 Batteries

Rechargable Batteries => CR123 Batteries


Installation

  1. Install like normal: Drop the extracted user/ and BepInEx/ folders into your SPT installation folder.
  2. Refresh Item Icons: After starting the Server, in Launcher click Settings > Clean Temp files.

Compability

BatterySystem conflicts with any mod that modifies D Size Battery or Rechargable Battery.

Any mod that alters hearing (such as a deafening effect) won't probably work well with unpowered headsets. I recommend disabling BatterySystem for headsets in the F12-menu.


Adding compatibility for custom electronics such as collimators:

  1. Open up order.json in your SPT-AKI/user/mods/order.json
  2. Add the folder names of your mods that add electronics. Add Jiro-BatterySystem after them:

JSON: order.json

Code
{  
    "order": [    
        "CustomSightModFolderName",    
        "AnotherCustomSightFolderName",    
        "Jiro-BatterySystem"  
    ]
}

Custom electronics default to using CR2032 batteries.


Written permission from Jiro to publish this updated version:

  • Version 1.6.0

    Tested with SPT 3.9.4

    • Updated to work with SPT 3.9.4
    • Fixed bug where game would soft lock when you entered a Mounted Firearms
    • Reworked battery spawning to be compatible with Realism Mod (Bots will now have batteries)
    • Headphones that attaches to helmets now use batteries
    • Tactical devices attached to helmets now use batteries
    • Flashlights & Lasers are now always turned off (not only visually) when out of battery, which should fix desync & bots seeing lights that dont have batteries
    • Some work on WIP feature "folding" backup sights (not working yet)
    • Refractored almost all code (should be a lot easier to add new features now)


    ^ Work since Jiro's last update

  • Is there a way to ensure tactical devices spawn with batteries when playing as scav?

  • i put the files in SPT folder and suddnley i see this


    TypeError: Cannot read properties of undefined (reading 'length')

    TypeError: Cannot read properties of undefined (reading 'length')

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:717:88)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.processInventoryType (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:689:22)

    at CustomItemService.processBotInventories (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:638:18)

    at CustomItemService.postDBLoad (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:81:18)

    at SianydeAndACRiness.postDBLoad (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\mod.ts:69:32)

    at PostDBModLoader.executeModsAsync (C:\snapshot\src\loaders\PostDBModLoader.ts:63:45)

    TypeError: Cannot read properties of undefined (reading 'length')

    TypeError: Cannot read properties of undefined (reading 'length')

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:717:88)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.addModsToItem (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:718:50)

    at CustomItemService.processInventoryType (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:689:22)

    at CustomItemService.processBotInventories (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:638:18)

    at CustomItemService.postDBLoad (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\CustomItemService.ts:81:18)

    at SianydeAndACRiness.postDBLoad (D:\SPT\user\mods\WTT-SianydeAndACRiness\src\mod.ts:69:32)

    at PostDBModLoader.executeModsAsync (C:\snapshot\src\loaders\PostDBModLoader.ts:63:45)




    any ideas whats going on?

    • sound like a bug related to some wtt mod I don't know about, try disabling it and see if the error persists

  • Hey thanks for taking on this project! Any way you'd consider adding a config to make batteries required but keep them a non-drainable resource? As in finding the batteries themselves is the only requirement.

  • Dumb question, but is there any way to make this compatible with Merge Consumables?

  • Quote

    D Size Batteries => CR2032 Batteries

    Rechargable Batteries => CR123 Batteries

    I can find CR2032 Batteries in the crafting and for barter, but I cant find CR123 Batteries in crafting or traders or flea. Though I did not check the lavatory. CR123 Rechargeable battery shows (0) in flea.

  • Is there a way to manually define batteries to custom mods or is it just not supported at all?

  • I get this in server when loading a raid.


    • You should load this mod after Algorithmic level progression mod, I think it will fix the issue.

    • I dont use that mod.

    • Strange, I thought that cased an issue. Maybe you have other mods that change bots loadouts? Try to load this mod after them

    • I do have acids bot progression but I'm fairly certain I had this load after it. I'm testing just in case so you will hear back from me shortly :)

    • Nah, it still happens when this is loaded last. Must be a conflict or something if you aren't getting these.

  • Will there be a way to recharge them batteries?🤔

    Could be part of the workbench or generator part of the hideout.

    Thumbs Up 1
    • For those who thougt: "Dude, I have a generator, but I have no way to recharge my batteries directly from it"

      LOOK NO FURTHER!! WE PRESENT TO YOU THE:

      "Generic-Co Universal Battery Charger (TM)"


      Simply Paste The following code below (Production.json)

      Simple craft added to the generator in the hideout to recharge the batteries slowly but pasivelly. Edit to your heart content.

      ©️ JowM

    • So, how do I go about copy pasting it to said file? New to this and and I'd like to know which file, and where to paste it

      Thumbs Up 1
    • i have added this recharge crafts to the mod MoreHideoutCrafts i ported to 3.9

      in this way you do not need to edit any game file


      MoreHideoutCrafts - Fixed

  • problem using t12w and eotech hhs. when switching hhs aiming

  • How does this work when dying?


    You can't insure batteries. Do they stay in gear with insurance?

    • I can insure my batteries (but that might be some other mod idk), but otherwise no, you lose them

  • Game crashes every time I open Skier's tab, disabling the mod solves the issue. Any idea of what could be causing it? I've put this mod at the end of load order


    • This can happen if you have too many items from mods sold by one merchant, "assort" error. It can be fixed by reducing the amount of goods sold by the Skier, for example you can change seller of other modded items to another trader, or change seller of batteries in this mod.

      So it's not this mod error I think, probably just famous "assort" bug.

    • Thank you, I've been modding tarkov since september last year and wasn't aware of this issue until now

  • Is it still buggy with Realism Headset ?

    • Haven't touched that so probably yes. Haven't noticed any issues though...

  • omg ;( ;( ;( ;( :thumbup: :thumbup: :thumbup:

  • Nice one !

  • SICK

    Happy 1