← Dialogue Documentation Home


Dialogue Overview

Dialogue is loaded using a stage file. Inside the stage file is the tree of actors which is defined by giving some combination of scripts to some number of actors.


./dialogue [OPTIONS] <STAGE-FILE>

Stage File

The <STAGE-FILE> is a Lua file where the company of actors is defined. The following are example stage files for the game pong and an HTML visualizer. Note that the scripts for these actors haven't been created and are just used as examples.

root = Actor({ {"Graphics"}, {"Game"} }, -1, 1)
root:child{ {"Player"}, {"Paddle", 500, 100}, {"Moveable", 10, 500, 100} }
root:child{ {"Opponent"}, {"Paddle", 50, 100}, {"Moveable", 10, 50, 100} }
root:child{ {"Ball", 300, 150}, {"Moveable", 300, 150} }
root = Actor({ {"html", "en"} })
head = root:child{ {"head", {"title", "Cool Page"}} }
body = root:child{ {"body"} }
body:child{ {"p", "This is a test paragraph!"} }

Worker Count

-w <number>

The number of workers to spawn. Default is 4.

Dialogue's number of workers is meant to match the number of cores on the machine in which it is ran. So, if Dialogue is ran on a machine with 8 cores, one should set the worker count flag as -w 8.

Worker Main


When this is set, the main thread becomes a worker and counts towards the worker count flag. If an actor is created with a worker_id equal to 1, that actor's actions will be handled in the main thread and will throw an error when actor:load, actor:send, and actor:probe are called synchronously from any other thread than the main thread.

Manual Load


Loading actors manually is required when this flag is set. Normally actors are created and immediately create and send a "load" action but this flag disables that functionality. Note that actors created with a worker_id may need to be loaded through the actor:async method which handles worker requirements automatically.

Non-interactive Script


Run the <STAGE-FILE> as a script, spawning no console. Dialogue exits when the script finishes. This unsets the worker main flag.

↑ top