Skip to content

Segmented unit info #320

@EphDoering

Description

@EphDoering

This is just tracking knowledge on how segmented units are implemented and api access or lack thereof.

The entity that visually is the head of the segmented unit has type segmented-unit. The rest of the segments, including the tail, are entities of type segment.

The number (and type) of segments are available in the data stage but as far as I can tell are not available at runtime.

LuaEntity.neighbours doesn't work on them. commandable is nil for both the unit and segments.

However, the unit numbers are consecutive starting from the head going to the tail. A function to find entities of type segment or segmented-unit and correlating via unit_number should be sufficient for piecing them together if required.

Surface find functions

find_enemy_units and find_units, true to their descriptions, only find type unit. So they don't find these.
find_nearest_enemy does find them though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    combatTopic. Has to do with fighting, weapoinry, etcspace agerequired to support the Space Age expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions