A Traveler is an object that can travel. The two main kinds of travelers are Actors and Vehicles. A vehicle can contain multiple actors, so a single vehicle travel operation could move several actors.
This class is intended to be multiply inherited, since it is not based on any simulation object class.
Modified in en_us.t:
English-specific Traveler changes
Traveler : TravelMessageHandler
Superclass Tree (in declaration order)
Summary of Properties
Summary of Methods
Get the list of actors taking part in the travel. When an actor is the traveler, this list simply contains the actor itself; for a vehicle or other composite traveler that moves more than one actor at a time, this should return the list of all of the actors involved in the travel.
Get the list of actors traveling undo their own power. In the case of an actor traveling directly, this is just the actor; in the case of an actor pushing something, this is likewise the actor; in the case of a group of actors traveling together, this is the list of traveling actors; in the case of a vehicle, this is an empty list, since anyone traveling with the vehicle is traveling under the vehicle's power.
Can the traveler travel via the given connector to the given destination? Returns true if the travel is permitted, nil if not.
By default, this simply returns true to indicate that the travel is allowed. Individual instances can override this to enforce limitations on what kind of travel the traveler can perform.
Check, using pre-condition rules, that the traveler is directly in the given room. We'll attempt to implicitly remove the actor from any nested rooms within the given room.
checkMovingTravelerInto (room, allowImplicit)
Check, using pre-condition rules, that the traveler is in the given room, moving the traveler to the room if possible.
Show my arrival message - this is shown when I'm entering a room in view of the player character from a location where the player character could not see me. 'backConnector' is the connector in the destination location from which we appear to be emerging.
Show my departure message - this is shown when I'm leaving a room where the player character can see me for another room where the player character cannot see me.
describeNpcArrival (origin, backConnector)
Describe the arrival of a non-player character or any other traveler that doesn't involve the player character.
Describe the departure of a non-player character, or any traveler not involving the player character.
Explain why the given travel is not possible. This is called when canTravelVia() returns nil, to display a report to the player explaining why the travel was disallowed.
By default, we do nothing, since our default canTravelVia() never disallows any travel. If canTravelVia() is overridden to disallow travel under some conditions, this must be overridden to generate an appropriate explanatory report.
invoke a callback function for each traveling actor
Get a lookup table giving the set of objects to be notified of a beforeTravel/afterTravel event. By default, we return a table including every object connected to the traveler by containment.
Is the given actor traveling with this traveler? Returns true if the actor is in my getTravelerActors list.
Is the given object being carried by the traveler? Returns true if the object is inside the traveler itself, or is inside any of the actors traveling.
Get my location's name, from the PC's perspective, for describing my arrival to or departure from my current location. We'll simply return our location's destName, or "the area" if it doesn't have one.
Get the travel preconditions specific to the traveler, for the given connector. By default, we return no extra conditions.
Get my "remote" location name, from the PC's perspective. This returns my location name, but only if my location is remote from the PC's perspective - that is, my location has to be outside of the PC's top-level room. If we're within the PC's top-level room, we'll simply return an empty string.
Determine if the given actor can see this traveler. By default, we'll simply check to see if the actor can see 'self'.
travelerTravelTo (dest, connector, backConnector)
Travel to a new location. Moves the traveler to a new location via the given connector, triggering any side effects of the travel.
Note that this routine is not normally called directly; in most cases, the actor's travelTo is called, and it in turn invokes this method in the appropriate traveler.
'dest' is the new location to which we're traveling. 'connector' is the TravelConnector we're traversing from the source location to reach the new destination; the connector is normally the invoker of this routine. 'backConnector' is the connector in the destination from which the actor will appear to emerge on the other end of the travel.
Perform "local" travel - that is, travel between nested rooms within a single top-level location. By default, we simply defer to the actor to let it perform the local travel.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3