forked from Crimso777/Factorio-Access
-
Notifications
You must be signed in to change notification settings - Fork 13
Segmented unit info #320
Copy link
Copy link
Open
Labels
combatTopic. Has to do with fighting, weapoinry, etcTopic. Has to do with fighting, weapoinry, etcspace agerequired to support the Space Age expansionrequired to support the Space Age expansion
Metadata
Metadata
Assignees
Labels
combatTopic. Has to do with fighting, weapoinry, etcTopic. Has to do with fighting, weapoinry, etcspace agerequired to support the Space Age expansionrequired to support the Space Age expansion
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.