TravelConnector class | travel.t[1372], objtime.t[348], postures.t[577]

A TravelConnector is an object that can be attached to the directional exit property of a room to facilitate (or optionally block) travel in the associated direction and carry out any side-effects of that travel. A TravelConnector may be used as an abstract object to implement travel, or a subclass of TravelConnector such as Door, Passage, StairwayUp or StairwayDown may be used to represent a physical object via which travel occurs. The Room class also inherits from TravelConnector.

Whether the base TravelConnector class or one of its subclasses is used, travel is carried out via a TravelConnector by calling its travelVia() method.

Modified in objtime.t[348]:
Modifications to TravelConnector for the OBJTIME EXTENSION. The purpose of these modifications is to allow different TravelConnectors to take different amounts of time to traverse.

Modified in postures.t[577]:
If the Room is illuminated, display its ordinary room title, followed by the actor's immediate location if it's not the Room. If the Room is in darkness, use the darkName instead of the roomTitle.

`class TravelConnector : object`

Superclass Tree (in declaration order)

`TravelConnector`
`object`

Subclass Tree

`TravelConnector`
`AskConnector`
`Door`
`DSDoor`
`SymDoor`
`SecretDoor`
`DSTravelConnector`
`SymConnector`
`Passage`
`DSPassage`
`SymPassage`
`PathPassage`
`DSPathPassage`
`SymPathPassage`
`Room`
`OutdoorRoom`
`StairwayDown`
`StairwayUp`
`DSStairway`
`SymStairway`
`UnlistedProxyConnector`

Global Objects

`noExit`

Summary of Properties

`destination isConnectorApparent isConnectorListed isOpen posture PushTravelVia stagingLocations suppressTravelDescForPushTravel transmitsLight travelBarriers travelNotificationList traversalTime traversed traversedBy`

Summary of Methods

`afterTravelNotifications beforeTravelNotifications canTravelerPass checkPushTravel checkTravelBarriers dobjFor(GoThrough) dobjFor(TravelVia) execTravel exitLocation explainTravelBarrier getApparentDestination getDepartingDirection getDestination getTraveler hasBeenTraversedBy iobjFor(PushTravelThrough) isConnectorVisible isDestinationKnown noteTraversal sayActorFollowing sayDeparting sayNoDestination sayNotInStagingLocation setTravelPosture travelDesc travelVia traversalMsg traversalTimeFrom`

Properties

`destination` | `travel.t[1411]`

The room to which this TravelConnector leads when it is traversed

`isConnectorApparent` | `travel.t[1380]`

Is this connector apparent? That is, would it be apparent to an observer under normal lighting conditions, as opposed to being concealed? By default we'll suppose a TravelConnector is apparent unless it's explicitly hidden.

`isConnectorListed` | `travel.t[1386]`

Should this exit be shown in the exit lister? By default we'll assumed it should be it it's visible.

`isOpen` | `travel.t[1447]`

A travel connector is usually open.

`posture` | `postures.t[583]`

The posture an actor needs to be in before travelling via this connector. This will normally be standing, but this could be changed if, for example, the actor needs to crawl through this connector.

`PushTravelVia` | `travel.t[1879]`

The appropriate PushTravelAction for pushing something something through a TravelConnector.

`stagingLocations` | `travel.t[1800]`

Our list of stagingLocations. We don't need to define this, in which case we'll assume the traveler needs to be directly in the room they're traveling from. If we do define this property it should contain a list of objects and/or classes and the traveler must be directly in one of them for the travel to be allowed to proceed.

`suppressTravelDescForPushTravel` | `travel.t[1887]`

If we display a message for pushing something via us, we probably don't also want the travelDesc describing the actor's travel. Game code can override if both messages are wanted when push-travelling.

`transmitsLight` | `travel.t[1392]`

Does light pass through this TravelConnector from its destination (so that it's visible in the dark even its location is dark.).

`travelBarriers` | `travel.t[1664]`

an additional TravelBarrier or a list of TravelBarriers to check on this TravelConnector to see if travel is allowed.

`travelNotificationList` | `travel.t[1630]`

List of additional actors to be notified that this actor has travelled.

`traversalTime` | `objtime.t[353]`

The number of seconds it takes to traverse this connector (in addition to any that come from the Travel action). [OBJTIME EXTENSION ONLY]

`traversed` | `travel.t[1587]`

Have we been traversed by the player character? Return true if and only if we have.

`traversedBy` | `travel.t[1574]`

A list of the actors, vehicles and pushTraverers that have traversed this TravelConnector. This is maintained by the noteTraversal(), so game code should normally treat this property as read-only.

Methods

`afterTravelNotifications (actor)` | `travel.t[1609]`

Carry out the after travel notifications for this actor

`beforeTravelNotifications (actor)` | `travel.t[1590]`

Carry out the before travel notifications for this actor.

`canTravelerPass (actor)` | `travel.t[1637]`

Method that should return true is actor is allowed to pass through this TravelConnector and nil otherwise. We allow travel by default but this could be overridden to block travel under certain conditions.

`checkPushTravel ( )` | `travel.t[1863]`

Check the travel barriers on the indirect object of the action

`checkTravelBarriers (traveler)` | `travel.t[1672]`

Check all the travel barriers associated with this connector to determine whether the traveler is allowed to pass through this travel connector.

`dobjFor(GoThrough)` | `travel.t[1844]`

For now, we just call the travelVia() method on the TravelConnector. Subsequentlly we might add appropriate code for the other action phases.

`dobjFor(TravelVia)` | `travel.t[1829]`

The TravelVia action is supplied so game code can execute a TravelVia action on a TravelConnector; there is no TRAVEL VIA command that can be issued directly by a player, but a player command may be translated into this action.

`execTravel (actor, traveler, conn)` | `travel.t[1503]`

Execute the travel for this actor via this connector

`exitLocation (dest)` | `travel.t[1819]`

Optionally specify a nested room within our destination room a traveler traveling via should be moved to on entering this room. If this returns anything that's not in our destination room it will be igonored.

`explainTravelBarrier (actor)` | `travel.t[1644]`

If canTravelerPass returns nil explainTravelBarrier should display a message explaining why travel has been prohibited.

`getApparentDestination (origin)` | `travel.t[1428]`

Our apparent destination is used by the exit lister to decide whether to colour travel in our direction as an unvisited exit. By default we just use our real destination, but game code may occasionally wish to override this to make it appear than a visited destination hasn't been visited yet, for example by returning nil.

`getDepartingDirection (traveler)` | `travel.t[1785]`

Get the direction traveler needs to go in to traverse this connector from traveler's current location.

`getDestination (origin)` | `travel.t[1417]`

The room to which this TravelConnector leads when it is traversed from origin.

`getTraveler (actor)` | `travel.t[1485]`

Get the traveler associated with this actor. Normally the traveler will be the same as the actor, but if the actor is in a vehicle, then the traveler will be the vehicle.

`hasBeenTraversedBy (traveler)` | `travel.t[1580]`

Test whether this TravelConnector has been traversed by traveler (which may be an actor, a vehicle, or something pushed through the TravelConnector by an actor).

`iobjFor(PushTravelThrough)` | `travel.t[1850]`

no description available

`isConnectorVisible ( )` | `travel.t[1399]`

A TravelConnector (or at least, the exit it represents) is visible if it's apparent (i.e. not concealed in some way) and if the lighting conditions are adequate, or if it's visible in the dark.

`isDestinationKnown ( )` | `travel.t[1439]`

Does the player char know where this travel connector leads? By default s/he doesn't until s/he's visited its destination, but this could be overridden for an area the PC is supposed to know well when the game starts, such as their own house.

`noteTraversal (actor)` | `travel.t[1551]`

If the actor doing the traveling is the player character, display the travelDesc. Note that although this might normally be a simple description of the travel, the travelDesc method could also be used to carry out any other side-effects of the travel via this connector.

`sayActorFollowing (follower, leader)` | `travel.t[1752]`

Display a message to say that follower is following leader in the direction of this connector.

`sayDeparting (traveler)` | `travel.t[1731]`

Display a message to say that an actor is departing via this connector. On the base class the default behaviour is to describe the departure via a compass direction. The actor in question would normally be an NPC visible to the player character.

`sayNoDestination ( )` | `travel.t[1539]`

Display a message saying that this travel connector doesn't actually lead anywhere; this may be needed if our destination is nil and our noteTraversal() method doesn't display anything.

`sayNotInStagingLocation (traveler)` | `travel.t[1807]`

The message to display if stagingLocations is not nil and the traveler is not in one of our staging locations. It may often be better to pre-empt the display of this generic message by defining a checkReach() method on this TravelConnector if it's a physicsl one.

`setTravelPosture ( )` | `travel.t[1478], postures.t[586]`

Check the travel barriers on this TravelConnector to ensure that travel is permitted. If so carry out the travel. If not checkTravelBarriers will have reported the reason why travel is blocked.

Modified in postures.t[586]:
Ensure the actor is in the posture needed to travel via this connector.

`travelDesc ( )` | `travel.t[1654]`

Carry out any side effects of travel if the traveler is the player character. Typically we might just display some text describing the travel here, but this method could be used for any side-effects of the travel. If the TravelConnector is mixed in with an EventList class then the default behaviour is to call the doScript() method here to drive the EventList.

`travelVia (actor)` | `travel.t[1453]`

Carrier out travel via this connector, first checking that travel through this connector is permitted for this actor.

`traversalMsg ( )` | `travel.t[1773]`

Create a phrase describing the direction of travel through this connector (e.g. 'to the north')

`traversalTimeFrom (origin)` | `objtime.t[360]`

If we want to vary the time to go through this TravelConnector depending on where the traveler is starting from (only really relevant for rooms), we can override this method instead. [OBJTIME EXTENSION ONLY]

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1