Getting Started Writing Adult Interactive Stories

Writing Literotica Interactive Sex Stories is easy.

Here’s an example of how to write a simple Interactive Story:


You want to go on a date!
-> ask_a_woman_out

=== ask_a_woman_out ===
Which woman do you want to ask out on a date?
+ The blonde woman.
-> blonde_woman
+ The brunette woman.
-> brunette_woman

=== blonde_woman ===
You live happily ever after with the blonde in New York.
-> END

=== brunette_woman ===
The brunette doesn't seem interested.
+ Try again.
-> ask_a_woman_out
+ Go home.
-> END


In the above Interactive Story, the reader wants to go on a date. They have a choice between asking out a blonde or a brunette. If they ask out the blonde, they get to live happily ever after in New York. If they ask out the brunette, they find out that she’s not interested and have the option to try again or go home. It’s that simple.

Other than plain text, there are four special elements that authors of Literotica Interactive Stories should understand.

  1. Knots (===) - a Knot is a block of text with a name/header. Knot names must use underscore characters instead of spaces (“this is the knot name” becomes this_is_the_knot_name). In addition to text, a Knot may contain Choices, Diverts, and END statements. If you think of non-interactive stories as being organized into paragraphs of text, you might think of Lit interactive stories being organized into Knots of text (and those Knots may contain paragraphs).
  2. Choices (+) - inside of a Knot, readers select from Choices to control the direction of the story.
  3. Diverts (->) - when a reader selects a Choice, we send them to another Knot using a Divert.
  4. END - the word “END” after a Divert tells the reader that the story is over. “END” is required at the end of any Knot where the story does not send the reader to another Knot.

Here’s a quick look at each element of the story we created above:

The story introduction (plain text):

You want to go on a date!
An introduction to your story. This can be the first paragraph(s) of text, an author introduction, the text before the first choice the reader will make, a prologue, etc.

The first Divert:

-> ask_a_woman_out
A Divert always starts with the dash followed by the greater than symbol (“->”). A Divert is easy to remember because it looks like an arrow pointing to the right. A Divert sends the reader to a specific Knot. The format is simple to remember because you create an arrow that points to the name of the Knot that you want the reader to go to. In this case, we created a Divert that sends the reader directly to the first Knot in the story “ask_a_woman_out”.

The first Knot:

=== ask_a_woman_out ===
Which woman do you want to ask out on a date?
+ The blonde woman.
-> blonde_woman
+ The brunette woman.
-> brunette_woman
A Knot always starts with three equal signs followed by a space and then the Knot name and three more equal signs (“=== ask_a_woman_out ===”). The Knot name is very important because it’s used to link to the Knot from other parts of the story. Every Knot in your story must have a unique name for this reason. On the line after the Knot name, you can write any text that you want in this part of the story - from one word to hundreds of paragraphs of text. After the plain text, you can add Choices for the reader to decide where the story narrative should go next. Each Choice (“+ The blonde woman.” and “+ The brunette woman.”) is placed on a new line that starts with a plus symbol (+). After the Choice, you use a Divert to send the reader to the Knot you want them to visit as a result of selecting that Choice (“-> blonde_woman”).

The blonde Knot:

=== blonde_woman ===
You live happily ever after with the blonde in New York.
-> END
If the reader selects the Choice “+ The blonde woman.” in the first Knot, they go to the Knot named in the Divert following the Choice “-> blonde_woman”. In this Knot, we tell the reader that they live happily ever after in New York. Then we end the story using the required END statement (“-> END”).

The brunette Knot:

=== brunette_woman ===
The brunette doesn't seem interested.
+ Try again.
-> ask_a_woman_out
+ Go home.
-> END
If the reader selects the Choice “+ The brunette woman.” in the first Knot, they go to the Knot named in the Divert following the Choice “-> brunette_woman”. In this Knot, we tell the reader that the brunette is not interested and give them two more Choices. They can choose to try again or give up. If they want to try again, we use a Divert (“-> ask_a_woman_out”) to send them back to the ask_a_woman_out Knot. If they want to give up, we use an END statement (“-> END”) to end the story.

Adding to the story:

You can add lots more Knots, Choices with Diverts, and paragraphs of text to make your story more fun for the reader, but the writing process will remain just as easy as shown above.

This is the simplest way to write a fully interactive adult story using only the core features of the Ink interactive story language. We recommend that you try writing a story using the core features first to get familiar with the concepts of interactive fiction writing.

Once you’ve mastered the basics, check our tutorials on Getting Started With Choices in Interactive Fiction, Simple Conditionals in Interactive Fiction, Using Variables in Interactive Fiction, How To Use Weaves and Gathers When Writing Interactive Stories, and “Adding Randomness To Interactive Stories” articles.

If you’d like to explore using more advanced features like conditionals (allow the reader to take certain actions only if other tasks have already been completed), variables (keep track of the story characters’ stats, inventory, etc.), and functions (complex story logic and reusable code), please read the full Ink Tutorial at GitHub.

If you’re interested in helping test and give feedback on the new Literotica Interactive Stories, either as an author or a reader, please read this thread in the Literotica Forum: Interactive Adult Story Testers Needed.