libGlobal object | misc.t[571]

Library global variables

`libGlobal : object`

Superclass Tree (in declaration order)

`libGlobal`
`object`

Summary of Properties

`agendaItem altVocabLst commandLineArgs curAction curActor curCommand curIssuingActor defaultMood defaultStance disambigLen enumerateDisambigOptions exitListerObj extraDestInfo extraHintManagerObj footnoteClass hintManagerObj IFID informedTrueOrFalseOnly informOnReveal inventoryTall lastAction lastActorForUndo lastCommand lastCommandForAgain lastCommandForUndo lastFactMentioned lastLoc lastTopicMentioned lastTypedOnObj lastWrittenOnObj libMessageObj nameTable_ objectNameTab parserDebugMode playerCharName reasonInvoked revealedNameTab revealedTrueOrFalseOnly scoreObj thoughtManagerObj totalTurns`

Summary of Methods

`addExtraDestInfo getCommandSwitch getRevealed playerChar setRevealed setUnrevealed`

Properties

`agendaItem` | `misc.t[923]`

The most recently active agendaItem

`altVocabLst` | `misc.t[956]`

A list of objects in the game with alternating vocabulary. This is maintained and used by the library and shouldn't normally be changed by game code.

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

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

no description available

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

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

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

The current Command object

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

no description available

`defaultMood` | `english.t[6511]`

no description available

`defaultStance` | `english.t[6510]`

no description available

`disambigLen` | `misc.t[950]`

The current number of disambiguation options to choose from. This is for use by the DisambigPreparser to prevent acceptance of a number out of range.

`enumerateDisambigOptions` | `misc.t[944]`

Flag: do we wish to present the player with an enumerated list of disambiguation options (e.g. "Which coin do you mean:(1) the gold coin or (2) the silver coin? to which they can simply reply 1 or 2). By default we do but game authors can disable this behaviour by setting this flag to nil.

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

the exitLister object, if included in the build

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

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

the extra hint manager, if included in the build

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

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

the hint manager, if included in the build

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

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.

`informedTrueOrFalseOnly` | `misc.t[857]`

The same option is provided for getInformed(); by default we use the same value as for revealedTrueOrFalseOnly

`informOnReveal` | `misc.t[799]`

Flag: do we want revealing something (through setRevealed or <.reveal> to update PC and NPC knowledge? By default we do, but games that want to strictly separate Player and Player Character knowledge may wish to set this to nil.

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

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

The last action to be performed.

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

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

The previous Command object

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

The text of the last command to be repeated by Again

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

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.

`lastFactMentioned` | `misc.t[917]`

The last fact mentioned in the current conversation

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

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

`lastTopicMentioned` | `misc.t[914]`

The last (latest) topic mentioned in the current conversation.

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

The object last typed on

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

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

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

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

The symbol table for every game object.

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

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

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

The name of the current player character

`reasonInvoked` | `misc.t[920]`

The most recent reason a ConvAgendaItem was invoked.

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

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).

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

Do we want the getRevealed(tag) method to return only true or nil, or do we want it to return the value associated with tag in the revealedNameTab. By default we opt for the latter, but we provide the other option in case it's needed for backward compatibility.

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

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

The thought manager object, if it exists.

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

the total number of turns so far

Methods

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

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

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.

`getRevealed (tag)` | `misc.t[860]`

Get the value associated with tag.

`playerChar ( )` | `misc.t[599]`

The current player character. If it hasn't already been defined, we call getPlayerChar to identify it then set ourself to the value it returns.

`setRevealed (tag, arg?)` | `misc.t[818], beliefcalcs.t[274]`

Mark a tag as revealed. This adds an entry for the tag to the revealedNameTab table and to the informedNamedTab of the player character (who might, in principle, change during the course of the game). 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[880]`

Mark a tag as unrevealed. This removes the entry for the tag from our 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 13/06/2025 from adv3Lite version 2.2.1