add show_health_bar attribute to toggle health bar visibility - #966
Open
anasdhaoidi wants to merge 12 commits into
Open
add show_health_bar attribute to toggle health bar visibility#966anasdhaoidi wants to merge 12 commits into
anasdhaoidi wants to merge 12 commits into
Conversation
Collaborator
|
One design note, i think u should use enum for this instead of 2 bool, your table doesn't cover the fourth case where Instead enums like And if you do end up implementing that, pls add that to the python docs because modders would definitely have a hard time looking that up in cpp code |
Loup-Garou911XD
requested changes
Aug 24, 2026
Collaborator
Collaborator
|
Also would be nice if you added python documentation for the sheild |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

show_health_bar— Shield Node AttributeOverview
show_health_baris anintattribute on theshieldnode that controlswhen the health bar is rendered above a shield.
Default value:
1(briefly)Values
012Usage
Why This Attribute Matters
1. Visual-only shields
Some mods use the shield node purely as a visual effect — a glow around a character,
an environmental aura, or a decorative ring. In these cases the health bar is meaningless
noise that breaks the visual presentation.
show_health_bar = 0removes it cleanlywithout touching any other shield behavior.
2. Intentional information hiding
In mods, a designer may want certain shields to be secret — hidden
from the player entirely. Before this attribute, the health bar would always betray the
shield's presence the moment it took damage. Now it can remain invisible even under fire.
3. Completing the control surface
Before this addition, the engine only offered two states via
always_show_health_bar:There was no way to say never show.
show_health_barfills that gap and gives modauthors full, explicit control over health bar visibility with a single attribute.
4. Runtime flexibility
Because it is a proper node attribute, it can be toggled at any point during gameplay —
useful for mechanics where a shield becomes "revealed" under specific conditions, or
where UI visibility changes based on game state.
Changes from Previous Design
The original implementation used two separate
boolattributes:always_show_health_barboolshow_health_barboolThis created an ambiguous fourth case: what happens when
show_health_bar = Falseandalways_show_health_bar = True?Does always win or does never win? The behavior was undefined
and unintuitive for modders.
The new
show_health_barint attribute replaces both with a singleenum-style value — every combination is explicitly defined, nothing
is ambiguous:
always/show)show_health_bar)False/False0(disabled)False/True1(briefly, default)True/True2(always)True/FalseImplementation Notes
Registered via
BA_INT_ATTR_LATEinShieldNodeTypeand evaluated inShieldNode::Draw()using an internalHealthBarModeenum:The default value
kBriefly(1) preserves original engine behavior —no existing mods are affected unless they explicitly set
show_health_bar.