> For the complete documentation index, see [llms.txt](https://docs.niloom.ai/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.niloom.ai/documentation/content-creation-platform/advanced-creation-studio/decision-tree/decision-tree-logic.md).

# Decision Tree: Logic

In the context of a decision tree, logic helps to create different paths or outcomes that the story might follow depending on user interactions or predefined criteria.

Logic Nodes are specific points within a decision tree where these conditions are evaluated, and the story can branch into different directions based on the outcomes of the logic applied.

### **How to add Logic?**

There are 2 ways to add logic to the decision tree:

1. Within Decision tree page
   1. [Decision tree page ](/documentation/content-creation-platform/advanced-creation-studio/decision-tree.md)> [Top Middle Navigation](/documentation/content-creation-platform/advanced-creation-studio/decision-tree/decision-tree-navigation.md#top-middle-navigation) > + Logic&#x20;
   2. [Decision tree page](/documentation/content-creation-platform/advanced-creation-studio/decision-tree.md) > [Scene Thumbnail](/documentation/content-creation-platform/advanced-creation-studio/decision-tree/decision-tree-navigation.md#scene-thumbnail)  > Arrow Down Icon > Add > Add a Logic

There are two ways you can tell a story

* Linear stories provide a preset path for users.
* Interactive stories require logic. At least 2 logic paths (conditions) are required to make story interactive. Essentially, you are providing multiple choices for your users to make. To make a story interactive, you can
  * Add several new logic paths by clicking on '+' sign at the top left corner&#x20;
  * Duplicate the logic path by clicking on 'duplicate icon' in the top right corner of the logic path window.&#x20;

### **How to create new logic node?**

**Define Logic Type:** There are 3 types of logic

1. **Touch:** Assigned to user touch interaction&#x20;

* Specify Asset category&#x20;
* Specify Asset affected
* Interaction Type: Choose how the user will interact&#x20;
  * Swipe
  * Tap
* Interaction Decision&#x20;
  * Swipe (Up, Right, Left, Down)&#x20;
  * Tap (Tap, Double Tap, Triple Tap, Hold)
* Path
  * New Duplicated Scene > brings you to to duplicated where the activity starts from the beginning of the scene. To be able to continue from where the prior scene ended - select follow up scene.&#x20;
  * New Empty Scene > brings you to an empty scene
  * New Follow Up Scene > enables you to sequentially follow up one scene with another. Where your new scene begins at the point where prior scene ended.
  * Existing Scene > brings you back to the selected scene
  * Hyperlink > insert the link to external source. (Note: make sure the link format is fully copied and includes https\:// )
    * Provide the link in the box

2. **Probability:** Assign probabilities to different outcomes.

* Define Number of conditions and potential outcome per condition number
* Percentage&#x20;
* Path&#x20;
  * New Duplicated Scene
  * New Empty Scene
  * New Follow Up Scene
  * Existing Scene # > Brings you back to the selected scene

3. **Verbal:** Set conditions based on verbal inputs or other conditions.

Define Number of conditions and potential outcome per condition number

* Condition - verbal:
  * Yes
  * No
  * True
  * False&#x20;
  * Right
  * Wrong
* Path&#x20;
  * New Duplicated Scene
  * New Empty Scene
  * New Follow Up Scene
  * Existing Scene # > Brings you back to the selected scene

**Click \`Save\`** to apply the logic settings. Upon clicking \`Save\`, the logic is applied, and new scenes are created based on the defined conditions.
