Code Compare: a comparison of interactive fiction authoring systems

top

A

B

C

D

E

F

G

H

I

K

L

M

N

O

P

Q

R

S

T

U

V

W

Z


About Code Compare

This is one of those works-in-progress. It isn't complete. It isn't thorough. It isn't finished. The word TODO is used frequently. And I'll probably try to port it to IFWiki.

This is my attempt to compare, on a feature-by-feature basis, most of the main IF languages in use today: ADRIFT, Inform 6, Inform 7, Hugo, Quest, TADS 2, and TADS 3. I am intrigued by the intellectual challenge. Each language uses different approaches to the many requirements of an IF work, and I want to know how are they different, and what stays the same.

Plus, I'm curious how I might compare them, how I might organize such a thing. What if a TADS operator's functionality is served by a function call in Hugo? Or if an object attribute in Inform corresponds to an object class in TADS? Sometimes, a low-level feature in language A has no direct comparison in language B because language B uses a completely different high-level approach; how to represent that?

There's also the practical usage of such a comparison when migrating from one language to another. I know how to readily create a reasonably nice program using Inform, but not in any of the other languages. Perhaps this comparison will help me or others learn a new language, or assist with the porting of existing IF programs. Anyone who is tempted to create RAIF-POOL (an unlikely program that can freely translate between the IF languages automatically) will need to go much further than this document proposes to go; that theoretical RAIF-POOL creator will not only have to resolve the conflicts between the languages, but also divine the intent of someone else's game code.

The reader will notice that I haven't included ADRIFT in this comparision. Although ADRIFT is a commonly-used IF development system, it isn't a language in the usual sense, and thus, it's not obvious to me how to represent its features here. I definitely do not want to insert screenshots. So, until I figure out how to get around that, I'm just going to skip ADRIFT for now. There's quite enough work to do with all the other languages as it is.

[TODO: Explain ground rules; that I'm using standard libraries wherever possible, that sort of thing.]

[TODO: Talk a bit about ALAN 2 and Alan 3]

[TODO: Talk a bit about Hugo]

[TODO: Talk a bit about Inform 6]

[TODO: Talk a bit about Inform 7]

[TODO: Talk a bit about TADS 2]

[TODO: Talk a bit about TADS 3]

[TODO: Explain my own syntax]

token?     token is optional; may occur 0 or 1 times.

token+     token is required, and may occur several times.

token*     token is optional, yet may occur several times.

NL     literal newline.


addition

Addition of two numeric values is usually done with an operator, and that operator is usually a plus sign.

ALAN 2, Inform 6, Hugo, TADS 2, TADS 3

x + y

Dialog

($A plus $B into $C)

A and B must be bound to numbers; C is unified with their sum. If the result is outside the valid range of numbers, the query fails.

Inform 7

ZIL

Possibly you're allowed to add more than two arguments with this built-in instruction; I'm not really sure.

See also


address of

ALAN 2 and Inform 6

Not applicable.

Hugo

TADS 2

TADS 3

&property

See also


arithmetic operators

See

See also


arrays

ALAN 2

Not available.

Hugo

array arrayname [ size ]   ! elements 0 to size-1

(to initialize:)

arrayname [ startindex ] = val [, val]*

Arrays may contain a mix of datatypes. Local arrays are illegal.

Inform 6

(property array:)

propertyname val+

(global array:)

Array arrayname --> size ;   ! empty array; 0 to size-1

Array arrayname --> val val* ;   ! filled array

Array arrayname --> "chars" ;   ! char array

Array arrayname table size ;   ! empty wordarray; puts size in arrayname-->0; elements 1 to size.

Array arrayname string "chars" ;   ! char bytearray; puts length of string in arrayname->0; elements 1 to length.

Replace --> with -> to get a byte array. Wordarray elements may be integers, strings, chars, dictionary words, or object references. Bytearray elements may only be integers from 0 to 255, or chars.

Inform 7

Use tables as directed in chapter 14. Tables are declared in a single paragraph with no blank lines inbetween rows.
The first row must be the title line in one of three formats, eg:

Table code
Table of Whatever

The second row must be the column header names separated by tabs.

The remaining rows are the table entries, columns separated by tabs.

All values in a column must have mutually compatible datatypes, eg: you can't have strings and numbers in the same column.

Rows are numbered from 1; columns are refered to by their names.

Table code - Whatever

TADS 2

[ listitem* ]

Lists may be empty. Lists may contain a mix of subtypes. Listitems may be explicitly separately by commas. If the list is the value of a property, all listitems in the list must be constant values (eg: integers, single-quoted strings, constant lists); otherwise, a list may contain expressions.

TADS 3

[ ]   // for an empty list

[ listitem [, listitem]* ]

Same as in TADS 2, except listitems must be separated with commas. If the list is the value of a property, all listitems in the list must still be constant values; however, the compiler will translate

theProp = [rand(3), foo.location]

into

theProp { return [rand(3), foo.location]; }

See also


array as property

That is, how to refer to an array/list when it's the value of an object's property.

ALAN 2

Not applicable.

Inform 6

object.&arrayproperty

TADS 2 and TADS 3

object.property

See also


array operations

By "array operations", we mean any predefined functions, operators, and statements that manipulate arrays in any way.

See

See also


array size

ALAN 2

Not applicable.

Hugo

Returns array's length:

array[]

Inform 6

If the array is a property of an object, you can do this:

object .# arrayproperty


This returns the length of a bytearray, or 2×length of a wordarray.

TADS 2

length(list)

TADS 3

list.length()

See also


articles (a, an, the)

Inform 6

By default, Inform 6 attempts to guess "a" or "an" for the indefinite article based on the item's short name's first character. Give the proper attribute to an item if no article is appropriate. Set the article property of an item to the appropiate string value to override the default indefinite article. Set the articles property of an item to a list of string values to explicitly declare all articles of an item (this last is meant for non-English games). Use the (The), (the), and (a) functions to print item's names with articles.

TADS 2

By default, the values of a thing's adesc and thedesc properties are "a <<self.sdesc>>" and "the <<self.sdesc>>" respectively. Give these properties new values to override their default values.

See also


assignment

ALAN 2

SET x TO n.

Hugo, Inform 6, and TADS 3

x = n

TADS 2

x := n   // default style

x : n    // C mode style

See also


assignment combos

For convenience, some programming languages provide some operators that are one operator combined with the assignment operator.

ALAN 2

No combos available. Instead, use:

SET a TO a op b.

Hugo

Hugo's assignment combos are:

+= -= *= /= &= |=

Inform 6

No combos available. Instead, use:

a = a op b

TADS 2 and TADS 3

TADS's assignment combos are:

+= -= *= /= %= &= |= ^= <<= >>=

See also


attributes

See properties.


authoring systems

There are many choices of programming languages or environments to create a work of interactive fiction with. Some of the systems are listed below (not an exhaustive list by any means):


between

This operation tests if a numerical value is between two other values (inclusive). Most authoring systems don't have a built-in operator for this. Programmers are usually comfortable using a combination of their system's less-than-or-equal-to and the logical-AND operators to do the job.

ALAN 2

n BETWEEN x AND y

Inform 6 and TADS 3

x <= n && n <= y

TADS 2

x <= n and n <= y

See also


bitwise AND

ALAN 2, Dialog, and Inform 7

Not supported.

Hugo, Inform 6, TADS 2, and TADS 3

a & b

ZIL

Learning ZIL mentions a BAND instruction (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. Because it also lists BTST, BOR, and BCOM, I assume BAND means bitwise AND.

See also


bitwise NOT

ALAN 2, Dialog, and Inform 7

Not supported.

Hugo, Inform 6, TADS 2, and TADS 3

~a

See also


bitwise operators

See

See also


bitwise OR

ALAN 2, Dialog, and Inform 7

Not supported.

Hugo, Inform 6, TADS 2, and TADS 3

a | b

ZIL

Learning ZIL mentions a BOR instruction (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. Because it also lists BTST, BAND, and BCOM, I assume BOR means bitwise OR.

See also


bitwise XOR

ALAN 2, Dialog, and Inform 7

Not supported.

Hugo and Inform 6

Not specified, but here's a workaround:

((a | b) & ~(a & b))

TADS 2 and TADS 3

a ^ b

See also


booleans

Also known as "binary constants" or "truth values". Boolean variables are sometimes called "flags".

ALAN 2

Not specified. Use 1 and 0 instead.

Hugo and Inform 6

Use true and false. These are equal to 1 and 0, respectively.

Inform 7

Use true and false. Their kind of value is a truth state.

TADS 2 and TADS 3

Use true and nil.

ZIL

Use T to mean true and <> to mean false. For example, here's how to declare two global boolean variables:

<GLOBAL SECRET-PASSAGE-OPENED <>>
<GLOBAL SLEEPY T>

Note that true and false are equivalent to 1 and 0, internally.

See


box quotes

ALAN 2

Not specified. Best you can do is put something like $n$t in front of each line of the quote.

Inform 6

box string+ ;

TADS 3

Use the <blockquote> and </blockquote> tags. May be abbreviated to <bq> and </bq>. Use <credit> and </credit> around the last line of the quote if it credits the quote's author.

See also


break-statement

ALAN 2

Not applicable.

Hugo

break

Inform 6 and TADS 2

break ;

TADS 3

break label? ;

See also


call-statement

Hugo

call var [( expr [, expr]* )]?

run object.property

See also


capacity

Inform 7

By default, the carrying capacity of the player, containers, and supporters is a maximum of 100 items. You can easily change the capacity of something with a statement like:

The carrying capacity of the cardboard box is 6.

See also


characters

This article is about the single-character data type. For info about people and actors, see creatures.

ALAN 2, TADS 2, and TADS 3

In ALAN and TADS, there is no distinct Character datatype. Just use strings; for example: "x" in ALAN, or 'x' in TADS.

Hugo and Inform 6

For example:

'x'

In Inform, be careful not to confuse character constants with dictionary words.

See also


character codes

ALAN 2

Use "" for a quote character, eg: "Bob says, ""Hi!"""

Use $n for a newline.

Use $z for a literal dollar-sign. (Actually, put any character after the $, as long as that combo doesn't mean anything to ALAN.)

Hugo

Use \" for a quote character, eg: "Bob says, \"Hi!\""

Use \n for a newline; use \\ for a literal backslash.

Accents, eg:  \`a = à; \'e = é; \^o = ô; \:u = ü; \,c = ç; \~n = ñ.

Also:  \< = «; \> = »; \! = ¡; \? = ¿; \ae = æ; \AE = Æ; \c = ¢; \L = £; \Y = ¥; \- = — (em-dash).

And, \#xxx = any ASCII character where xxx is a 3-digit number.

Inform 6

Use ~ for a doublequote, eg: "Bob says, ~Hi!~"

Use ^ for a newline, eg: "Line one^Line two"

Accents, eg:  @`a = à; @'e = é; @^o = ô; @:u = ü; @,c = ç; @~n = ñ; @oa = å; @\o = ø.

Also:  @<< = «; @>> = »; @!! = ¡; @?? = ¿; @ae = æ; @AE = Æ; @oe = œ; @OE = Œ; @ss = ß; @LL = £; @th = þ; @Th = Þ; @et = ð; @Et = Ð.

And, @@num for other characters, where num is the ZSCII value, eg: @@92 = \; @@64 = @; @@94 = ^; @@126 = ~.

Plus, @{hhhh} is a Unicode character, where hhhh is its hex value. Originally, few interpretors (if any) supported Unicode, but now it's becoming more commonplace.

TADS 2

Use \" for a quote character; \' for apostrophe.

Use \n for a newline; use \\ for a literal backslash.

Use \< for < (to disambig. vs. <<).

Use \- followed by any two bytes to pass those bytes literally (eg: for multi-byte characters like Japanese).

if using HTML-TADS:

Use &amp; for &; &lt; for <; &gt; for >.

Use named entities like &eacute; and &pound; to get special characters like é and £.

TADS 3

Similar to TADS 2, except that it's always in HTML mode, so entity codes like &amp; for '&', etc. are now required. Also, \- is no longer used; instead use Unicode characters, eg: \uABCD, where ABCD is the hexadecimal code value.

See also


classes

Inform 7

Inform 7 calls this a kind. You can create a new kind with a statement like this:

A planet is a kind of thing.

See also


clear-attribute-statement

ALAN 2

Make item NOT attribute .

Inform 6

give object ~attribute ;

Inform 7

Just use a normal assignment statement; for example:

A construction like not open will only work in an assignment like this when the property's kind has only two possible values.

TADS 2 and TADS 3

TADS never had "attributes", just properties that can take any value, including boolean ones:

object.property = nil;

ZIL

<FCLEAR object flag>

See also


clear-screen-statement

ALAN 2

Not specified. Fake it by printing a string with 24 \n characters in it.

Hugo

cls

Inform 6 (Z-code only)

@erase_window window

where window should be 0 for lower window, 1 for upper, or -1 for entire screen.

Inform 7 (Z-code only)

The following phrases are defined in Basic Screen Effects by Emily Short which is a built-in extension.

To clear the entire screen (including the status line):

To clear only one section of the screen, we also have:

TADS 2

clearscreen();

TADS 3

clearScreen();     // see tadsio.h

ZIL

<CLEAR integer>

where integer indicates which window to clear. The main window is window 0. You can have up to 8 windows.

See also


clothing

The basic model of clothing in most IF authoring systems is very simple:

It's also notable that clothing usually ignores any carrying capacity that the player might have. There's usually no built-in limit on how many items a character can wear.

ALAN 2

Declare a wearable object with the wearable attribute (see wear.i).

Locate it in the worn container to indicate that it's currently worn by the Hero (see invent.i).

Inform 6

Declare a wearable object with the clothing attribute.

Give the worn attribute to an object to indicate that it's currently worn by player. By default, worn affects only the player's clothing, not an NPC's.

Inform 7

Use the wearable adjective to give something the wearable property. For example, The bowler hat is wearable. means the hat is an article of clothing. (The wearable property is equivalent to Inform 6's clothing attribute.)

Clothing can also be defined indirectly via the verb "to wear" which asserts the wearing relation. For example, the assertion Fred is wearing the bowler hat. also gives the wearable property to the hat.

TADS 2

Declare a wearable object as an instance of clothingItem class.

Set the item's isworn property to true to indicate that it's currently worn by its parent object.

TADS 3

Declare a wearable object as an instance of Wearable class (see objects.t).

Set the item's wornBy property to the object that's wearing it.

ZIL

Give the WEARBIT flag to an object to make it wearable.

Give the WORNBIT flag to an object to indicate that it's currently worn.

See also


colors

ALAN 2

Can't specify colors.

Inform 6

TODO. Obviously the color capabilities of the Z-machine are much more limited than Glulx's.

See also


command grammar

Inform 6

Verb meta? verbWord+ grammarLine+ ;

Extend only? verbWord [first | last | replace]? grammarLine+ ;

where

verbWord  →  dictionaryWord

grammarLine  →  * grammarToken* -> actionID reverse?

Predefined English Verb directives are in grammar.h.

TADS 3

VerbRule(VerbTag) grammarLine : VerbTagAction
   verbPhrase = 'verb/verbing (what)? prep* (what)?'
   propertyDefinition*
;

where

grammarLine  →  ( grammarLine )  OR  grammarLine | grammarLine  OR  grammarToken*

Note that VerbRule is a macro defined in en_us.h, where VerbRule(tag) becomes grammar predicate(tag):; and grammar itself seems to be macro, whose definition eludes me. Predefined English VerbRules are in en_us.t.

See also


comments

Comments are private notes for the author's own benefit, to remind themselves of what they're trying to do with their code or why. Players normally never see these comments unless the author publishes their source code.

ALAN 2

-- This is a comment in ALAN 2.

-- There is no multi-line comment form in ALAN 2.

Dialog

%% This is a comment in Dialog. Comments run from the %% to the end of the line.

%% There is no multi-line comment form in Dialog.

Hugo

! This is a single-line comment in Hugo.

!\
  And this is a multi-line comment
  Which goes across more than one line.
\!

Inform 6

! This is a comment in Inform 6.

! There is no multi-line comment form in Inform 6.

Inform 7

Note that Inform 7 likes to render its comments in green.

[ This is a comment in Inform 7. ]

[ And this is a multi-line comment
  Which goes across more than one line. ]

[* This type of comment turns into a footnote when source code is published. ]

TADS 2 and TADS 3

// This is a single-line comment in TADS.

/*
  And this is a multi-line comment
  Which goes across more than one line.
*/

ZIL

; This is a comment in ZIL.

; There is no multi-line comment form in ZIL.

See also


comparison operators

See

See also


concatenation

See either:


conditional operator

ALAN 2, Inform 6, and Inform 7

Not supported. Use an if-statement instead.

TADS 2 and TADS 3

a ? b : c

See also


conjunction

Inform 6, TADS 2, and TADS 3

a , b

See also


containers

Containers are objects that can contain other objects. In some systems, a container is a property or attribute of an object, but in other systems, a container is a subclass of object.

Contrast containers with supporters, which are objects which you can put other objects on top of.

Inform 6

Give items the container attribute. If it is open, also give it the open attribute. If it's openable and closeable, also give it the openable attribute.

Inform 7

A container is a kind of thing. You can declare something as a container with a statement like:

The cardboard box is a container.

TADS 2

Declare items of class container or qcontainer. The latter is "quiet"; it doesn't list its contents in certain circumstances. Set its isopen property to true or nil as appropriate. If the container is also openable and closeable, also declare the container to be of class openable.

TADS 3

Declare with class BasicContainer, or Container, or one of Container's subclasses. Set its isOpen property to true or nil as appropriate. Use OpenableContainer for a container that is openable and closeable. Customize listing behaviour thru the properties isListed, isListedInContents, isListedInInventory, contentsListed, contentsListedSeparately, etc. (see Thing class).

See also


continue-statement

ALAN 2

Not applicable.

Inform 6 and TADS 2

continue ;

TADS 3

continue label? ;

ZIL

Inside a REPEAT instruction, use AGAIN to return to the beginning of the loop:

<AGAIN>

See also


creatures

Includes actors, "animates", animals, and people.

ALAN 2

Declare creatures with the Actor construct.

Dialog

Declare with the (animate $) trait.

Note that the (female $) and (male $) traits imply the (animate $) trait.

Inform 6

Give creatures the animate attribute.

TADS 3

Declare creatures as instances of Actor, or one of its subclasses: UntakeableActor or Person.

See also


data types

See


decrement

ALAN 2

Not supported. Instead, use: SET n TO n - 1.

Hugo, Inform 6, TADS 2, and TADS 3

pre-increment format:

--n

post-increment format:

n--

ZIL

Learning ZIL mentions a DEC instruction (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. If <DEC integer-variable> isn't valid, you'll have to do something like this:

<SETG SCORE <- ,SCORE 1>>

See also


defines property

Inform 6

object provides property

TADS 2

Use:  defined(object, &property)

Note that a property pointer is passed to defined().

TADS 3

Use:  object.propDefined(&property)

See also


description

Dialog

For room descriptions, use (look $).

For descriptions of things, use (descr $).

Inform 7

The description [of the-object-name] is "Some descriptive text."

If you don't include the "of the-object-name" clause, Inform 7 assumes you're implictly continuing to define the most recently named object earlier in your code.

See also


Dialog

Dialog is a new authoring system created by Linus Åkesson, first released in November 2018. It's a rule-based language inspired by both Prolog and Inform 7. The first major IF work written in Dialog is Tethered by Linus Åkesson, which was entered into the IF Comp 2018 event.

At the time of writing (November 2018), Dialog only creates works for the Z-machine 8 platform. Note also that the language is still in development and may change somewhat from its initial release.

External links

See also


dictionary words

ALAN 2

Not applicable. Use normal and quoted variables in NAME phrases. Also, see the SYNTAX construct.

Hugo

eg:  "x" "joe's" "silver" "keys"

Always in doublequotes. Doesn't use Inform's //p, etc.

Inform 6

eg:  'x//' 'joe^s' 'silver' 'keys//p'
or "x" "joe^s" "silver" "keys//p"

The single-quoted syntax is the preferred form. Use ^ for an apostrophe, eg: 'joe^s'. Append // for a single-character dictionary word, eg: 'c//'. Append //p for a word that is always plural, eg: 'keys//p'. Nine character resolution; note that digits and typewriter symbols count as two characters, and accented characters even more.

TADS 2 and TADS 3

Not applicable. Use string constants, eg:  'x' 'joe\'s' 'silver' 'keys'.

See also


direction objects

TODO

See also


direction properties

This article is about the exits of a room, most of which are almost always named after compass directions.

ZIL

Rooms can have the properties NORTH, SOUTH, EAST, WEST, NE, SE, NW, SW, UP, DOWN, IN, and OUT.

ZIL understands five types of exits: UEXIT (unconditional exit), CEXIT (conditional exit), FEXIT (function exit), NEXIT (non-exit), and DEXIT (door exit). Examples of each below:

The ELSE clauses in CEXITs and DEXITs are optional; there are default refusal messages.

See also


division

Division of two numeric values is done with an operator, usually a forward-slash character. Note that we mean integer division here, where any remainder is ignored and the result is also an integer.

ALAN 2, Hugo, Inform 6, Inform 7, TADS 2, TADS 3

x / y

Dialog

($A divided by $B into $C)

A and B must be bound to numbers; C is unified with the (integer) quotient after dividing A by B. The query fails if B is zero.

Inform 7

ZIL

See also


do-statement

ALAN 2

Not applicable.

Hugo

do statement NL while expr

Inform 6

do statement until ( expr ) ;

TADS 2 and TADS 3

do statement while ( expr ) ;

See also


doors

ALAN 2

Not specified. Section 6.4 of the Alan manual suggests defining two door objects, one for each side. Define the doors' VERB open clauses to open both sides simultaneously (MAKE side1 NOT closed. MAKE side2 NOT closed.). Also, define the EXIT clauses in the rooms to CHECK side1 IS NOT closed.

Inform 6

Give a door object the door, static, and openable attributes, and if applicable, the open and lockable attributes. Set the appropriate exits in the rooms to point to the door itself, eg: n_to green_door. Set the door's door_to property to the destination room, and the door's door_dir property to the direction, eg: n_to. Optionally, define the door's when_open and when_closed properties.

Typically, an Inform 6 door is also defined as a floating item; set its found_in property to a list of the two rooms that the door is found in. If you do this, remember to make the door's door_to and door_dir properties into routines to return the appropriate value based on self.location.

TADS 3

Most doors should be declared as instances of class Door. (Other possibilities include SecretDoor, HiddenDoor, and AutoClosingDoor.) For normal two-way doors, declare a pair of Door objects, one for each side of the door. One side will be the 'master'; set the other side's masterObject property to the first side. For one-way doors, you will need to set the destination property of the door. Since a Door is also a TravelConnector, you can easily associate a Door with its direction of travel by setting the appropriate direction property of the room with the door, e.g.: north = bedroomDoor

See also


edible

See food.


element of an array

ALAN 2

Not applicable.

Hugo

The first element of a Hugo array is at index 0.

array [ index ]

Inform 6

The first element of an Inform 6 array is at index 0.

wordarray --> index

bytearray -> index

TADS 2 and TADS 3

The first element of a TADS list is at index 1.

list [ index ]

See also


equal to

This is about comparing two values to determine if they're equal. For setting a variable to be equal to some value, see assignment.

ALAN 2, Hugo, TADS 2 (default style), and TADS 3

x = y

Dialog

To check for numerical equality, use regular unification, i.e. ($ = $).

Inform 6 and TADS 2 (C mode syntax)

x == y

ZIL

Tests if the first argument is equal to any of the others; the last two arguments are optional:

<EQUAL? integer1 integer2 integer3 integer4>

If you just want to test if a value is equal to zero, there's a special instruction for that:

<ZERO? integer>

See also


escape sequences

ALAN 2

Dialog

The special characters in Dialog are #, $, @, ~, *, |, \, parentheses, brackets, and braces. Prefix with \ to print.

Hugo

Inform 6

TADS 2

Also, if using HTML-TADS, several HTML tags like <b>, <i> and <font> are supported, plus a few tags unique to HTML-TADS, eg: <sound>.

See also


exits

See direction properties.


extended OR

Hugo

a , b

For example:

if x = 2, 3, 5, 7, 11

Inform 6

a or b

For example:

if (player in Forest or House or Lake)

TADS 2

Not supported. Write the condition in full.

TADS 3

You may use (a , b) in conjunction with is in or not in. For example:

if (cheese is in (brie, cheddar, swiss))

See also


first child of

Hugo

child(parentObj)

eldest(parentObj)

Inform 6

child(parentObj)

ZIL

<FIRST? object>

See also


floating items

By "floating items", we mean objects found in multiple locations.

ALAN 2

Locate your floating objects in pure containers, using the Container structure. Objects in pure containers are always where the Hero is. Create a matching storage object with the container property, and define a pair of rules to EMPTY the contents from pure container to storage container (and vice-versa) when appropriate. (See 6.10 of the ALAN manual.)

Inform 6

Define the object's found_in property as either a list of locations, or as a routine which returns true if the item should be found in location. Note that if a floating object is also given the absent attribute and the object removed, then the found_in property is ignored, and the object isn't anywhere.

TADS 2

Declare as of class floatingItem in addition to at least one other class. Only floatingItem objects may have a variable location property.

See also


floating point

See real numbers.


fonts

ALAN 2

Not supported. Can't specify the text font within the program. If you want to use ASCII graphics, you'll have to ask the player to make sure their ALAN interpreter is using a fixed-width font, and play the entire game that way.

See also


food

Note: Food only, not drinks (see liquids). By default in most systems, edible objects are removed from the game when eaten.

ALAN 2

If using std.i, use IS edible.

Inform 6

Give the edible attribute to a object that can be eaten. Nourishment is not modeled.

TADS 2

Declare an edible object as a member of fooditem class. Also, global.lastMealTime is decremented by the item's foodvalue property. By default, the foodvalue property is set to global.eatTime.

TADS 3

Declare an edible object as an instance of Food class. Nourishment is not modeled.

See also


for-statement

ALAN 2

Not applicable.

Inform 6

for ( expr? : expr? : expr? ) statement

Inform 7

repeat with var running from expr to expr begin; statements; end repeat.

Hugo and TADS 2

for ( expr? ; expr? ; expr? ) statement

TADS 3

for ( initlist ; expr? ; expr? ) statement

where   initlist   →   init [, init]*

and   init   →   local? id = expr

See also


formatting

See output.


functions

Examples of how you'd write a function.

Inform 6

[ addlist arg1 arg2   sum count i;
  ...statements...
  return sum;
];

TADS 2

addlist: function(arg1, arg2)
{
  local sum, count, i;
  ...statements...
  return(sum);
}

TADS 3

function addlist(arg1, arg2)
{
  local sum, count, i;
  ...statements...
  return sum;
}

ZIL

<ROUTINE ADDLIST (ARG1 ARG2 "AUX" SUM COUNT I)
   <guts-of-the-routine>
   <RETURN .SUM>>

See also


gender

It's often necessary to mark objects as male, female, or neuter, so the work can generate the correct pronouns for them, or so the player can refer to the objects by their pronouns.

ALAN 2

Not specified. Although it's simple to give Actors attributes like IS male or IS female, you still need to write your code to check for those attributes.

Dialog

By default, objects have no particular gender. Use the (male $) and (female $) traits to declare an object's gender. Note that the gendered traits imply the (animate $) trait.

Inform 6

By default, animate objects are male, and all other objects are neuter. Give the male, female, or neuter attribute to an object to indicate its gender.

TADS 2

By default, all objects are neuter. Set the isHim or isHer property of an object to true to indicate gender.

ZIL

Most objects are neuter by default. If the object has the PERSONBIT flag set, the object is considered an Actor and is assumed to be male, unless it also has the FEMALEBIT flag set, in which case the Actor is understood to be female.

See also


goto-statement

ALAN 2

Not applicable.

Hugo

jump label

Inform 6

jump label ;

TADS 2 and TADS 3

goto label ;

See also


graphics

ALAN 2

n/s. No graphics support as yet.

Inform 6

Z-Code: TODO (v6 only)

Glulx-Code:

glk_image_draw(window, image, val1, val2)

glk_image_draw_scaled(window, image, val1, val2, width, height)

See also


greater than

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

x > y

Dialog

($A > $B)

This predicate succeeds if and only if A is numerically greater than B.

Inform 7

ZIL

See also


greater than or equal to

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

x >= y

Inform 7

ZIL

Is it not supported? Do this instead:

<OR <G? int1 int2> <EQUAL? int1 int2>>

See also


has attribute

ALAN 2

object IS attribute

Hugo

object is attribute

Inform 6

object has attribute

TADS 2 and TADS 3

n/a. Use: object.property

ZIL

<FSET? object flag>

See also


hasn't attribute

ALAN 2

object IS NOT attribute

Hugo

object is not attribute

Inform 6

object hasnt attribute

TADS 2 and TADS 3

n/a. Use: !object.property

ZIL

I think you'd have to do it like this:

<NOT <FSET? object flag>>

See also


Hello, World! examples

Dialog

(program entry point)
	Hello, world!

Hugo

routine main
{
  print "Hello world"
  pause
  quit
}

Inform 6

[ Main; print "Hello world^"; ];

Inform 7

"Hello World" by John Smith

Hello World is a room.

TADS 3

#include "tads.h"
main(args)
{
  "Hello from TADS 3!!!\b";
}

hidden

Or concealed. TODO.

See also


identifiers

ALAN 2

Normal identifiers must not start with a digit. May contain letters, digits or underscores. Max length TBD.

There are also quoted identifiers, which must begin and end with single-quotes, and may contain any character (including spaces). Note that there are several restrictions on when and how to use quoted identifiers.

Normal identifiers are not case sensitive; however, quoted indentifiers are case sensitive.

Hugo and Inform 6

Identifiers must not start with a digit. May contain letters, digits or underscores. Can be up to 32 characters long.

Identifiers are not case sensitive; room101 is the same ID as Room101.

TADS 2

Identifiers must start with a letter. May contain letters, digits, dollar signs, or underscores. Can be up to 39 characters long.

Identifiers are case sensitive! showSum is distinct from showsum and ShowSum.

TADS 3

Valid characters TBD. Can be up to 40 characters long.

Identifiers are case sensitive! showSum is distinct from showsum and ShowSum.

ZIL

As near as I can tell without actually using ZIL, identifiers probably must begin with an uppercase letter, and may only contain uppercase letters, hyphens, and digits. I have no idea how long they can be. Since lowercase letters aren't permitted in IDs, the issue of case sensitivity is avoided.


if-statement

ALAN 2

IF expr THEN statement* [ELSIF expr THEN statement*]* [ELSE statement*]? END IF.

Hugo

if expr NL statement [NL elseif expr NL statement]* [NL else statement]?

Inform 6, TADS 2, and TADS 3

if ( expr ) statement [else statement]?

Inform 7

if condition [then | ,] phrase [; otherwise phrase]

if condition begin; phrases; [otherwise; phrases;] end if

See 10.5, 10.7, 10.8. Note: else can be used instead of otherwise.

ZIL

<COND (<predicate> <do-stuff>)*>

See also


include-statement

During the pre-processing phase of compilation, include-statements are replaced with the contents of the files they refer to.

ALAN 2

$INCLUDE 'filename'

Inform 6

Include "filename";

Include ">shortname";

Use #Include (with the #) if using the directive inside a routine.

See also


increment

ALAN 2

Not supported. Instead, use: SET n TO n + 1.

Hugo, Inform 6, TADS 2, and TADS 3

pre-increment format:

++n

post-increment format:

n++

ZIL

Learning ZIL mentions an INC instruction (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. If <INC integer-variable> isn't valid, you'll have to do something like this:

<SETG PIZZA-EATEN <+ ,PIZZA-EATEN 1>>

See also


Inform 7

Links

See also


initial appearance

See also


initial location

How to specify the protagonist's initial location? This can be awkward because the object that defines the protagonist is often hidden deep within the authoring system's libraries, which a story author can't directly edit.

ALAN 2

This is the first line of the Start section, eg:

START AT Kitchen.

Inform 6

Set the value of location in the Initialise function, eg:

location = Bedroom;

TADS 2

The ID of the initial location must be startroom, eg: TODO.

See also


initial text

ALAN 2

Put introductory text in the Start section, after the "START AT" statement.

Inform 6

Put introductory text in the Initialise function.

See also


input

See


input-statement

Hugo

input

pause

TODO: explain what input and pause do.

TADS 3

Kwi tells me, "when using the standard library, you should call inputManager methods instead of inputLine() etc., to ensure that any pending output is displayed first." Which means that this section needs a TODO label stuck on it. :(

All are intrinsic functions; see tadsio.h and t3tadsio.htm.

See also


integers

ALAN 2

Integers must be in decimal notation, eg: 4205.

ALAN 2's integer range is TBD.

Dialog

A number is a non-negative integer in the range 0–16383 inclusive. The printed representation of a number is always in decimal form, with no unnecessary leading zeros. Numbers that appear in the source code must also adhere to this format.

Hugo

Integers must be in decimal notation, eg: 4205.

Hugo's integer range is from −32768 to 32767.

Inform 6

Integers may in decimal, hex, or binary notation.

hex example:  $3f08 (begins with $)

binary example:  $$1000111010110 (begins with $$)

Inform 6's integer range is from −32768 to 32767.

Inform 7

Inform 7's integer range is from −32768 to 32767.

TADS 2 and TADS 3

Integers may be in decimal, hex, or octal notation.

hex example:  0x3f08 (begins with 0x)

octal example:  035 (begins with 0)

TADS's integer range is from −2147483648 to 2147483647 (signed 32-bit integer).

ZIL

ZIL's integer range is from −32767 to 32767, according to §7.1 of Learning ZIL.

See also


is in

ALAN 2

object IN obj2

object AT location

object HERE

object NEARBY

Hugo

object in obj2

Inform 6

object in obj2

TADS 2

Use:  object.location = obj2

TADS 3

object.isIn(obj2)   // indirect containment

object.isDirectlyIn(obj2)   // direct containment

Although T3 still uses the location property, you are advised not to fiddle with it directly. See also in the Thing class: isNominallyIn(obj), isInFixedIn(loc), isHeldBy(actor), isOwnedBy(obj).

See also


is not in

ALAN 2

object NOT IN obj2

object NOT AT location

object NOT HERE

object NOT NEARBY

Hugo

object not in obj2

Inform 6

object notin obj2

TADS 2

Use:  object.location <> obj2

TADS 3

!object.isIn(obj2)   // indirect containment

!object.isDirectlyIn(obj2)   // direct containment

Although T3 still uses the location property, you are advised not to fiddle with it directly. See also in the Thing class: isNominallyIn(obj), isInFixedIn(loc), isHeldBy(actor), isOwnedBy(obj). (Negate with ! like any other T3 expression.)

See also


is of class

ALAN 2

object ISA class

Note: ISA is only useable in Syntax constructs.

Hugo

TODO. I note that object.type returns the value of object's primary class, but that's not quite the same thing.

Inform 6

object ofclass class

TADS 2

isclass(object , class)

TADS 3

object.ofKind(class)

See also


keys

This is about keys in the story world, things that unlock other things.

ALAN 2

Not specified.

Inform 6

Not specified. However, to associate a key with the thing it unlocks, set the lockable object's with_key property to the key object.

TADS 2

Declare a key of class keyItem. To associate a key with the thing it unlocks, set the keyLockable item's myKey property to the key object.

TADS 3

Declare a key of class Key (see extras.t). To associate keys with the thing they unlock, set the LockableWithKey item's keyList property to a list of key objects, eg:

frontDoor.keylist = [ brassKey, masterKey ]

See also


label-statement

ALAN 2

Not applicable.

Hugo

: label

Inform 6

. label ;

TADS 2

label : ;

See also


language

ALAN 2

Supports either English or Swedish games via the Language option. According to the Alan manual: "Other non-English languages may be supported in the future depending on demand."

Hugo

English only. Maybe. The Hugo manual doesn't seem to address this topic.

Inform 6

For a non-English Inform game, one must replace (at minimum) both the english.h and grammar.h files with language-specific versions. Versions of these files have been written in other languages, including French, German, Italian, and even Lojban. There exists a Spanish variant of Inform called InformATE. It helps if the target language is close to English in structure and alphabet. It would be very difficult to create Inform language files for Arabic or Japanese.

TADS 2

At minimum, a non-English TADS game would require one to replace/rewrite both the adv.t and std.t files. I'm not at all certain if that is sufficient or not. Still, TADS seems to be have the most potential for non-English language support: there was a Chinese game in TADS3 [**check this**], released in 2002.

See also


last child of

Hugo

youngest(parentObj)

Inform 6

Not specified. One could write a function to figure it out, though, if you had to.

See also


left shift

ALAN 2, Dialog, Hugo, and Inform 7

Not supported.

Inform 6

In Z-code:

@log_shift a b -> result

TADS 2 and TADS 3

a << b

ZIL

Learning ZIL mentions a SHIFT and ASHIFT instructions (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. I'm guessing one of these means left shift?

See also


less than

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

x < y

Dialog

($A < $B)

This predicate succeeds if and only if A is numerically less than B.

Inform 7

ZIL

See also


less than or equal to

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

x <= y

Inform 7

ZIL

Is it not supported? Do this instead:

<OR <L? int1 int2> <EQUAL? int1 int2>>

See also


light

ALAN 2

Not specified. However, section 6.11 of the ALAN manual suggests an approach. First, declare the default attributes for objects and locations as:

Object Attributes
   lightsource 0.
Location Attributes
   lit.

Set lightsource OF an object TO 5 (or some other non-zero value) when it's lit. Set dark rooms to IS NOT lit. Then, test for SUM OF lightsource HERE = 0 in your dark rooms and test for SUM OF lightsource HERE = 0 AND LOCATION IS NOT lit in your new Look verb definition. Also, you must use a container trick to swap out visible objects so they aren't described when you enter a dark room.

Inform 6

Give the light attribute to an object or room to indicate that it gives off light or is lit. By default, all objects and rooms are unlit.

TADS 2

Declare light-emitting objects of class lightsource. Set its islit property to true or nil as appropriate. Declare lit locations of class room, and unlit locations of class darkroom. To give a darkroom light, set its lightsOn property to true; don't change its islit property, because it is a routine.

TADS 3

Light is a potentially complicated topic in TADS 3. Here's the basics:

See also


liquids

ALAN 2

If using std.i, and the liquid is drinkable, use IS drinkable. No other support.

Inform 6

Not specified. The author in on their own in handling liquids' various properties, eg: availablity (eg: general water vs. carryable water), drinking, divisibility, evaporation, effects of emmersion/soaking, floating/density, mixing of liquids, portability (which containers may carry liquid), quantity, swimming.

See also


list concatenation

ALAN 2

Not applicable.

Inform 6

Not supported.

TADS 2 and TADS 3

a + b

where a must be a list, and b must be either a list or of a data type that can be in a list.

See also


list subtraction

ALAN 2

Not applicable.

Inform 6

Not supported.

TADS 2 and TADS 3

a - b

where a must be a list, and b must be either a list or of a data type that can be in a list.

See also


local-statement

ALAN 2

Not applicable. Instead, declare "local variables" as other attributes in your Objects, Locations, and Actors.

Inform 6

Not applicable. A function's local variables are declared as part of the function's declaration frame.

Hugo

local var [, var]*

See also


location

See also


locks

Inform 6

Give it the lockable attribute.

TADS 2

Declare it of class lockable or keyedLockable, both of which are subclasses of openable.

TADS 3

Use the Lockable mix-in class for lockable objects. The predefined subclasses of Lockable are IndirectLockable, LockableContainer, LockableWithKey, and KeyedContainer.

ZIL

Set the LOCKEDBIT flag on an object to indicate that it is locked.

See also


logical AND

ALAN 2

a AND b

Hugo

a and b

Inform 6

a && b

TADS 2

a and b

a && b   // alternate syntax

TADS 3

a && b

ZIL

<AND predicate1 predicate2>

Note that you're not limited to two predicates; one example shows you can have at least four.

See also


logical NOT

ALAN 2

Not supported. However, you can use NOT as a modifier of another operation. For example, instead of NOT(x = y), use x NOT = y. And instead of NOT(x IS male AND y AT House), use x IS NOT male OR y NOT AT House.

Hugo

not a

Inform 6

~~a

TADS 2

not a

!a   // alternate syntax

TADS 3

!a

ZIL

<NOT predicate>

See also


logical operators

See

See also


logical OR

ALAN 2

a OR b

Hugo

a or b

Inform 6

a || b

TADS 2

a or b

a || b   // alternate syntax

TADS 3

a || b

ZIL

<OR predicate1 predicate2>

Note that you're not limited to two predicates; one example shows you can have at least four.

See also


macros

See also


modulus

See remainder.


move-statement

ALAN 2

To move an object (or the Hero) normally:

LOCATE object where_clause.

To remove an object from the game, create a Location that the Hero can't reach and Locate the object there (NOWHERE is part of std.i):

LOCATE object AT NOWHERE.

A where_clause is one of IN object, AT location, HERE, or NEARBY.

Hugo

move obj to loc

remove obj

Inform 6

move obj to loc ;

remove obj ;

TODO: You should use something else to move the player.

Inform 7

The very powerful now statement should be used for this, eg:

now the player is in Mountain Plateau;
now the player is carrying the broken string;
now the balloon is nowhere;

TADS 2

obj.moveInto(loc)

TADS 3

obj.moveInto(loc)   // for normal movement

obj.mainMoveInto(loc)   // for teleport-style moves

Move things to nil to remove them from the story world.

(There is also obj.moveIntoForTravel(loc), but I haven't figured that one out yet.)

ZIL

To move object1 into object2:

<MOVE object1 object2>

To remove object1 from the story world:

<REMOVE object>

To teleport the PC into a room, triggering any appropriate on-entry routines:

<GOTO room>

To attempt making the PC go a specific direction:

<DO-WALK ,P?direction-property>

See also


multiplication

Multiplication of two numeric values is done with an operator, usually an asterisk sign.

ALAN 2, Hugo, Inform 6, Inform 7, TADS 2, TADS 3

x * y

Dialog

($A times $B into $C)

A and B must be bound to numbers; C is unified with their product. If the product is outside the valid range of numbers, the query succeeds, but the numeric result is unpredictable (i.e. it depends on the interpreter).

Inform 7

ZIL

See also


name

See also


next sibling of

Hugo

sibling(childObj)

younger(childObj)

Inform 6

sibling(childObj)

ZIL

<NEXT? object>

See also


not equal to

ALAN, TADS 2 (default style)

x <> y

Hugo, Inform 6

x ~= y

TADS 2 (C mode syntax) and TADS 3

x != y

See


noun grammar

How are the input grammars for objects (that is, their adjectives and nouns) defined?

Dialog

At the time of writing (November 2018), Dialog assumes that all words declared by either (name $) or (dict $) are valid words for the player to use to refer to the object. There are no distinctions between adjectives and nouns. Complex noun phrases might possibly be handled via (rewrite $ into $) during parsing the player's command, but I'm not sure if that's the best place to do it.

TADS 3

'adjective* noun[/noun]* [* pluralnoun+]?'

For example:

'painted framed picture/portrait*pictures portraits'

Note 1: Put brackets around a vocabword to mark it as a "weak" word.

Note 2: Use a hyphen character by itself to represent no noun.

See also


objects

Common objects

See also


object-loop-statement

ALAN 2

Not supported. But depending on what you're trying to do, you may be able to use one of the aggregates COUNT, SUM OF property, or MAX OF property; eg:

Hugo

for var in object NL statement

Inform 6

objectloop condition statement

Inform 7

repeat with var running through expr begin; statements; end repeat.

See also


object operations

By "object operations", we mean any predefined functions, operators, and statements that manipulate objects in any way.

See

See also


open-file-statement

Hugo

readfile filename NL statement

Opens a file for reading at the beginning of the block, and closes the file at the end.

Inform 6

If Z-Code, use one of:

@input_stream n     ! 0=keybd; 1=file

@output_stream n array?     ! ±1=screen; ±2=script file; ±3=array; ±4=command file

Positive values open a stream; negative values, close it. [see DM4 §42]

TADS 2

fopen(filename, mode);

See also


operators

See


output

This category is about all output issues, including text formatting.


panel layout

ALAN 2

Fixed two-panel layout: main text panel and status bar panel at top. No control over status bar's contents. In the Options Section of your program, you may specify a Width of line to display, and a Length value representing how many lines to display before a <More> prompt, but an interpreter may ignore these options.

See also


parent of

Hugo and Inform 6

parent(childObj)

TADS 2

Best approximation is probably:

object.location

See also


parts of objects

ALAN 2

Not supported. If the parent object isn't fixed in place, you'll probably have to use the container trick to keep sub-objects with their parent; see containers and floating objects.

Inform 6

Not supported. Use workarounds to put the part in scope:

TADS 3

Declare as an instance of the Component class.

See also


play-sound-statement

How do we play sounds or music?

ALAN 2

Not supported.

Hugo

music repeat? "file" , "song" [, vol]?

music 0

sound repeat? "file" , "sample" [, vol]?

sound 0

Inform 6

For Z-Code, z5 or z6 or z8 only:

@sound_effect number effect? volrep? routine?

See DM4 §42.

Also test if (($10-->0) & 128 ~= 0) then the player's interpreter can play sound.

For Glulx-Code:

glk_schannel_play(channel, sound)

glk_schannel_play_ext(channel, sound, repeats, notify)

TADS 2

For HTML-TADS:

Use the <SOUND> tag:

"<sound src='resourcefile' layer=foreground|bgambient|ambient|background random=n repeat=n|loop sequence=replace|random|cycle interrupt cancel[=layer] alt='text' fadein=n fadeout=n>";

ZIL

<SOUND integer1 integer2 integer3 integer4>

where:

See also


plural

If a single object has a plural name like "glass shards", you want to mark the item as plural for two reasons. First, you want the default indefinite article to be "some" (instead of "a" or "an"). Second, you want the work or the player to be able to refer to the object with they/them pronouns.

Contrast with plural name.

Dialog

Declared with the (plural $) trait.

Inform 6

Use the pluralname attribute in the object's has clause.

Inform 7

Inform can usually infer whether your objects are singular or plural from your use of "is", "are", or "some" when you first declare the object without you needing to otherwise declare its pluralness more explicitly. If you do need to specify it explicitly, use the either/or properties singular-named and plural-named respectively. For example:

The fruit are plural-named.

ZIL

Set the object's PLURALBIT flag; see Appendix B in Learning ZIL.

See also


plural name

If you have a class of objects that share a name, like "key", you may want the player to be able to refer to all the keys at once, but to do that, you need to code the word "keys" as the plural name of all "key" objects.

Contrast with plural.

Dialog

(plural dict $) associates plural synonyms with an object or set of objects. For example:

(plural dict (stone $))
	stones

Inform 6

For input, the dictionary words in an object's name field that end in //p are understood to be a plural name for the object. For example:

'books//p'

For output, the plural field of an object specifies a string (or a routine to print a string) with the plural name of that object.

Inform 7

An example from Writing with Inform:

Understand "birds" as the plural of duck.

Inform also itself needs to understand plural forms within your source code. Writing with Inform claims Inform is quite good at guessing likely plurals for many English nouns, but admits that English is irregular enough that you still might need to explicitly declare a plural form:

The plural of something is somethings.

For example:

The plural of brother in law is brothers in law.

ZIL

I'm guessing this is specified with the PLURAL property? It's mentioned but not described in Appendix A in Learning ZIL.

See also


pointer dereference

ALAN 2 and Inform 6

Not applicable.

TADS 2

(pointer)

For example:

obj.(propPtr)(actor);

See also


portable

See also


pragmas

ALAN 2

Closest equivalent is the optional Options Section at the beginning of an ALAN source file. The Options Section begins with the word OPTIONS followed by one or more option statements:

Note that an interpreter may override the Width and Length options, and that debugging may be enabled instead by a compiler option.

Inform 6

See also


pre-processing

See


pre-processing conditionals

Inform 6

See also


predefined variables

TODO.


predefined verbs

Inform 6

debugging metaverbs:  abstract, actions, changes, daemons, gonear, goto, messages, purloin, random, recording, replay, routines, scope, showobj, showverb, timers, trace, tree.

metaverbs:  brief, die, full, fullscore, long, normal, noscript, notify, nouns, objects, places, pronouns, q, quit, restart, restore, save, score, script, short, superbrief, transcript, unscript, verbose, verify, version.

game verbs:  adjust, answer, ask, attach, attack, awake, awaken, blow, bother, break, burn, buy, carry, check, chop, clean, clear, climb, close, consult, cover, crack, cross, curses, cut, d, damn, darn, describe, destroy, dig, discard, display, disrobe, dive, doff, don, down, drag, drat, drink, drop, dust, e, east, eat, embrace, empty, enter, exit, examine, fasten, feed, feel, fight, fill, fix, fondle, fuck, get, give, go, grope, hear, hit, hold, hop, hug, i, in, inside, insert, inv, inventory, jump, kill, kiss, l, leave, lie, light, listen, lock, look, move, murder, n, nap, ne, no, north, northeast, northwest, nw, offer, open, out, outside, pay, peel, pick, polish, pray, present, press, prune, pull, punch, purchase, push, put, q, quit, read, remove, rotate, rub, run, s, say, scale, screw, scrub, se, search, set, shed, shift, shine, shit, shout, show, shut, sing, sip, sit, skip, sleep, slice, smash, smell, sniff, sod, sorry, south, southeast, southwest, speak, squash, squeeze, stand, sw, swallow, sweep, switch, swim, swing, take, taste, tell, think, throw, thump, tie, torture, touch, transfer, turn, twist, u, uncover, undo, unlock, unscrew, unwrap, up, w, wait, walk, wake, watch, wave, wear, west, wipe, wreck, x, y, yes, z.

other verbs: again, amusing, g, o, oops.

TADS 3

debugging verbs: debug.

game verbs: a, about, activate, affirmative, aft, again, ask, attack, attach, back, blow, board, break, buckle, burn, bye, clean, climb, close, connect, consult, consume, credits, cut, d, deactivate, destroy, detach, dig, disconnect, disembark, drag, drink, drop, doff, don, douse, down, e, east, eat, enter, examine, exit, exits, extinguish, f, fasten, feel, find, flip, follow, footnote, footnotes, fore, foreward, full, fullscore, g, get, give, go, greet, good, good-bye, goodbye, hear, hi, hint, hints, hit, hello, holler, i, ignite, imbibe, in, inspect, inventory, jump, kick, kiss, kill, l, leave, lie, light, listen, lock, look, move, n, ne, negative, no, north, northeast, northwest, note, notify, nw, o, offer, oops, open, out, p, pause, pick, place, plug, port, pour, press, pull, punch, push, put, q, quaff, quit, read, record, remove, replay, restart, restore, return, rotate, rq, ruin, s, save, say, sb, score, scream, screw, script, se, search, set, shout, show, shut, sit, sleep, smell, sniff, south, southeast, southwest, stand, starboard, status, strike, sw, switch, t, take, talk, taste, tell, terse, throw, topics, toss, touch, turn, twist, type, u, undo, unbuckle, unfasten, unlock, unplug, unscrew, unscript, up, verbose, version, w, wait, walk, wear, west, wreck, x, yell, yes, z.

See also


previous sibling of

Hugo

elder(childObj)

Inform 6

Not supported. But you could write a function to figure it out, if you needed to.

See also


Hugo

print print-arg [; print-arg]*

printchar var [, var]*

See also


ALAN 2

Not supported.

Hugo

picture "resourcefile" , "picture"

picture "picturefile"

See also


Dialog

Dialog does its best to collapse consecutive requests for line and paragraph breaks into something sensible.

Hugo

print newline

Inform 6

new_line;

TADS 2 and TADS 3

"\n";

See also


properties

Common properties of objects

See also


property of

ALAN 2

property OF object

Inform 6, TADS 2, and TADS 3

object.property

See also


protagonist

Also known as the player-character or the PC, this object respresents the player within the game, or is the character that the player directly controls.

ALAN 2

Use HERO, which is pre-defined. Its container property is INVENTORY. If you need to give new attributes to Hero, then explicitly declare Hero with the appropriate Actor construct.

Inform 6

Use player (a global declared in parserm.h), which refers to the selfobj object (also declared in parserm.h).

TADS 2

Use Me, which is of class BasicMe.

TADS 3

There is no predefined PC object; you must create your own. Typically, one defines me as an instance of class Actor, and then within the mainCommon function, set gPlayerChar = me; so the game knows which object represents the player character.

See also


quit-statement

This is for ending the program immediately.

ALAN 2

QUIT .

Dialog

(quit)

Hugo

quit

TADS 3

throw new QuittingException;

(TODO: Is this for adv3 only? This needs more explanation.)

ZIL

<QUIT>

See also


random number

Dialog

(random from $A to $B into $C)

A and B must be bound to numbers, such that B is greater than or equal to A. A random number in the range A to B (inclusive) is picked, and then unified with C.

ZIL

Returns a random number between one and the given number, inclusive:

<RANDOM integer>

See also


real numbers

ALAN 2, Dialog, Hugo, Inform 6, TADS 2, ZIL

No support. By default, most specialized authoring systems for interactive fiction don't provide any native support for real numbers or floating point arithmetic. It's almost never necessary.

TADS 3

Supported via the BigNumber class, able to represent values from 10−32,767 to 1032,767. (See t3_doc\t3bignum.htm)

See also


remainder (aka modulus)

ALAN 2

ALAN 2 has no built-in operator for this. You'll have to do it the hard way:

(x - ((x / y) * y))

Dialog

($A modulo $B into $C)

A and B must be bound to numbers; C is unified with the remainder after dividing A by B. The query fails if B is zero.

Hugo

mod(x, y)

Inform 6, TADS 2, and TADS 3

x % y

Inform 7

remainder after dividing X by Y

ZIL

<MOD integer1 integer2>

See also


reserved words

TODO.


return-statement

ALAN 2

Not applicable.

Hugo

return expr?

TADS 2 and TADS 3

return expr? ;

ZIL

See also


right shift

ALAN 2, Dialog, Hugo, and Inform 7

Not supported.

Inform 6

In Z-code:

@log_shift a -b -> result

TADS 2 and TADS 3

a >> b

ZIL

Learning ZIL mentions a SHIFT and ASHIFT instructions (in a bare list of "other instructions") and to see the YZIP Spec for more information. YZIP was Infocom's interpreter for Z6 games. I'm guessing one of these means right shift?

See also


rooms

By long custom, distinct locations in a work of IF are called rooms, even if the locations are outdoors, underwater, or in the vacuum of outer space.

ALAN 2

Use the Location construct, eg:

LOCATION Kitchen
   DESCRIPTION "What a boring room. The exit is east."
   EXIT east TO Hallway.
END LOCATION Kitchen.

Inform 6

There is no default room class. A room is just another object. Objects that can be entered (eg: chairs, beds) are given the enterable attribute. Define its cant_go property to define a room's "you can't go that way" message.

TADS 2

The base room class is room. Subclasses are darkroom for unlit rooms, and nestedroom for enterable objects within a room, which in turn has chairitem, beditem and vehicle subclasses. Define its noexit method to print a room's "you can't go that way" message (and which should also return nil).

TADS 3

Implemented via the Room class or any of its subclasses; eg: Darkroom, OutdoorRoom, FloorlessRoom. Use the mix-in class ShipboardRoom with another Room class for shipboard locations. Use BasicLocation or one of its many subclasses for any other location.

See also


set-attribute-statement

ALAN 2

Make item attribute .

Inform 6

give object attribute ;

Inform 7

Just use a normal assignment statement; for example:

now the umbrella is open;

TADS 2 and TADS 3

TADS never had "attributes", just properties that can take any value, including boolean ones:

object.property = true;

ZIL

<FSET object flag>

See also


set-colors-statement

ALAN 2

Not applicable.

Hugo

color foreground [, background [, input ]]

Inform 6

Z-Code:

@set_colour foreground background

TADS 2

HTML-TADS:

"<body bgcolor='background'><font color='foreground'>";

See also


set-cursor-position-statement

ALAN 2 and TADS 2

Not supported.

Hugo

locate ( row , column )

TADS 3

TODO. TADS 3 has "TextGrid banners", I'm told.

See also


setup

See

See also


sound

ALAN 2

Not supported.

See also


statements

ALAN 2

ALAN statements end in periods.

Hugo

Hugo statements have no explicit terminator character; the end of the line marks the end of a statement.

Use \ at the end of a line to split a statement onto two or more lines; the backslash is optional in long string constants broken over multiple lines.

Use : to put two or more statements onto the same line.

Inform 6, TADS 2, and TADS 3

Inform 6 and TADS statements end in semi-colons.

Inform 7

Inform 7's punctation tries to mimic English's as much as possible. Statements generally end in periods or are delimited by semicolons within compound statements.

However, it is also valid to end a statement with a string that either itself ends in a period, question mark, or exclamation mark, or ends in single-quote mark preceeded by a period, question mark, or exclamation mark.

See


statement block

ALAN 2

statement*

Hugo

{ statement [NL statement]* }

Inform 6, TADS 2, and TADS 3

{ statement+ }

See also


storyfile template

ALAN 2

[OPTIONS option+]? unit+ start

See also


strings

ALAN 2, Hugo, Inform 6, Inform 7

"This is a string constant."

TADS 2 and TADS 3

'This is a string constant.'

Note that a doublequoted string in TADS is not a string constant; it is a directive to print the string.

See also


string concatenation

This operator, if available, joins two strings of text together into one string.

Inform 6

Not applicable.

TADS 2 and TADS 3

Note that TADS overloads the plus sign for this, which normally does addition between two numbers.

x + y   // where x must be a string.

See also


subtraction

Subtraction of two numeric values is done with an operator, usually a hyphen.

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

x - y

Dialog

($A minus $B into $C)

A and B must be bound to numbers; C is unified with their difference. If the result is outside the valid range of numbers, the query fails.

Inform 7

ZIL

See also


superclass of

That is, how do we call (or access) the superclass's property (or method) from within the current object's property (or method)?

Hugo

class..property

Inform 6

class::property

TADS 2

I'm confused on this still. I've been told that pass prop; is equivalent to return inherited(args); where args are the parameters passed to the current method.

It might also be valid to either use inherited.property or inherited class.property as appropriate.

TADS 3

TODO. TADS 3 doesn't use TADS 2's pass statement.

See also


supporters

Also known as surfaces, supporters are objects that can have other objects on top of them. In most systems, an object cannot be both a container and a supporter at the same time, and the author should instead code two objects; for example, a trunk (the container) and its lid (the supporter) or a dresser (the supporter) and its drawer (the container).

Inform 6

Give it the supporter attribute. An object cannot be both a container and a supporter.

TADS 2

Declare it of class surface or qsurface. The latter is "quiet", and doesn't list its contents in certain circumstances. An object cannot be both a container and a surface.

TADS 3

Declare it of class Surface or one of its subclasses, such as Bed, Chair, or Platform. However, objects that are both a container and a surface ought to be declared of class ComplexContainer.

See also


surfaces

See supporters for things that have flat upper surfaces you can put other things on top of.

See walls for room surfaces, including floors and ceilings.


switch-statement

ALAN 2

DEPENDING ON lexpr case-clause* default-clause? END DEPENDING.

where   case-clause   →   rexpr : statement*

and   default-clause   →   ELSE : statement*

Hugo

select expr case-clause* default-clause?

where   case-clause   →   NL case const [, const]* NL statement

and   default-clause   →   NL case else NL statement

Note: Avoid an expr with side-effects; it is executed for every case in the select.

Inform 6

switch ( expr ) { case-clause* default-clause? }

where   case-clause   →   case const [, const]* : statement*

and   default-clause   →   default : statement*

TADS 2 and TADS 3

switch ( expr ) { case-clause* default-clause? }

where   case-clause   →   case const-expr : statement*

and   default-clause   →   default : statement*

See also


text alignment

ALAN 2

Left justified only. Manual spacing won't work because Alan compresses multiple spaces before displaying text. But use $t in a string to print a tab.

See also


text styles

ALAN 2

Not supported. Can't specify boldness or italics.

Dialog

Hugo

TADS 2 and TADS 3

ZIL

<HLIGHT integer>

where the integer is one of: 0 (no highlighting), 1 (inverse video), 2 (bold), 4 (underline/italic), 8 (monospaced). Global constants like H-INVERSE, H-BOLD, and H-ITALIC exist so you don't have to remember these numbers.

<ITALICIZE string>

See also


things

See objects.


total children of

Hugo and Inform 6

children(parentObj)

See also


transparency

Sometimes objects in a game need to be transparent so the player-character can look through them. How do you code that?

ALAN 2

Not specified. Considering the need to empty out the contents of opaque containers to a storage container when the former is closed, transparent containers may be simpler. (Unless the transparent container can go in a closeable opaque one, in which case it becomes difficult again.)

Inform 6

Give the object the transparent attribute.

TADS 2

Declare it of class transparentItem. Or, if you just wish to "look through" it, declare it of class seethruItem and define its thrudesc method as appropriate.

TADS 3

Transparency in TADS 3 is modeled on the more general notion of sense-passing, in this case, with respect to the sense of sight. For the simple case where you want to make a container transparent, you probably want to set the container's material property to glass, e.g.: displayCase.material = glass. Glass is predefined as transparent to sight, but opaque to sound, smell, and touch. (Other predefined materials are adventium (which is the default and opaque to all senses), paper, fineMesh, and coarseMesh. See sense.t.)

ZIL

Set the TRANSBIT flag of an object to make it transparent.

See also


truth values

See booleans.


unary negation

In many programming languages, unary negation looks much like subtraction but without specifying that we're subtracting from zero.

ALAN 2, Hugo, Inform 6, TADS 2, TADS 3

Note that in ALAN 2, unary negation is only supported in certain contexts, but I failed to determined what those contexts are.

-x

See also


Unicode

Inform 6

@{hhhh}

where hhhh is the hexadecimal code value.

TADS 2

Use \- followed by any two bytes to pass those bytes literally.

TADS 3

\uhhhh

where hhhh is the hexadecimal code value.

See also


variables embedded in strings

ALAN 2

Hugo

Not applicable.

Inform 6

TADS 2

TADS 3

See also


verb tense and voice

ALAN 2, Hugo, Inform 6, TADS 2

All standard libraries of all four languages assume 2nd person and present tense. Changing the default voice and verb tense is a similar job to changing the language: editing/replacing the library files. It is simpler in one respect, in that you only need worry about output, not input.

TADS 3

2nd person and present tense are still the defaults.

To change Voice:

Actor.pcReferralPerson = FirstPerson // or SecondPerson or ThirdPerson

To change Tense:  TODO.

See also


walls

We're discussing all room surfaces here: walls, floors, and ceilings. Sometimes a "floor" is really the ground, and a "ceiling" is really the sky.

ALAN 2

Not specified. See floating items for a way to handle them.

Inform 6

By default, walls are bundled with the eight compass directions; for example, the north direction and the north wall are treated as the same object. Likewise, the floor is the same as the down direction, and the ceiling is the same as up direction.

TADS 2

By default, locations don't have walls or a ceiling, but do have a floor/ground item: theFloor, which is implemented as a beditem floatingItem.

TADS 3

Implemented via the RoomPart class or its subclasses Floor or DefaultWall. By default, a Room comes equipped with defaultFloor, defaultCeiling, defaultNorthWall, defaultSouthWall, defaultEastWall, and defaultWestWall; an OutdoorRoom has only defaultGround and defaultSky; and a FloorlessRoom has none.

See also


wearable

See clothing.


while-statement

ALAN 2

Not applicable.

Hugo

while expr NL statement

Inform 6, TADS2, or TADS 3

while ( expr ) statement

See also


ZIL

ZIL stands for Zork Implementation Language. This was the programming language that Infocom invented and used to write its games.

External links:

See also