Schall Primary Battery


Adds non-rechargeable battery equipment, which can be crafted in the early game, and much cheaper than portable solar panel in short-term. Options on enable grid to early armours. Designed for “Schall Recharging Weapon” mod or as backup power to equipment grid. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro, Русский)

Content
3 years ago
0.17 - 1.1
2.34K
Armor

i [Solved] Make them disappear when empty

4 years ago

Hello, can you make your Batteries disappear from the Grid, when they are empty.

4 years ago

This can be useful, but probably limited by API events available.
It is because any "automatic" actions have to be executed from an event. But currently there are no events that get triggered (or anything relevant) to equipment energy level.
There is still a single final event "on_tick" that always works. For single player the UPS hit can be negligible, but constant checking of all equipment for their energy level for each player can be CPU-intensive for multiplayer game. So it is a powerful event, but at a great cost.
Anyway, inserting equipment (like new battery) have to be done manually, so I don't see a big benefit for auto equipment removal. The benefit is not great enough to offset the constant CPU-load by on_tick event.

If there are any events that are triggered by equipment energy level, I may reconsider this. But seems not for now.

4 years ago

Hello, back, I think you are seeing it wrong, cause, without auto-removing the empty batteries, you have to check every battery for its charge and then remove it manually, with this feature, the empty batteries would simply vanish and you could then also simply shift-click the full batteries into your armor, didn´t you know, that you can shift-click equipment into your armor?

4 years ago

Still, nothing can really be "auto" unless it is a built-in feature. Mods have to attach a non-vanilla feature to some events (as mentioned above) to make it looks like "automatic". It is a matter of finding a "suitable event" for a smart conditional trigger.

Of course I know the shift-click insertion. But isn't shift-click the full battery still a "manual" action?

But anyway, just an idea pops up in my mind, but still not as "auto" as you wanted.
I have something similar to my defense equipment reload/unload script in my mod Schall Gun Pod. That mod is doing checks on energy level of those defense equipment, then calculates how much ammo is consumed/returned. Those actions are triggered by hotkeys or shortcuts.
I can borrow the script. But this time it performs actions only on primary battery equipment. When hotkey/shortcut triggers, the script removes that if the power level is very low or near zero, and checks if full battery of same type is in inventory, and consumes that. I would call it a "Replace empty battery" hotkey/shortcut.
This requires a "manual" trigger (hotkey/shortcut), so still not "fully auto". But I guess this will be even more convenient than auto-remove empty batteries + shift-click insert full batteries.

4 years ago

Hello back, yes shift-clicking is still manual, but its still better , because you don´t need to place every single battery, I think the shortcut is a good alternative to my idea.

4 years ago

Just released 0.17.4.
The new shortcut should help.

4 years ago

Hello, and thank you so much for implementing it.

New response