Library global variables
libGlobal : object
Superclass Tree (in declaration order)
libGlobal
object
Summary of Properties
agendaItem
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
The most recently active agendaItem
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.
Current command information. We keep track of the current command's actor and action here.
The current Command object
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.
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.
the exitLister object, if included in the build
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
the extra hint manager, if included in the build
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.
the hint manager, if included in the build
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.
The same option is provided for getInformed(); by default we use the same value as for revealedTrueOrFalseOnly
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.
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.
The last action to be performed.
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.
The previous Command object
The text of the last command to be repeated by Again
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.
The last fact mentioned in the current conversation
The last location visited by the player char before a travel action. Noted to allow travel back.
The last (latest) topic mentioned in the current conversation.
The object last written on
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.)
our name table for parameter substitutions - a LookupTable that we set up during preinit
The symbol table for every game object.
flag: the parser is in 'debug' mode, in which it displays the parse tree for each command entered
The name of the current player character
The most recent reason a ConvAgendaItem was invoked.
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).
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.
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.
The thought manager object, if it exists.
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.
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.
Get the value associated with tag.
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.
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.
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 25/04/2024 from adv3Lite version 2.0