From 4ee17f7308c92cfc89a5b15b00eea98ae39b0184 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Fri, 21 Feb 2025 15:20:20 -0500 Subject: [PATCH] Added Interactive Story Draft --- Drafts/README.md | 90 +++++++++++++++++++++++++++++++++++++++++++++++ Drafts/sample.isd | 31 ++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 Drafts/README.md create mode 100644 Drafts/sample.isd diff --git a/Drafts/README.md b/Drafts/README.md new file mode 100644 index 0000000..839088d --- /dev/null +++ b/Drafts/README.md @@ -0,0 +1,90 @@ +# Interactive Story Draft + +- **File Format:** `.isd` + +The Interactive Story Draft (ISD) format is a intermediate 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. + +--- + +### Specifications + +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. + +5. **Conditional Statements:** + + - **Syntax:** `(if: condition)[Text if true]` + - **Description:** Displays text or content based on a condition. + +6. **Else Clause:** + + - **Syntax:** `(else:)[Text if false]` + - **Description:** Follows an `(if:)` statement to handle the false condition. + +7. **Drop down:** + + - **Syntax:** ``(dropdown: $variableName to "Option 1", "Option 2")`` + - **Description:** Assigns a drop down menu with the given strings as options. + +8. **Random Number Generation:** + + - **Syntax:** `(set: $variableName to (random: min, max))` + - **Description:** Sets a variable to a random number between `min` and `max`. + +9. **Text Styling:** + + - **Syntax:** `''italic''`, `'''bold'''`, `^^superscript^^`, `~~subscript~~` + - **Description:** Applies basic text formatting. + +### Usage + +``` +:: 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]] +``` diff --git a/Drafts/sample.isd b/Drafts/sample.isd new file mode 100644 index 0000000..a86a23d --- /dev/null +++ b/Drafts/sample.isd @@ -0,0 +1,31 @@ +:: 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]]