pov.t file | source file

TADS 3 Library - point of view

This module provides definitions related to point of view and sensory context. When we generate output, we do so with respect to a particular point of view; different points of view can result in different output, because of the viewer's distance from an object, for example, or because of the presence of obscuring materials between the viewer and the viewed object. We also generate output in a particular sensory context, which controls whether or not a message that describes an object with respect to a particular sense should be generated at all; for example, if the viewer can't see an object because of darkness or an obscuring layer of material, messages about the object's visual appearance should not be generated.

Summary of Classes

(none)

Summary of Global Objects

`senseContext`

Summary of Global Functions

`callFromPOV callWithSenseContext clearPOV getPOV getPOVActor getPOVActorDefault getPOVDefault popPOV pushPOV setPOV setRootPOV`

Global Functions

`callFromPOV (actor, pov, funcToCall, [args])` | `pov.t[328]`

Call a function from a point of view. We'll set the new point of view, call the function with the given arguments, then restore the original point of view.

`callWithSenseContext (source, sense, func)` | `pov.t[56]`

Call a function with a given sensory context.

The sensory context specifies the source of any messages generated in the course of the routine we invoke and the sense which those messages use to convey information. If the player character cannot sense the source object in the given sense, then we block all messages generated while calling this function.

If the source object is nil, this establishes a neutral sense context in which all messages are visible.

This can be used for processing events that are not directly initiated by the player character, such as non-player character activities or scheduled events (fuses and daemons). The idea is that anything described in the course of calling our routine is physically associated with the source object and relates to the given sense, so if the player character cannot sense the source object, then the player should not be aware of these happenings and thus should not see the messages.

Sense contexts are not nested in their effects - we will show or hide the messages that our callback routine generates regardless of whether or not messages are hidden by an enclosing sensory context. So, this routine effectively switches to the new sense context for the duration of the callback, eliminating the effect of any enclosing context. However, we do restore the enclosing sense context before returning, so there is no lasting net effect on the global sense context.

`clearPOV ( )` | `pov.t[310]`

Clear the point of view and all stacked elements

`getPOV ( )` | `pov.t[205]`

Get the current point of view. In *most* cases, this is the same as the point-of-view actor: the actor is looking around with its own eyes, so it's the point of view. However, this can differ from the actor when the actor is viewing the location being described through an intermediary of some kind. For example, if an actor is observing a remote room through a closed-circuit TV system, the point of view would be the camera in the remote room (not the TV - the point of view is intended to be the object that's physically absorbing the light rays or other sensory equivalents).

`getPOVActor ( )` | `pov.t[189]`

Get the current point-of-view actor - this is the actor who's performing the action (LOOK AROUND, EXAMINE, SMELL, etc) that's generating the current description.

`getPOVActorDefault (dflt)` | `pov.t[211]`

get the POV actor, returning the given default if there isn't one set

`getPOVDefault (dflt)` | `pov.t[221]`

get the POV, returning the given default if there isn't one set

`popPOV ( )` | `pov.t[283]`

Pop the most recent point of view pushed

`pushPOV (actor, pov)` | `pov.t[270]`

Push the current point of view

`setPOV (actor, pov)` | `pov.t[233]`

Change the point of view without altering the point-of-view stack

`setRootPOV (actor, pov)` | `pov.t[245]`

Set the root point of view. This doesn't affect the current point of view unless there is no current point of view; this merely sets the outermost default point of view.

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3