Skip to content

Enable script calls from texboxes #4

Description

@audinowho

This issue is made to encapsulate the proposed feature of allowing textboxes to call script functions. This way, cutscene events can happen in the middle of a textbox. It is planned to work like such:

The developer will call a TextDialogue function from script, this time with a table of Lua function pointers in addition to the Text parameter. The dialogue text will contain [script=<script number>] tags to denote at which point in the text the script should fire. Example:

local callbacks = { foxFunction, jumpFunction, lazyFunction }
TextDialogue("The quick brown fox [script=0] jumped [script=1] over the lazy [script=2] dog.", callbacks, waitTime)

Current work has already added support for the [script] tag (found in Text.cs) and stubbed out a function in ScriptUI.cs.
Additionally, the script tags in DialogueBox.cs are properly read and stored.

Remaining work to be done/figured out:

  • The table of lua function calls must be passed into the dialoguebox and stored there.
  • When the script tag is hit, must call the lua function as a coroutine and WAIT for it to complete. This can be done by setting MenuManager.Instance.NextAction.

The TODOs on ScriptUI.cs and DialogueBox.cs denote the places where this is expected to be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions