TravelConnectorclass | travel.t[927], objtime.t[349]

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[349]:
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.

`class TravelConnector : object`

Superclass Tree (in declaration order)

`TravelConnector`
`object`

Subclass Tree

`TravelConnector`
`Door`
`SecretDoor`
`Passage`
`PathPassage`
`Room`
`OutdoorRoom`
`StairwayDown`
`StairwayUp`
`UnlistedProxyConnector`

Global Objects

(none)

Summary of Properties

`destination isConnectorApparent isConnectorListed isConnectorVisible isDestinationKnown isOpen transmitsLight travelBarriers traversalTime`

Summary of Methods

`afterTravelNotifications beforeTravelNotifications canTravelerPass checkTravelBarriers execTravel explainTravelBarrier getDepartingDirection getTraveler noteTraversal sayActorFollowing sayDeparting sayNoDestination travelDesc travelVia traversalMsg traversalTimeFrom`

Properties

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

The room to which this TravelConnector leads when it is traversed

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

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[941]`

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

`isConnectorVisible` | `travel.t[954]`

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[970]`

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.

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

A travel connector is usually open.

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

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[1149]`

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

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

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

Methods

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

Carry out the after travel notifications for this actor

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

Carry out the before travel notifications for this actor.

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

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.

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

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

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

Execute the travel for this actor via this connector

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

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

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

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

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

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.

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

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[1211]`

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

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

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[1055]`

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.

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

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[979]`

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

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

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

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

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.

Adv3Lite Library Reference Manual
Generated on 12/09/2014 from adv3Lite version 1.4