Skip to content

Commit 76ddeb5

Browse files
committed
✨ Feat: Creates a single botscripten engine showing features
This updates botscripten to be a single file. No more viewer/reader integration. Just a single Botscripten. The chat interface was polished as well to make it different from Trialogue, but also feel familiar. BREAKING CHANGE: Users should uninstall BotscriptenViewer and just use the new Botscripten by itself
1 parent 8f25122 commit 76ddeb5

File tree

13 files changed

+253
-366
lines changed

13 files changed

+253
-366
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ Botscripten is also available as an npm parser, able to handle Passage-specific
2323

2424
If "yes", then Botscripten is worth looking into.
2525

26-
🔮 [Example Using BotscriptenViewer](http://htmlpreview.github.io/?https://github.com/aibexhq/botscripten/blob/master/examples/onboarding.html) <br>
27-
📦 [Example Using Botscripten](http://htmlpreview.github.io/?https://github.com/aibexhq/botscripten/blob/master/examples/onboarding.min.html)
26+
🔮 [A Sample Conversation](http://htmlpreview.github.io/?https://github.com/aibexhq/botscripten/blob/master/examples/sample.html)
2827

29-
Botscripten comes with two distinct flavors: **An Interactive Output** (BotscriptenViewer) for testing and stepping through conversations in a pseudo chat interface based on the Trialogue code, and **A Minimal Output** (Botscripten) for using your Twine output files in other systems. When developing a rich chatbot conversation, you'll use BotscriptenViewer. When you're ready to publish, you'll select the Botscripten format and shed all of the HTML/CSS/JavaScript required for the interactive version.
28+
Botscripten comes with two distinct flavors: **An Interactive Output** for testing and stepping through conversations in a pseudo chat interface based on the Trialogue code, and built in proofing version. External JavaScript keeps the output file small, making it easy to use the pure HTML in other systems.
3029

3130
- [Botscripten](#botscripten)
32-
- [🚀 Setup and Your First &quot;Chat&quot;](#-setup-and-your-first-quotchatquot)
31+
- [🚀 Setup and Your First "Chat"](#-setup-and-your-first-chat)
3332
- [Add Botscripten and BotscriptenViewer as a Twine Story Formats](#add-botscripten-and-botscriptenviewer-as-a-twine-story-formats)
3433
- [Create your first chat story](#create-your-first-chat-story)
3534
- [🏷 Botscripten Tags](#-botscripten-tags)
3635
- [🙈 Comments in Botscripten](#-comments-in-botscripten)
3736
- [🗂 Recipies](#-recipies)
38-
- [&quot;Special&quot; Comments (Directives)](#quotspecialquot-comments-directives)
37+
- ["Special" Comments (Directives)](#special-comments-directives)
3938
- [Conditional Branching (cycles, etc)](#conditional-branching-cycles-etc)
4039
- [Scripting Directives in BotscriptenViewer](#scripting-directives-in-botscriptenviewer)
4140
- [📖 Node Module Documentation](#-node-module-documentation)
@@ -56,7 +55,9 @@ Botscripten comes with two distinct flavors: **An Interactive Output** (Botscrip
5655
3. Paste `https://cdn.jsdelivr.net/gh/aibexhq/[email protected]/dist/Twine2/Botscripten/format.js`
5756
4. Click `Add`
5857

59-
Once you've done this, you will have access to the Botscripten story formats in Twine. If you're migrating, be sure to check the [Changelog](CHANGELOG.md) for a migration guide, as migrating to 0.5.0 from an earlier version can introduce breaking changes.
58+
Once you've done this, you will have access to the Botscripten story format in Twine. If you're migrating, be sure to check the [Changelog](CHANGELOG.md) for a migration guide, as migrating to 0.5.0 from an earlier version can introduce breaking changes.
59+
60+
Upgrading is as simple as removing your old Botscripten and adding the new URL above. You can then convert any existing story to the new format.
6061

6162
## Create your first chat story
6263

@@ -237,7 +238,7 @@ story = {
237238
First off, every Twine format I've worked with is amazing and super thougtful. If your goal is to create interactive fiction, self-contained tutorials, etc, you should just use Trialogue, Harlowe, or Sugarcube. However, if you're using Twine as a conversation editor (and you are more interested in the `tw-passagedata` blocks and the data structure behind Twine) Botscripten may be for you.
238239

239240
- **Zero `story.*` Calls** To be as portable as possible, No template tags may be used. That means your code cannot contain the `<% ... %>` blocks seen in Trialogue/Paloma. These tags are incredibly difficult to parse/lex, because they assume a JavaScript environmemt at runtime. And since you don't know where your Twine file is going to run, you must decouple the programming from the data.
240-
- **Tags drive behavior** Because of that first restriction, we need a way to perform actions within Botscripten. Thankfully, Twine's Tag system is up to the task.
241+
- **Tags drive behavior** Because of that first restriction, we need a way to perform actions within Botscripten. Thankfully, Twine's Tag system is up to the task. **We strive to keep the tag count low to minimize the number of reserved tags in the system.**
241242
- **Dev Experience** Iterating on Twine templates is hard. A lot of time was spent to make the dev experience as simple as (1) put [tweego](https://www.motoslave.net/tweego/) in your executable path, and (2) type `yarn dev`.
242243
- **Multiple Formats** Botscripten provides two syncrhonized formats from the same repository. Features in the proofing / html5-min version will also show up simultaneously in the Interactive one.
243244

@@ -254,9 +255,9 @@ First off, every Twine format I've worked with is amazing and super thougtful. I
254255
- TEST_Botscripten can be installed in Twine from `http://localhost:3001/Botscripten`
255256
- When you are done developing/testing, be sure to remove the TEST_Botscripten format. If you forget, just restart the dev server so Twine doesn't complain every time you start it up
256257

257-
For local testing convienence, a `stories` directory exists that is easy to call via `yarn tweego`. The `tweego` command ensures that Botscripten is available in your tweego story format path.
258+
For local testing convienence, we have a `yarn tweego` command. It ensures that Botscripten is in the `tweego` path before performing a build.
258259

259-
As an example, the onboarding document was converted from Twine to Twee using the command `yarn tweego -d ./stories/onboarding.html -o ./examples/onboarding.twee`
260+
As an example, the sample document was converted from Twine to Twee using the command `yarn tweego -d ./stories/sample.html -o ./examples/sample.twee`. (You may need to manually edit the html file to set the format to "Botscripten")
260261

261262
## Building for Release
262263

dist/Twine2/Botscripten/format.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/botscripten.umd.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<h1>Botscripten Test Scripts</h1>
55
<ul>
66
<li>
7-
<a href="onboarding.html">A sample chat bot onboarding conversation</a>
8-
(<a href="onboarding.min.html">min version</a>) (<a
9-
href="onboarding.twee"
10-
>onboarding.twee</a
7+
<a href="sample.html">A sample chat conversation</a>
8+
(<a
9+
href="sample.twee"
10+
>view the sample.twee</a
1111
>)
1212
</li>
1313
</ul>

0 commit comments

Comments
 (0)