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
3 years ago
1.0 - 1.1
6.90K
Combat

Changelog

Version: 1.110.2
Date: 12/5/2021
  Change:
    - Add Russian localization from Gelion17
Version: 1.110.1
Date: 10/7/2021
  Change:
    - Add in a shield compression setting, so I don't have to keep local changes that aren't commited.
Version: 1.110.0
Date: 1/19/2021
  Change:
    - Version bump for 1.1
Version: 1.100.17
Date: 10/22/2020
  Change:
    - Newly placed turrets will be immune to all damage for 1 second. This prevents mods like Hero Turrets from getting your turrets killed when the turret is promoted during combat.
Version: 1.100.16
Date: 10/20/2020
  Bugfix:
    - Roll in crash fix from Bilka
Version: 1.100.15
Date: 9/30/2020
  Bugfix:
    - Do better checking for dangling shield interfaces and clean them up properly.
Version: 1.100.14
Date: 9/19/2020
  Changes:
    - One last try to get Klonan's army of followers off my back.
Version: 1.100.13
Date: 9/19/2020
  Changes:
    - Shields now default to 25 KJ per hitpoint instead of 1 KJ/HP. I failed at reading the Factorio Wiki and erroneously thought the personal equipment shields would take 1-2KJ/HP. Existing games will not be effected by this change. New games will.
    - Removed filtering on entity death to see if it resolves an issue where eletrical interfaces do not get cleaned up sometimes.
    - Experimentally removing Repair Turrets from incompatible, since I think I found the source of the duplicate entities bugs.
  Bugfix:
    - Researching non-shield technologies no longer causes shields to be refreshed.
    - Fixed issue where shields would fail to charge if size was upgraded before recharge rate. This behavior was never intended.
    - Fixed an issue where adding and removing mods would cause duplicate shield entities/power draw.
Version: 1.100.12
Date: 9/14/2020
  Change:
    - Added "max research level" setting. If you get a failure to load map that says 'Reached id limit for entity', lower the max research level to lower the total number of entities.
Version: 1.100.11
Date: 9/14/2020
  Changes:
    - Repair Turret mod is now marked as incompatible with this one. It causes some sort of duplicate entity problem.
Version: 1.100.10
Date: 9/14/2020
  Bugfix:
    - Experimental fix for rare crash during shield taking damage.
Version: 1.100.9
Date: 9/12/2020
  Bugfix:
    - More fixes related to migration from OwnlyMe's version.
  Info:
    - Added console command 'kts reset'. Use this if you have HP bars or electrical icons dangling around. It should clear them. Note: it will reset your shields to 0 and they will all have to recharge.
Version: 1.100.8
Date: 9/12/2020
  Bugfix:
    - Fix crash related to previous change.
Version: 1.100.7
Date: 9/12/2020
  Bugfix:
    - Shield bars updated to use draw_animation instead of create entities in the world. No more problems building turret walls because of 'square-0'!
    - Other entity-based animations replaced with draw_animation calls.
Version: 1.100.6
Date: 9/11/2020
  Bugfix:
    - Fixed a situation where turrets could exist without shields when they should have them.
Version: 1.100.5
Date: 9/10/2020
  Bugfix:
    - Actually disable debug logging.
Version: 1.100.4
Date: 9/8/2020
  Bugfix:
    - Global turret count now updates correctly.
Version: 1.100.3
Date: 9/8/2020
  Bugfix:
    - Crash fix. Fluid turrets were trying to update their orientation before setting their orientation.
Version: 1.100.2
Date: 9/7/2020
  Compatibility:
    - Experimental fix to make compatible with crafting_combinator
Version: 1.100.1
Date: 9/7/2020
  Bugfix:
    - Fixed bug where research setting toggle crashed game.
    - Fixed an issue where shields would be two ranks better than they were supposed to be.
Version: 1.100.0
Date: 9/5/2020
  Changes:
    - Kingdud forks this mod from the original and updates this changelog to work in-game. Any updates prior to this one that reference 'me' are not referring to Kingdud.
    - Greatly simplify backend code. Completely remove on_tick function call.
    - Remove ability to toggle power usage on/off
    - Remove ability to change most settings during gameplay (they are startup variables now).
    - Shields now use the 'energy_drain' property instead of 'power_usage', for the power drain method; basically, moving the drain to the in-game variable specifically designed to act as a drain!
    - Shields now use the internal buffer of the electric interface as the shield bar, and the inflow rate as the recharge rate. This allowed for complete removal of code that was micro-managing these actions.
    - Shields now use raw damage, rather than post-resist damage. So if you are using a modded turret with high resists, you may notice your shields now taking a LOT more damage, because your shields now have 0 resists, whereas before they were piggy-backing the resists of your turret.
    - Overall shield design is meant to be a meaningful, but modest, power draw while idle, and massive spikes (into the GW range with 1000s of turrets) during combat.
    - Removed the "No-power Penalty" from the mod. This functionality is now emulated by the energy_drain change. You lose the ability to drain power at two different rates, which never made any sense anyway.
    - Mod now uses the technology max_level property to limit infinite research to levels the mod is designed for (100 levels).
Version: 0.18.41
  Changes:
    - The mod will now register script-created turrets if the respective mod raised an event for it.
    - Fixed a possible crash (liquid-square-14..)
    - Script-removed turrets should get cleaned up correctly now.
Version: 0.18.40
  Changes:
    - Added event filter for the damaged event
Version: 0.17.38
  Changes:
    - Now ignores vehicle turrets
Version: 0.17.37
  Changes:
    - Performance Optimizations
Version: 0.17.36
  Changes:
    - Some bugfixes
    - Changed shield bars to match the new healthbars
Version: 0.17.35
  Changes:
    - updated the electric updater (fixed a crash with the new wave defense scenario)
Version: 0.17.34
  Changes:
    - fixed a crash when the passive energy consumption was set to 0
Version: 0.17.32
  Changes:
    - fixed a crash when the penalty was set to 0
Version: 0.17.31
  Changes:
    - 0.17 update
Version: 0.16.31
  Changes:
    - Added 45 more levels of charging speed (new max level: 59)
    - Fixed a possible crash with manually set shield parameters
    - Added the combinator and selection tool to the technology
    - Added support for the pvp scenario
Version: 0.16.30
  Changes:
    - Fixed multiplayer desync
Version: 0.16.29
  Changes:
    - Fixed a crash when initializing an attacking flamethrower-turret.
    - Increased damage resistances of shield combinators
    - Updated korean localization by Xagros
Version: 0.16.26
  Changes:
    - Better compatibility to other mods
    - Fix for research being unavailable, but it might show up if you have deactivated it. (No clue what mod is causing it, I have never experienced that issue.)
Version: 0.16.25
  Changes:
    - Combinators now also disable a selected amount of neighboring towers
Version: 0.16.24
  Changes:
    - Added a combinator to let you switch shields off automatically
Version: 0.16.23
  Changes:
    - Added a selection tool for disabling / enabling shields to save energy
    - Added a setting to change how much energy (percentage of maximum shield points) is consumed every second to keep the shields active
Version: 0.16.21
  Changes:
    - Added energy consumption
    - When idle, the shields draw power equal to 0.1% of their maximum hitpoints per second. If there's not enough power to satisfy this need, the shields will collapse quickly. The setting for the energy consumption multiplier can be found under "startup settings". Obviously recharging your whole base can hit your energy balance pretty hard. If you can't handle it, use the cheat "ts refresh"
Version: 0.16.20
  Changes:
    - Added support for multiple surfaces and teams
Version: 0.16.19
  Changes:
    - Improved research icons
    - Some people reported that they had to deactivate and reactivate research to make it appear. This should be fixed now. If you encounter any problems, you (player[1]) can enter "ts refresh" to refresh everything. (but please create a bug report anyway)
Version: 0.16.13
  Changes:
    - Optimized textures for low graphics settings
    - If you were researching one of the technologies before 0.16.12, the game won't display the current progress but is still researching (but it might have resetted the progress). you can check the progress by switching to another technology and switching back.
Version: 0.16.12
  Changes:
    - Reduced research cost
    - Added an alternate animated shield effect based on Lux's shield from League of Legends, � Riot Games
    - https://jasonkeyser.deviantart.com/art/Star-Guardian-Lux-s-W-Shield-VFX-617744636
    - "Turret Shields" isn�t endorsed by Riot Games and doesn�t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends � Riot Games, Inc.
Version: 0.16.10
  Changes:
    - Fixed shieldbar-length of flamethrower-turrets when the turret is attacking
    - (when they are oriented vertical, they have shorter healthbars than horizontal)
Version: 0.16.8
  Changes:
    - Added seperate graphics for flamethrower-turrets
Version: 0.16.7
  Changes:
    - Added localization for korean (thanks to Xagros), russian (thanks to Cheshirrski) and german (by me)
    - Added a visual effect when a turret is hit. The opacity scales with absorbtion.
    - (Self-made graphics, maybe I can get permission to add better ones from a real artist soon)
Version: 0.16.6
  Changes:
    - Fixed a small mistake in a technology description
Version: 0.16.5
  Changes:
    - Fixed a crash when researching
    - Fixed localization
    - (sorry i was in a hurry yesterday)
Version: 0.16.4
  Changes:
    - Fixed that Turrets were almost unkillable
    - Fixed a crash when deconstructing script-created turrets
    - Added research
Version: 0.16.3
  Changes:
    - Added Shield bars
Version: 0.16.2
  Changes:
    - Fixed that shields didn't work on script created entities