libGlobalobject | misc.t[571]

Library global variables

`libGlobal : object`

Superclass Tree (in declaration order)

`libGlobal`
`object`

Summary of Properties

`commandLineArgs curAction curActor curCommand curIssuingActor exitListerObj extraDestInfo extraHintManagerObj footnoteClass hintManagerObj IFID inventoryTall lastAction lastActorForUndo lastCommand lastCommandForAgain lastCommandForUndo lastLoc lastTypedOnObj lastWrittenOnObj libMessageObj nameTable_ objectNameTab parserDebugMode playerChar playerCharName revealedNameTab scoreObj thoughtManagerObj totalTurns`

Summary of Methods

`addExtraDestInfo getCommandSwitch setRevealed setUnrevealed`

Properties

`commandLineArgs` | `misc.t[702]`

Command line arguments. The library sets this to a list of strings containing the arguments passed to the program on the command line. This list contains the command line arguments parsed according to the local conventions for the operating system and C++ library. The standard parsing procedure used by most systems is to break the line into tokens delimited by space characters. Many systems also allow space characters to be embedded in tokens by quoting the tokens. The first argument is always the name of the .t3 file currently executing.

`curAction` | `misc.t[663]`

no description available

`curActor` | `misc.t[661]`

Current command information. We keep track of the current command's actor and action here.

`curCommand` | `misc.t[666]`

The current Command object

`curIssuingActor` | `misc.t[662]`

no description available

`exitListerObj` | `misc.t[675]`

the exitLister object, if included in the build

`extraDestInfo` | `misc.t[757]`

A lookup table to store information about the destinations of direction properties not connected to objects (i.e. direction properties defined as strings or methods

`extraHintManagerObj` | `misc.t[681]`

the extra hint manager, if included in the build

`footnoteClass` | `misc.t[618]`

The global Footnote class object. We use a global for this, rather than referencing Footnote directly, to allow the footnote module to be left out entirely if the game doesn't make use of footnotes. The footnote class should set this during pre-initialization.

`hintManagerObj` | `misc.t[678]`

the hint manager, if included in the build

`IFID` | `misc.t[689]`

The game's IFID, as defined in the game's main module ID object. If the game has multiple IFIDs in the module list, this will store only the first IFID in the list. NOTE: the library initializes this automatically during preinit; don't set this manually.

`inventoryTall` | `misc.t[851]`

Flag determining whether inventory listing should be in the wide (nil) or tall (true) format. By default we start out with the wide format (inventoryTall = nil), although game code could override this.

`lastAction` | `misc.t[669]`

The last action to be performed.

`lastActorForUndo` | `misc.t[652]`

Most recent target actor phrase; this goes with lastCommandForUndo. This is nil if the last command did not specify an actor (i.e., was implicitly for the player character), otherwise is the string the player typed specifying a target actor.

`lastCommand` | `misc.t[672]`

The previous Command object

`lastCommandForAgain` | `misc.t[655]`

The text of the last command to be repeated by Again

`lastCommandForUndo` | `misc.t[643]`

Most recent command, for 'undo' purposes. This is the last command the player character performed, or the last initial command a player directed to an NPC.

Note that if the player directed a series of commands to an NPC with a single command line, only the first command on such a command line is retained here, because it is only the first such command that counts as a player's turn in terms of the game clock. Subsequent commands are executed by the NPC's on the NPC's own time, and do not count against the PC's game clock time. The first command counts against the PC's clock because of the time it takes the PC to give the command to the NPC.

`lastLoc` | `misc.t[749]`

The last location visited by the player char before a travel action. Noted to allow travel back.

`lastTypedOnObj` | `misc.t[838]`

The object last typed on

`lastWrittenOnObj` | `misc.t[835]`

The object last written on

`libMessageObj` | `misc.t[593]`

The current library messages object. This is the source object for messages that don't logically relate to the actor carrying out the comamand. It's mostly used for meta-command replies, and for text fragments that are used to construct descriptions.

This message object isn't generally used for parser messages or action replies - most of those come from the objects given by the current actor's getParserMessageObj() or getActionMessageObj(), respectively.

By default, this is set to libMessages. The library never changes this itself, but a game can change this if it wants to switch to a new set of messages during a game. (If you don't need to change messages during a game, but simply want to customize some of the default messages, you don't need to set this variable - you can simply use 'modify libMessages' instead. This variable is designed for cases where you want to *dynamically* change the standard messages during the game.)

`nameTable_` | `misc.t[844]`

our name table for parameter substitutions - a LookupTable that we set up during preinit

`objectNameTab` | `misc.t[829]`

The symbol table for every game object.

`parserDebugMode` | `misc.t[627]`

flag: the parser is in 'debug' mode, in which it displays the parse tree for each command entered

`playerChar` | `misc.t[598]`

The current player character

`playerCharName` | `misc.t[601]`

The name of the current player character

`revealedNameTab` | `misc.t[824]`

The global lookup table of all revealed keys. This table is keyed by the string naming the revelation; the value associated with each key is not used (we always just set it to true).

`scoreObj` | `misc.t[609]`

The global score object. We use a global for this, rather than referencing libScore directly, to allow the score module to be left out entirely if the game doesn't make use of scoring. The score module should set this during pre-initialization.

`thoughtManagerObj` | `misc.t[832]`

The thought manager object, if it exists.

`totalTurns` | `misc.t[621]`

the total number of turns so far

Methods

`addExtraDestInfo (source, dirn, dest)` | `misc.t[766]`

Add an item to the extraDestInfo table keyed on the source room plus the direction taken, with the value being the destination arrived at (which most of the time will probably be the same as the source, since in most cases where we create one of these records, no travel will have taken place.

`getCommandSwitch (s)` | `misc.t[722]`

Retrieve a "switch" from the command line. Switches are options specifies with the conventional Unix "-xxx" notation. This searches for a command option that equals the given string or starts with the given substring. If we find it, we return the part of the option after the given substring - this is conventionally the value of the switch. For example, the command line might look like this:

t3run mygame.t3 -name=MyGame -user=Bob

Searching for '-name=' would return 'MyGame', and searching for '-user=' would return' Bob'.

If the switch is found but has no value attached, the return value is an empty string. If the switch isn't found at all, the return value is nil.

`setRevealed (tag)` | `misc.t[800]`

Mark a tag as revealed. This adds an entry for the tag to the revealedNameTab table. We simply set the table entry to 'true'; the presence of the tag in the table constitutes the indication that the tag has been revealed.

(Games and library extensions can use 'modify' to override this and store more information in the table entry. For example, you could store the time when the information was first revealed, or the location where it was learned. If you do override this, just be sure to set the revealedNameTab entry for the tag to a non-nil and non-zero value, so that any code testing the presence of the table entry will see that the slot is indeed set.)

We put the revealedNameTab table and the setRevealed method here rather than on conversationManager so that it's available to games that don't include actor.t.

`setUnrevealed (tag)` | `misc.t[813]`

Mark a tag as unrevealed. This removes the entry for the tag from the revealedNameTab table.

We put the revealedNameTab table and the setRevealed method here rather than on conversationManager so that it's available to games that don't include actor.t.

Adv3Lite Library Reference Manual
Generated on 15/03/2023 from adv3Lite version 1.6.1