Dialog

Dialog is a domain-specific language for creating works of interactive fiction. It is heavily inspired by Inform 7 (Graham Nelson et al. 2006) and Prolog (Alain Colmerauer et al. 1972).

An optimizing compiler, dialogc, translates high-level Dialog code into Z-code, a platform-independent runtime format originally created by Infocom in 1979.

Manual

The Dialog Manual will tell you everything.

Download

The release archive includes:

  • Full source code for the Dialog compiler.
  • Pre-built executable files for Linux (i386 and x86_64) and Windows.
  • The latest version of the Dialog standard library, and the standard debugging extension.
  • A copy of the manual.

The compiler is distributed under a 2-clause BSD license.

IFID Generator

For reasons outlined in the Treaty of Babel, the Dialog compiler may bug you about declaring a story-specific IFID. To generate the required declaration, simply click the button below.

Notable works

This is what Cloak of Darkness looks like in Dialog.

My IFComp 2018 game Tethered is the first published Dialog game.

Posted Thursday 22-Nov-2018 22:18

Discuss this page

Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.

Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.

Anonymous
Tue 11-Dec-2018 18:44
if I have an object in a closed transparent container how do I override the default 'you can't reach obj' take fail message?

(instead of [take *]) doesn't seem to work in this case (scope?)
lft
Linus Åkesson
Wed 12-Dec-2018 10:35
if I have an object in a closed transparent container how do I override the default 'you can't reach obj' take fail message?

(instead of [take *]) doesn't seem to work in this case (scope?)

The "can't reach" message is printed by (refuse $), which is invoked before instead-of. So you can override refuse with a negated rule:

~(refuse [take *]) %% Don't refuse to take this object.
Anonymous
Thu 13-Dec-2018 12:55
Is it possible to suppress implicit actions temporarily.
For example
1.dropping something in a held container first tries to take the object before dropping.

2. putting something into something where the first something is in a held container tries to take before putting in

If I know that the take will always succeed can I suppress the first trying to take reporting.
lft
Linus Åkesson
Thu 13-Dec-2018 23:54
If I know that the take will always succeed can I suppress the first trying to take reporting.

Yes, there are several ways. You can override the before-predicate for that particular case, with a negative rule. For each particular action:

~(before [drop $X])
        ($X is #in $Y)
        ($Y is #heldby $Z)
        (current player $Z)

But many actions invoke a common predicate, '(ensure $ is held)', and you can add a new rule to that one instead:

(ensure $X is held)
        ($X is #in $Y)
        ($Y is #heldby $Z)
        (current player $Z)

When the given conditions are true, your rule will succeed, and this prevents the later rule definition in the library from executing.
Eleas
Björn Paulsen
Fri 14-Dec-2018 12:30
The Cloak of Darkness example seems bugged under 0.15. Attempting to go somewhere yields a crash:

fatal error: attempting to store to nonexistent local variable 3:
routine has 0 (pc = 0x2aba)
Eleas
Björn Paulsen
Fri 14-Dec-2018 12:34

Eleas wrote:

The Cloak of Darkness example seems bugged under 0.15. Attempting to go somewhere yields a crash:

fatal error: attempting to store to nonexistent local variable 3:
routine has 0 (pc = 0x2aba)

This is odd. I get the same error when running the first example in chapter 5. I'm running the win32 version of dialogc on Windows 10, in case that matters.
Eleas
Björn Paulsen
Fri 14-Dec-2018 12:44
I've now checked each release of the compiler, and found that moving between rooms only works under release 0b/01. Later than that leads to the fatal error described above.
Anonymous
Fri 14-Dec-2018 13:18

Eleas wrote:

I've now checked each release of the compiler, and found that moving between rooms only works under release 0b/01. Later than that leads to the fatal error described above.

Not sure if it's related but I only get the error when using Gargoyle. Frotz doesn't give the error. (latest versions Windows 10)
Eleas
Björn Paulsen
Fri 14-Dec-2018 13:54
Not sure if it's related but I only get the error when using Gargoyle. Frotz doesn't give the error. (latest versions Windows 10)

Thank you. Can verify. Does anyone know the best way to pass a bug report to one of the maintainers?
lft
Linus Åkesson
Fri 14-Dec-2018 14:47
This looks like a Dialog bug. Thanks for reporting; I'm on it!
lft
Linus Åkesson
Fri 14-Dec-2018 15:36
Fixed in 0c/04.
Anonymous
Tue 18-Dec-2018 13:05
Can I reference an object variable from within the scoring options?
(increase score by (#object variable))
lft
Linus Åkesson
Tue 18-Dec-2018 14:14
Can I reference an object variable from within the scoring options?
(increase score by (#object variable))

As a general rule, queries can't be nested; they don't even have return values.

(Confusingly, rule heads may contain nested expressions, but that is a special case of syntactic sugar.)

But output can be communicated using ordinary parameters. To take the output from one query, and use it as input in another, you would write the queries one after the other. Then you'd use a variable to carry the value.

Assuming you have a predicate ($ has score $) that assigns a score to every object:

        (#object has score $X) %% Here, $X becomes bound (i.e. to the output).
        (increase score by $X) %% Use the value of $X as input.