Dialogue

The Dialogue module provides a client-side NPC dialogue system with branching conversations.

Client Functions

Open

Opens a dialogue with an NPC or character.

Bridge.Dialogue.Open(name, dialogue, characterOptions, dialogueOptions, onSelected)
ParameterTypeDescription
namestringUnique dialogue name
dialoguetableArray of dialogue entries (see below)
characterOptionstableCharacter display options (optional)
dialogueOptionstableDialogue UI options (optional)
onSelectedfunctionCallback when player selects a response

Dialogue Entry Format

{
    {
        text = 'Hello, how can I help you?',
        responses = {
            { text = 'Tell me about the job', next = 2 },
            { text = 'Goodbye', action = 'close' }
        }
    },
    {
        text = 'The job pays well and has good hours.',
        responses = {
            { text = 'I am interested', action = 'accept' },
            { text = 'No thanks', action = 'close' }
        }
    }
}

Close

Closes an active dialogue.

Bridge.Dialogue.Close(name)
ParameterTypeDescription
namestringDialogue name to close