Skip to content

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Dec 31, 2025

Separate the presence of a Hull (a marker indicating ship-like integrity) from an entity's health by creating a new Health component. This allows the creation of entities that have health and can be weapons targeted, but otherwise aren't treated as having repairable ship hulls for the purposes of AI targeting or threat estimates, and aren't selectable by Science or Relay unless they also have the Hull component.

This remains backward compatible in scripting by translating set/getHull... Lua functions into respective set/getHealth... functions, and adding the Hull component if the set/getHull... functions are used.

This PR does not change the default behaviors of any entities. Existing mechanics and scenario behaviors should remain fully unchanged. The Hull component is retained to ensure that existing entities behave exactly as they did before in player-facing user interfaces, AI targeting, DockingBay repairs, and Relay/Science radars without also requiring arbitrary entities with trackable Health and damage/destruction callbacks to share those properties.

Targeting thus intentionally might not align with GM/scenario writer/player expectations. For example, entities lacking a Faction component and granted Health but no Hull components are Neutral by default faction relationship. This means they can be targeted by weapons and tracked by homing missiles, but can't be fired upon by beam weapons unless granted a hostile FactionRelation, which is consistent with existing behavior.

Such entities also can't be targeted by Science unless granted a Hull, scan description, or level, or targeted by Relay unless granted a Hull or scan state, or share short-range radar, which is consistent with existing behavior of non-Hull entities. If granted a scan state or short-range radar, Relay might present them as hackable but lacking any systems to hack, which is consistent with existing behavior.

With some difficulty, scenario writers and modders can use the Health component to address #2550, or to implement unticketed Discord requests to target and script events on damage and destruction of arbitrary entities, without also giving those entities unwanted ship-like properties via the Hull component. For example, firing beams at asteroids, whether to clear them or to script mining actions on them via callback, would require granting all asteroids a universally hostile faction.

Separate the presence of a Hull (a marker indicating ship-like
integrity) from an entity's health by creating a new Health
component. This allows the creation of entities that have health
and can be weapons targeted, but otherwise aren't treated as
having repairable ship hulls for the purposes of AI targeting or
threat estimates, and aren't selectable by Science or Relay unless
they also have the Hull component.

This remains backward compatible in scripting by translating
set/getHull... Lua functions into respective set/getHealth...
functions, and adding the Hull component if the set/getHull...
functions are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant