TravelAction class | action.t[1180]

A TravelAction is one that moves (or at least tries to move) the player character from one place to another via a command like GO NORTH, or EAST.

`class TravelAction : Action`

Superclass Tree (in declaration order)

`TravelAction`
`Action`
`ReplaceRedirector`
`Redirector`
`object`

Subclass Tree

(none)

Global Objects

`Go GoIn GoOut KeepGoing Travel`

Summary of Properties

`baseActionClass canUndo direction predefinedDirection`

Inherited from `Action` :
`actionFailed advanceOnFailure againRepeatsParse allowAll extraMessageParams failCheckMsg failedActionCountsAsTurn implicitTimeTaken includeInUndo isConversational isImplicit isRepeatable oldRoom parentAction parentAllowAll preCond redirectParent reportImplicitActions scopeList spellingPriority synthParamID timeTaken turnsTaken unhides verifyObj wasIlluminated`

``

``

Summary of Methods

`doTravel doTravelViaConn doVisibleTravel execAction execCycle getOutOfNested outOfNestedInstead`

Inherited from `Action` :
`acknowledgeNotifyStatus addExtraScopeItems addImplicitTime advanceTime afterAction announceObject beforeAction buildImplicitActionAnnouncement buildScopeList checkAction checkActionPreconditions commandNotPresent exec execGroup getAll getAllUnhidden getMessageParam implicitAnnouncement reportAction scoreObjects setMessageParam setMessageParams spPrefix spSuffix synthMessageParam turnSequence verify verifyObjRole wrapObjectsNP`

Inherited from `ReplaceRedirector` :
`redirect`

Inherited from `Redirector` :
`doInstead doNested doOtherAction`

Properties

`baseActionClass` | `action.t[1182]`

no description available

`canUndo` | `action.t[1409]`

It's generally possible to undo a travel command.

`direction` | `action.t[1406]`

The direction the actor wants to travel in. This is placed here by the execCycle method and takes the form of A Direction object, e.g. northDir.

`predefinedDirection` | `action.t[1212]`

Does this TravelAction already define a set direction on its direction property (so we don't need to look to what direction object the command refers)?

Methods

`doTravel ( )` | `action.t[1335]`

Carry out travel in direction. For this purpose we first have to define what the corresponding direction property of the actor's current location refers to. If it's nil, no travel is possible, and we simply display a refusal message. If it's an object we execute its travelVia() method for the current actor. If it's a double-quoted string or a method we execute it and make a note of where the actor ends up, if the actor is the player character. If it's a single-quoted string we display it.

Note that we only display the various messages announcing failure of travel if the actor is the player character. We presumably don't want to see these messages as the result of NPCs trying to move around the map.

`doTravelViaConn (loc)` | `action.t[1355]`

Otherwise, our direction of travel is trying to take us towards nil, a string, or a method, in which case call the nonTravel() function to handle it.

`doVisibleTravel (conn)` | `action.t[1387]`

Otherwise if the actor is the player character, display the standard message forbidding travel in the dark.

`execAction (cmd)`OVERRIDDEN | `action.t[1219]`

Execute the travel command, first carrying out any implicit actions needed to facilitate travel

`execCycle (cmd)`OVERRIDDEN | `action.t[1188]`

Use the inherited handling but first make a note of the direction the actor wants to travel in.

`getOutOfNested ( )` | `action.t[1282]`

If the actor is not directly in the room, make him/her get out of his immediate container(s) before attempting travel, unless the actor is in a vehicle.

`outOfNestedInstead ( )` | `action.t[1250]`

If the actor is not directly in the room, treat OUT as a request to get out of the immediate container.

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0