Home | AGI Documentation | AGI Tutorials | AGI Tools | AGI Wiki | Community

2.3 Variable Types Used

by Lance Ewing
Last updated: 31 August 1997
Retrived from the Internet Archive
 

There appear to be a number of data types used as AGI command parameters. These are mentioned below:

(1) Variable

This is the equivalent of a a byte (or unsigned char). It can have a value from 0 to 255. There are 256 variables and in the LOGIC code they are numbered from 0 to 255 and are indentified by their number. The original LOGIC source code that Sierra's programmers wrote would have had textual identifiers for these variables, but when the LOGIC source was compiled into the LOGIC codes, the original variable names were lost. To the interpreter, the variables are known by their index into the
variable table.

Variables are probably the most commonly used type. They feature in arithmetic commands such as addition, multiplication, etc, and a lot of AGI commands have a version that has variable paramaters as an alternative to the normal constant parameter versions.

(2) Flag

Flags are the boolean type of the AGI system. Their value can be either 1 or 0 (true or false). There are 256 flags that are numbered 0 to 255. In the original LOGIC source code, they would have had textual identifiers, but in the compiled LOGIC code they are known only by their index into the interpreters flag table.

Flags are used to indicate when certain things have taken place.

(3) String

According to another source, there are only 12 strings available. I don't know if this is true, but it agrees with the minimum amout of space set aside for strings that I have seen in examining memory usage during a game. However, the majority of AGI games have enough room for exactly 24 strings (see below).

AGI interp. version Space available for strings
2.089
2.411
12
..... 24
3.002.107
3.002.149
12

Whether the versions that have enough space for 24 strings do infact support 24 strings is not known. Strings are 40 characters long which includes the zero terminator. String number zero is usually the input prompt (e.g. ">" or "]").

(4) Word

Words are the words that the user types in. An input sentence is composed of a number of words. The important words (e.g. for the sentence "look at the tree", "look" and "tree" are important) are assigned to the words variables corresponding to their place in the sentence once unimportant words and punctuation has been taken out. For example, in the earlier example word(1) would be "look" and
word(2) would be "tree". Words can be converted to strings.

(5) Inventory Item

There are a number of AGI commands that refer to inventory items (e.g. get(), drop()). One of the arguments to these commands will represent an inventory item number. In the original LOGIC source text, the programmer would have written things like "get(dagger)" but the interpreter knows them only as an index into the OBJECT table.

(6) Object

There can be a bit of confusion between this type and the inventory item because of the name of the OBJECT file. The OBJECT file has almost nothing to do with what the interpreter generally calls objects. There are a large number of AGI commands that deal with 'objects'. For example,

move.obj
animate.obj
set.view
set.cel
set.loop
draw

etc, etc,

In fact the interpreter calls its usage of the VIEW resource "objects". An object is one usage of a VIEW resource. It is essentially an entry in the object table (or VIEW table/VIEW list). Many objects can use the same VIEW resource for its appearance which can be seen in KQ1 and BC with the crocodile filled moats.

So when an AGI command has an object as a parameter to it, the value of the parameter is an index number into a table of objects that the interpreter is currently controlling.

(7) Message

At the end of every LOGIC file is a message section. There need not be any messages in it, but it will still exist. Messages in LOGIC.0 are global messages whereas all other messages can only be accessed from their own LOGIC code. AGI commands that have messages as parameters refer to a message number in their own LOGIC file. I say that those in LOGIC.0 are global because messages and strings can contain format codes one of which is used to display messages from LOGIC.0

eg.

print("Message 34 in LOGIC.0 is %g34.");

Therefore messages in LOGIC.0 can be displayed by any LOGIC in this way.
 


by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.
pixe
Top

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.