2025-02-21 13:37:09 -05:00
# Interactive Story Draft
2025-02-21 13:36:27 -05:00
- **File Format:** `.isd`
2025-02-21 17:16:02 -05:00
The Interactive Story Draft (ISD) format is a story format language designed for drafting interactive fiction before implementation in Twine’ s Harlowe or similar engines. It allows authors to structure branching narratives, define conditions, and track variables efficiently.
2025-02-21 13:36:27 -05:00
---
2025-02-21 17:16:02 -05:00
## Specifications
2025-02-21 13:36:27 -05:00
1. **Passages:**
- **Syntax:** `:: PassageName`
- **Description:** Defines a new passage or section in the story.
2. **Links:**
- **Syntax:** `[[Link Text -> TargetPassage]]`
- **Description:** Creates a navigational link to another passage.
3. **Variables:**
- **Syntax:** `$variableName`
- **Description:** Represents a variable to track states or information.
4. **Variable Assignment:**
- **Syntax:** `(set: $variableName to value)`
- **Description:** Assigns a value to a variable.
2025-02-21 15:39:48 -05:00
5. **Input Variable** :
- **Syntax:** `(input: $userVariable, "Placeholder")`
- **Description:** Allows the user to input data.
6. **Conditional Statements:**
2025-02-21 13:36:27 -05:00
- **Syntax:** `(if: condition)[Text if true]`
- **Description:** Displays text or content based on a condition.
2025-02-21 15:39:48 -05:00
7. **Else Clause:**
2025-02-21 13:36:27 -05:00
- **Syntax:** `(else:)[Text if false]`
- **Description:** Follows an `(if:)` statement to handle the false condition.
2025-02-21 15:39:48 -05:00
8. **Drop down:**
2025-02-21 13:42:25 -05:00
- **Syntax:** ``(dropdown: $variableName to "Option 1", "Option 2")` `
2025-02-21 13:51:14 -05:00
- **Description:** Assigns a drop down menu with the given strings as options.
2025-02-21 13:42:25 -05:00
2025-02-21 15:39:48 -05:00
9. **Random Number Generation:**
2025-02-21 13:36:27 -05:00
- **Syntax:** `(set: $variableName to (random: min, max))`
- **Description:** Sets a variable to a random number between `min` and `max` .
2025-02-21 15:39:48 -05:00
10. **Text Styling:**
- **Syntax:** `''italic''` , `'''bold'''` , `^^superscript^^` , `~~subscript~~`
- **Description:** Applies basic text formatting.
2025-02-21 13:36:27 -05:00
2025-02-21 17:16:02 -05:00
## Example
2025-02-21 13:36:27 -05:00
```
:: Introduction
Welcome to your adventure! You find yourself at a crossroads.
[[Take the left path -> LeftPath]]
[[Take the right path -> RightPath]]
:: LeftPath
You walk down the left path and encounter a mysterious stranger.
(set: $hasKey to true)
The stranger gives you a key.
[[Continue -> Crossroads]]
:: RightPath
You walk down the right path and find a locked door.
(if: $hasKey)[
You use the key to unlock the door and discover a treasure!
]
(else:)[
The door is locked. You need a key to open it.
]
[[Return to the crossroads -> Crossroads]]
:: Crossroads
You're back at the crossroads.
[[Take the left path -> LeftPath]]
[[Take the right path -> RightPath]]
```