Skip to content

Allow mods to set threshold at which shield stops taking damage#6847

Merged
wookieejedi merged 7 commits into
scp-fs2open:masterfrom
wookieejedi:shield-threshold-exposure
Jul 19, 2025
Merged

Allow mods to set threshold at which shield stops taking damage#6847
wookieejedi merged 7 commits into
scp-fs2open:masterfrom
wookieejedi:shield-threshold-exposure

Conversation

@wookieejedi

Copy link
Copy Markdown
Member

FSO logic dictates that shields collisions and any related sound or visuals related to shields are skipped if the shields are under 10%. This is rather unintuitive especially for mods, so this PR creates a game setting value that allows mods to set this value.

Also, this PR fixes a bug where the HUD shield gauge would try and incorporate this feature but did not do it correctly. Specifically, the gauge skips shield segment rendering if the raw shield strength was 0.1 not the percent. Incorrectly using the raw value results in HUD shields being rendered (albeit faintly) even if the damage was skipping the shield and directly damaging the hull. In other words, if the shield segment was 8%, the shield segment would show faintly even the shield is skipping damage.

Tested and works as expected. Also happy to discuss or answer any questions!

FSO logic dictates that shields collisions and any related sound or visuals related to shields are skipped if the shields are under 10%. This is rather unintuitive especially for mods, so this PR creates a game setting value that allows mods to set this value.

Also, this PR fixes a bug where the HUD shield gauge would try and incorporate this feature but did not do it correctly. Specifically, the gauge skips shield segment rendering if the raw shield strength was 0.1 not the percent. Incorrectly using the raw value results in HUD shields being rendered (albeit faintly) even if the damage was skipping the shield and directly damaging the hull. In other words, if the shield segment was 8%, the shield segment would show faintly even the shield is skipping damage.

Tested and works as expected. Also happy to discuss or answer any questions!
@wookieejedi wookieejedi added enhancement A new feature or upgrade of an existing feature to add additional functionality. general modding A general feature or issue related to modding capabilities of FSO labels Jul 17, 2025
@wookieejedi wookieejedi merged commit 26e9eca into scp-fs2open:master Jul 19, 2025
20 checks passed
@wookieejedi wookieejedi deleted the shield-threshold-exposure branch July 19, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A new feature or upgrade of an existing feature to add additional functionality. general modding A general feature or issue related to modding capabilities of FSO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants