Script blocks are powerful elements that bring interactivity to your stories. Unlike traditional storytelling where the text remains static, script blocks allow your story to respond dynamically to readers' choices and keep track of important information.
Here is an example of some script blocks, as shown in the Quickstart:
Script blocks can be seamlessly integrated into your story's text, just like you would add images or other media. They come in two main types:
Block Elements
Inline Elements
if
blocks shown in the next section.One of the most powerful features of script blocks is their ability to contain other content. Blocks like conditionals (if
blocks) and choices can hold:
This nesting capability allows you to create complex narratives with dynamic content that appears based on specific conditions or choices.
In the next section, we'll explore conditional blocks - your first step into making your story respond dynamically to readers' choices and actions. You'll learn how to show or hide content based on various conditions, opening up exciting possibilities for your interactive stories.