Highway
A Highway is a Zone subtype that lets ships travel at high speed along a fixed route. Two flavours:
| Flavour | Connects | .islocalhighway | .issuperhighway |
|---|---|---|---|
| Local highway | Two zones inside the same sector | true | false |
| Superhighway | Two clusters | false | true |
Inheritance: component → space → zone → highway.
Properties
Section titled “Properties”Highway-specific
Section titled “Highway-specific”| Property | Type | Description |
|---|---|---|
.isdisabled | bool | Highway disabled (only via custom gamestart) |
.origin | zone | The zone the highway starts from |
.destination | zone | The zone the highway leads to |
.junctions | list | Zones along the highway path |
.entry | highwayentrygate | Entry gate (the visual portal at the start) |
.exit | highwayexitgate | Exit gate (the visual portal at the end) |
.entryjumpgate | gate | Jumpgate that leads INTO this highway (for highway-after-gate flows) |
.exitjumpgate | gate | Jumpgate this highway leads INTO |
.closestpointtoplayer | position | Closest point to player in highway coords (x=y=0, z=0..1) |
Inherited from zone
Section titled “Inherited from zone”.islocalhighway / .issuperhighway (from zone) are the discriminators. Plus all zone accessors apply (since highway IS-A zone).
Common patterns
Section titled “Common patterns””Where does this highway lead?”
Section titled “”Where does this highway lead?””<set_value name="$nextSector" exact="$highway.destination.sector"/>.destination is a zone — chain .sector for sector lookup (same pattern as Gate).
”Player on a superhighway — read the exit”
Section titled “”Player on a superhighway — read the exit””Pattern from vanilla conversations.xml:1616:
<set_value name="$locationobject" exact="if @$Origin.zone.issuperhighway then $Origin.zone.exit else $Origin"/>For conversation positioning, vanilla uses the exit gate of the highway rather than the player’s mid-highway position.
”Find highways in a sector"
Section titled “”Find highways in a sector"”<find_zone name="$Highways" space="$Sector" normalzone="false" multiple="true"/>
<do_for_each name="$z" in="$Highways"> <do_if value="$z.islocalhighway or $z.issuperhighway"> <!-- a highway zone --> </do_if></do_for_each>"Read player’s progress along a highway”
Section titled “"Read player’s progress along a highway””<do_if value="@player.zone.issuperhighway"> <write_to_logbook text="'Player progress: ' + player.zone.closestpointtoplayer.z + ' (0=entry, 1=exit)'"/></do_if>The .closestpointtoplayer.z value (0..1) is the progress fraction along the highway.
Events
Section titled “Events”There is no event_highway_X family. Standard space events apply:
| Event | When | Notes |
|---|---|---|
event_object_changed_sector | Ship crossed a sector boundary (superhighway exits trigger this) | Standard |
Common gotchas
Section titled “Common gotchas”- ⚠ Highway IS-A zone.
isclass.zoneis TRUE for highways. To exclude highways, check.islocalhighwayand.issuperhighway. - ⚠
.destinationreturns a zone, not a sector. Chain.destination.sectorfor sector lookup (same as Gate). - ⚠
.entry/.exitare dedicated highway-gate classes (highwayentrygate/highwayexitgate). They are NOTclass.gate— see Gate for the class hierarchy. - ⚠
.entryjumpgate/.exitjumpgateare the connected JUMPGATES. These areclass.gateproper. Useful for “after I jump through gate X, will I enter a highway?”. - ⚠
.closestpointtoplayer.xand.yare always 0 by design. Only.z(progress 0..1) is meaningful. Don’t treat as a full position. - ⚠
.isdisabledis rare. Only set via custom gamestart definitions. Most mods can ignore this flag. - ⚠
.haspriority=falseon highways (from zone). Patrol / mission cues that pick “the most important zone in this sector” should skip highways via this flag.
Examples
Section titled “Examples”Example 1: Find a highway connecting two specific sectors
Section titled “Example 1: Find a highway connecting two specific sectors”<find_zone name="$SuperHighways" space="$ClusterA" multiple="true"/>
<set_value name="$found" exact="null"/>
<do_for_each name="$hw" in="$SuperHighways"> <do_if value="$hw.issuperhighway and $hw.destination.sector == $TargetSector"> <set_value name="$found" exact="$hw"/> <break/> </do_if></do_for_each>Example 2: Detect player entering a highway
Section titled “Example 2: Detect player entering a highway”<cue name="WatchHighwayEntry" instantiate="true"> <conditions> <event_player_signalled/> <check_value value="@player.zone and (player.zone.islocalhighway or player.zone.issuperhighway)"/> </conditions> <actions> <write_to_logbook text="'Player entered highway: ' + player.zone.knownname"/> </actions></cue>(event_player_signalled is a placeholder; real detection typically polls player.zone changes via heartbeats.)
Example 3: Compute highway transit time estimate
Section titled “Example 3: Compute highway transit time estimate”<do_if value="@player.zone.issuperhighway"> <set_value name="$Progress" exact="player.zone.closestpointtoplayer.z"/> <set_value name="$Remaining" exact="(1.0f - $Progress) * 60s" comment="approximate — depends on highway speed"/> <write_to_logbook text="'Estimated time to exit: ' + $Remaining"/></do_if>Architectural context
Section titled “Architectural context”- Highway pathfinding: Architectural overview Highway routing — how NPCs enter, traverse, and exit highways.
- Local vs super: Architectural overview Highway topology — visual / mechanic differences, speed multipliers.
- Junction handling: Architectural overview Highway junctions — how
junctionslist defines multi-stop highways.
Related
Section titled “Related”- Zone — parent abstraction.
- Sector — what highways exist in (local) or connect (super).
- Cluster — what superhighways connect.
- Gate — sibling connectivity mechanism (formal jumpgates vs highways).