Interruptions

Introduction

Setup

FAQs

How can I choose the node to go back to after the interruption is over?

How can I reset the status of interruptions to “not triggered”?

Will the script of the node that triggers the interruption execute?

Introduction

This system allows to include “interruptions” during the normal flow of conversation without manually adding them in every place they might be triggered. A good example of this is a phone that might ring at any point during the conversation: normally one would need to include a condition in every node to check whether the phone would ring. By using this system, a separate conversation can be created that includes the phone ringing and its effects (perhaps some alternate dialogue, or a choice), and simply mark the nodes where that could happen with the canTriggerInterruption checkmark.

Setup

The interruption system works by setting configuring the interruption options of a conversation, and then marking specific dialog nodes to have them able to interrupt a conversation.

The options require adding a Custom Asset Field (CAF). Instructions on adding CAFs can be found here: https://learnbrite.com/academy/chatmapper-cookbook/#h.t7z1efh0e51e

  • Set on: Conversations
  • Title: interruptionParameters
  • Type: Text
  • Default value: leave empty

The supported parameters are:

  • goTo: which conversation(s), by ID, should be used as interruptions? These are always included between square brackets (see examples below).
  • probability: what is the probability of a node marked as canTriggerInterruptions to actually trigger that interruption? This can go from 0 to 1 (representing 0% to 100%)
  • canRepeat: if an interruption was already triggered, can it trigger again? This can be either true or false.

Here are a couple of examples for what you would include in the interruptionParameters field of a conversation:

Use conversations 1 and 2 as interruptions, and make sure they always trigger.

{"goTo": [1,2], "probability": 0.3, "canRepeat": true}

Only use conversation 4 as an interruption, and only once.

{"goTo": [4], "probability": 0.79, "canRepeat": false}

Note: goTo, probability, and canRepeat should always be wrapped in quotation marks


After the conversation is set up, another CAF is used to mark each Dialog Node.

  • Set on: Dialogue Nodes
  • Title: canTriggerInterruptions
  • Type: Boolean
  • Default value: False

Then, the checkmark should be checked for every node that might trigger an interruption.

Note: if an interruption is triggered, the script of that node will not be executed.

FAQs

How can I choose the node to go back to after the interruption is over?

This can be achieved by adding a node before the interruption-triggering node, and saving the ID of the intended “return” node to a variable. For instance,

Variable["NodeAfterInterruption"] = 85;

And in the last node of the interruption conversation, an action can be triggered to go to the specific node saved in the variable:

LB.Actions.playConversationId({
   
cnvid: 3,
   nid: Variable[
"NodeAfterInterruption"],
   delay:
0.1
});

How can I reset the status of interruptions to “not triggered”?

Depending on your setup, you might want interruptions not to trigger more than once, but also require clearing which ones were already triggered (perhaps because you are starting a conversation from the beginning). This can be done by calling the following script:

LB.cmPlayer.ds.clearTriggeredInterruptions();

Will the script of the node that triggers the interruption execute?

No, the interruption will exit the current conversation before the script is executed.

© 2020 LearnBrite – Commercial In Confidence

Trademarks & Copyrights are property of their respective owners. Pictures are indicative only & may not reflect final production.

How useful was this article?

Click on a star to rate it!

We are sorry that this article was not useful for you!

Let us improve this article!

Tell us how we can improve this article?