Starbound

Starbound

36 ratings
Shield Status Effect Fix
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
12.764 KB
9 Nov, 2018 @ 12:36pm
10 Nov, 2018 @ 8:19pm
2 Change Notes ( view )

Subscribe to download
Shield Status Effect Fix

Description
"Fixes" the issue shields have where status effects are still inflicted from an attack even if you blocked said attack.


Interestingly, I found out by looking at the code regarding this issue that it is NOT intentional, but an oversight; there is code in place to make sure shields also block status effects, but it is run after the status effect is already inflicted. As such, it does not do anything.

Some people I'd think would believe this to be intentional, though. As such you may call this a "tweak" if you'd like but for me I'm sticking with calling it a fix.


Enjoy, and please report any bugs.



Updates



1.1

Changed method of fixing the bug to hook into player_primary.lua rather than replace it.


In layman's terms, this improves mod compatibility.


Big thanks to bk3000 for reminding me of this method and providing the code for it!
8 Comments
Amalgamama  [author] 9 Mar, 2021 @ 9:15am 
Yeah it shouldn't screw with your save files, Qbi. If you run into any issues with it uninstalling it should be fine.
Qbi Wan 9 Mar, 2021 @ 1:17am 
It's always nice to know this game it being fixed by community... despise that it's abandoned by devs ;P
Is it safe for save game to uninstall it in future?
Amalgamama  [author] 10 Nov, 2018 @ 4:56pm 
I'll also be sure to credit you for reminding me of that. Thanks again!
Amalgamama  [author] 10 Nov, 2018 @ 4:53pm 
Thanks for the advice BK. I've heard of that method of patching Lua files so they aren't overwritten before; Honestly I'm just terrible at it for some reason, and it slipped my mind to use it in this mod... But I can give it a shot when I'm not busy later. Thanks for the advice! I'll be sure to update the mod with the method you speak of soon enough...
bk3000 10 Nov, 2018 @ 3:38pm 
Basically it would be like this. Make a player.config.patch file first.
https://pastebin.com/jqhirkKm

Then make a file in /stats/ called skipper_shieldFix.lua
https://pastebin.com/wpXt4R9u

That's replacing only the applyDamageRequest function while leaving the rest of the player's _ENV intact. It backs it up and runs the old one in the event the damage isn't shield related. After all there are mods that also hook that function.
bk3000 10 Nov, 2018 @ 3:14pm 
The way you did it - replacing player_primary.lua - is gonna break a lot of mods that hook the player scripts. I can help convert this to something that won't break others if you like.
Amalgamama  [author] 10 Nov, 2018 @ 11:16am 
Glad to hear, anxietymuppet. If it stops working as intended please let me know :)
anxietymuppet 10 Nov, 2018 @ 5:58am 
thanks, works perfectly