King's Turret Shields

by Kingdud

Forked from Turret-Shields by OwnlyMe. Cleaned up the code, removed a lot of options, internal tweaks to how power and damage affect the shield. Lightweight scripted shields with power consumption (configurable or researchable)

Content
2 years ago
1.0 - 1.1
6.58K
Combat

b Game crashes when dismantling a turret

3 years ago

Hello

I replaced the original Mod from OwnlyMe with yours because I think your changes are great. Especially the continuous power consumption of the active shields.
So I deactivated the "old" mod and activated yours.
The first thing I noticed was my turrets weren't charging.
Only newly built turrets charge.
But when I tried to dismantle a turret, the game crashed with the following message:

https://drive.google.com/file/d/1XjPXAWn1g2bI_eZuc-1LQ6ZWyLl0iMXm/view?usp=sharing

I play with some mods. Amongst other things:
Krastorio 2
Space exploration
Shock turrets
repair turret
some Schall mods
And many other mods ...

3 years ago
(updated 3 years ago)

sigh this mod is really breaking my balls. The problem is fixed in the latest (.8) version. I missed one spot where I changed the code over from using entities for the shield HP bars to just drawing animations. Edit: I only fixed the crashing problem. The turrets not having shields...that should work. More to test.

3 years ago

I just tested migration from OwnlyMe's to mine, and it worked. My existing turrets had shields. Can you give me steps to reproduce that?

3 years ago

Wow your reaction was quick!

Yes, the crash is fixed. It no longer crashes when removing the turrets.

Before I replaced the OwnlyMe mod with yours, I deactivated some turrets with the "turret shield toggle".
Now I have the problem that the plug symbol no longer disappears when I reactivate the shields with your mod. If I then dismantle this turret, the plug symbol still remains.
The power grid information now also shows me twice the number of shields. And I have "ghosts" charge bars where my turrets are. If I dismantle my turrets, the "ghost" charge bars still remain. And these cannot be removed.

I activated the OwnlyMe mod again and loaded my old save. Here I activated all shields with the "turret shield toggle" tool to at least fix the error with the plug symbol. Then I swapped the mod with yours again. This can correct the error with the plug symbol. But not the bug with the "ghost" charge bar.
See photo:

https://drive.google.com/file/d/10HlG--CRRmOtHuJvXECkf6i4aTXJKCcN/view?usp=sharing (with plug icon)

https://drive.google.com/file/d/1mq3WoSV8-Y2W-bFq8pQD524IuxJHBuy2/view?usp=sharing (only charge bar)

Now I noticed that the "turret shield toggle" tool does not deactivate the shields. The plug icon appears, but the shields remain active. The power consumption as well.

I don't know how to reconstruct the error for you. Or explain ... It's an older game that I've been playing for a few hours. But if OwnlyMe's mod has been used since the beginning of this world, your mod should work fine. Or not?

3 years ago

I couldn't figure out the root cause of why this happens, but I put in a way that should fix it. Open chat and type in 'kts reset'. It will cause all of your shields to reset to 0 and recharge, which may be an issue if you're under attack or barely have enough power, but it should clear all the dangling stuff from migration up. If not...idk man. I never ran into these problems when I moved over. But I also never...I ported the mod for exactly my use case, and when it comes to things like shield disablers, I just kinda hoped they worked. If not, I'm more likely to just remove them rather than support them.

3 years ago

Unfortunately, I cannot enter the console command. Then the achievements are no longer available for me ...
Can't you insert a button that triggers the reset? Kind of a debug button.
Or a reset interval to 5 minutes in the options. Activate once, let it trigger, then deactivate again. (As an emergency idea)

Removing the "turret shield toggle" tool is not the solution I would have liked ... I hope you don't!
I had enormous energy problems recently. I had to deactivate the shields. I ran out of coal. Only after resolving my energy problem was I able to reactivate the shields. But if you remove this feature, what then?

Now please don't tell me "Then take the Mod from OwnlyMe" ...
You thought out your mod well. Also with energy consumption. I would like to keep that.

Please don't get me wrong now ...
Maybe you don't feel like repairing the mod?
You say you ported them for your purpose. I assume you don't really have the interest in making your mod for the general public.
You can see how many players want your mod.
It would give me an incentive.
But unfortunately I can't do it myself.

I also read in another post that you do not support the function for the Repair Turret. I also use this mod.

I read elsewhere that you cannot display the shield strength under "Bonuses". Is difficult, I believe you ...
The Shock Turret is also displayed under "Bonuses".
Maybe this mod would give you some help on how to build that?

You have so many opportunities to improve the mod.
I hope you don't choose against ...

3 years ago
(updated 3 years ago)

It's not a console command. It's just something you type in chat. IE: Not /kts reset, just 'kts reset'. Also, playing with mods disables achievements anyway. The warning you see is about using console commands is B.S. once you start using mods.

For power problems: I have a mod, NuclearRebalance, that makes nuclear energy far more UPS efficient and, as a side effect, much more balanced. When you get to the point that you can start plopping down 500MW reactors like they are candy, scaling your base becomes a lot easier. And once you get the MSR unlocked, and you are plopping down 1.5GW reactors like they are candy (it's not that easy...each MSR takes a LOT of materials to build!) power issues are a thing of the past. Add in some of my Enhanced Energy Grid Storage to soak up any nasty power spikes (the Grid-Scale Flywheel Energy Storage specifically) and you're golden. As an added bonus, you can build satellites using those same enhanced energy stores and get (I forget if it's 10k or 16k) science per rocket launch. The science you get was based on the materials cost of building one deep space probe vs 1 normal satellite. I think one DSP is roughly 16x the material cost of one normal satellite, thus, 16x the science out.

Why..yes, I did make a bunch of mods specifically so my own end game would play out the way I wanted to. :p I uploaded most of my mods purely 'just in case' other people wanted to use them. If I had made turret shields from scratch, it would take gold science just to research the most basic shields. I don't say this to sound mean or anything, rather...just sharing my mental state. The mods I made myself tend to be quite brutal (compared to other mods) in their requirements/balance and only for late-game use.

3 years ago

Not quite right ...

Modded Factorio offers its own achievements. And I'm working on them.
But if your command doesn't do any harm, I'll use it.

It almost sounds like you want to torture yourself with your own mods. xD
I do the same with my games. But not with extra heavy mods, but an extra heavy gameplay.
That means I don't use atomic energy until much later. And I build a lot of steam engines. The more steam engines I need, the more difficult it becomes to supply them with fuel. So I always have to find new solutions.
Since I also use AAI Industry and Bio Industries, I am opening up more opportunities.
Your nuclear power plant mod sounds exciting ... And I like balanced mods best. But I'm already using a mod that builds in more realism. "Realistic Reactors".
Also a mod that removes the Covarex enrichment.
I make it pretty hard for myself as you can see ...
But I'm a little ... slow in setting up science pack production. I take a lot of time with everything. So I was surprised that the research for improved shields is needed for the science packs for utilities.
This is real torture! : p

Then the Turret Shield Mod is actually only intended for lategame? Hmm ... the thought is actually not wrong. But ... Since I want shields relatively quickly, complicated for me. Since I play with will-o'-the-wisps, my turrets take a lot of damage. Without shields, or without repair turrets, almost not playable. Because then I have to run to every corner of my base and replace broken turrets, or repair damaged turrets.

How many shield points does the first shield research have again?
200? I think that's okay! OwnlyMe's Mod only 50, with no improvement.
If improvements of up to 2000 shield points require expensive research, that's realistic.

Still, I would be grateful if you repaired the "turret shield toggle" tool instead of throwing it out ...
I also use the combiner and have connected it to a switch. (Switch Button by GalactusX31 updated for 1.0)
I have control over the shields at all times! I like this ...

3 years ago

I wrote a reply to this yesterday but apparently never pushed 'submit'. Lame!

Shield HP, Recharge rate, Power Drain, and Energy Multiplier are all configurable settings in the mod. One important thing to know, 1 unit of shield is 1kj * energy multiplier.

Power Drain, which is the power it takes to keep a shield running and fully charged, is a % of total Shield HP. You can set it as low a .1%, but it defaults to 10%. Thus, a shield with 10,000 HP takes 1 MW to keep powered when idle. At .1%, it would take 10kW.

Energy Multiplier defaults to 2. It can be set as low as 0.01 and as high as 100. So if you have a 100 HP Shield with a 2 multiplier, the shield actually takes 200KJ to fully charge. With a 0.01 multiplier, that same shield would only take 2Kj to charge. This setting also affects charge speed under the covers. If that 100 HP shield is configured to recharge at 10HP per second, then it would, with a multiplier of 2, charge at 20KW. With a 0.01 multiplier, it would take 200 watts. Energy Multiplier isn't a number you really need to think about. If you say "I want a 200 HP shield that recharges at 20HP/s" then the game will make that happen and the energy costs will just change in the background. I explain it here just to show that there is something going on in the background.

These settings all take a restart of the game to change, but you can make the power impact of shields so small that it may as well not exist.

New response