Skip to content

Scanner

A Scanner is the destructible component that provides radar and scan capabilities to a Ship or Station. Like Shield generator, the scanner datatype declares no own properties — its capabilities are exposed at the parent Controllable level.

Inheritance: component → destructible → scanner. Extends destructible directly, not object.

There are no scanner-specific properties (scriptproperties.xml:1160). Use:

  • Inherited from destructible: .hull, .hullpercentage, .parent

Parent-side accessors (where scanner state actually lives)

Section titled “Parent-side accessors (where scanner state actually lives)”
Parent property (on Controllable)Description
.hasscannerHas scanner software installed
.longrangeHas long-range scanner software
.maxscanlevelHighest scan level (1-3 in vanilla)
.software.longrangeCurrently installed long-range scanner ware

Reading Ship.maxscanlevel is the canonical “what can this ship scan” query — used heavily by vanilla scenarios for secrecy mechanics.

”Is this ship scanner-capable enough to read a module’s secrets?”

Section titled “”Is this ship scanner-capable enough to read a module’s secrets?””

Pattern from vanilla scenario_tutorials.xml:10568, 10601:

<do_if value="$module.revealedpercentage gt 0
and $module.revealedpercentage lt 100
and $module.secrecylevel gt player.ship.maxscanlevel">
<!-- player needs better scanner to fully reveal -->
</do_if>

The .secrecylevel on the target module is the “lock level”; .maxscanlevel on the scanning ship is the “key level”. Player needs ≥ secrecy to fully reveal.

”Does the player have long-range scanner installed?”

Section titled “”Does the player have long-range scanner installed?””
<do_if value="player.ship.longrange">
<!-- long-range scan available -->
</do_if>

Pattern from x4ep1_mentor_subscription.xml:1812, modes.xml:34 (negated for error gating).

<find_object_component
name="$Scanners"
multiple="true"
object="$Ship"
class="class.scanner"/>

Use this only when you need to read scanner-component damage state. For “can this ship scan”, read the parent’s .hasscanner / .maxscanlevel directly.

No event_scanner_X family. Standard component events:

EventWhenNotes
event_object_destroyedScanner destroyedFilter on class.scanner. Parent’s .hasscanner becomes false
event_object_attackedScanner attackedStandard
  • Scanner declares NO datatype properties. Same pattern as Shield generator — all capability state on the parent.
  • scanner extends destructible, NOT object. No .sector directly.
  • maxscanlevel is the MAX, not current. A ship in combat may have its effective scan level reduced by damage; maxscanlevel reports the equipped maximum.
  • Long-range vs short-range are distinct softwares. Ship.longrange is true only with the long-range scanner ware installed; standard scanner sets .hasscanner but not .longrange.
  • NPC ships have scanners too, with their own maxscanlevel. Don’t assume only the player needs to be scanner-checked.
  • Secrecy / reveal mechanic: Architectural overview Scan mechanic — how .secrecylevel on targets gates information disclosure based on scanner .maxscanlevel.
  • Long-range scan usage: Architectural overview Long-range mode — UI mode that depends on .longrange ware.
  • Ship — host; .hasscanner, .maxscanlevel, .longrange live here.
  • Station — also hosts scanners.
  • Controllable — the parent type that aggregates scanner accessors.
  • Shield generator — sibling empty-datatype destructible.
  • Engine / Weapon — sibling destructible components (these DO have datatype properties).
  • Wareware.software_scanner*, ware.software_longrange* are the equip-able items.