Trialogue is a chat-style Twine Story Format based on Paloma, which is in turn based on Snowman.
👉 Demo story: https://phivk.github.io/trialogue/docs/trialogue-demo.html
✊ Full story powered by Trialogue: https://fillafulla.sng.sk/chat/en/
🤖 Full story repo: https://github.com/slovakNationalGallery/fillafulla.sng.sk
Formats
-> Add a New Format
, paste the Story Format URL (https://phivk.github.io/trialogue/dist/Twine2/Trialogue/format.js) into the input field, click Add
.Story Formats
select Trialogue.[[What's your name?]]
)speaker-bot
). This will display the speaker’s name (in this case bot
) in above their passages. It also sets a data-speaker="bot"
attribute on the passage’s HTML element, which can be used for styling.[[Back to start->start]]
)speaker-bot
)Play
to test the result (should look something like this)The way to edit styling is by choosing ‘Edit Story Stylesheet’ in the story menu:
To learn more about editing styles via the Story Stylesheet, see:
Trialogue uses CSS variables to set the main colours of the app. You can add the following to your Story Stylesheet and tweak the colours to fit your needs:
:root {
--bg-color: #C7BDB5;
--user-color: purple;
--speaker-color: #A00;
--sidebar-bg-color: #FFF;
--navbar-bg-color: #FFF;
--passage-bg-color: #FFF;
--passage-text-color: #000;
}
Setting avatar image and text color of a bot speaker with the name bot
(passages tagged speaker-bot
):
.chat-passage-wrapper[data-speaker='bot']:before {
background-image: url('https://placekitten.com/100/100');
}
.chat-passage-wrapper[data-speaker='bot'] .chat-passage::before {
color: green;
}
Setting the avatar image and text color of user passages:
.chat-passage-wrapper[data-speaker='you']:after {
background-image: url('https://placekitten.com/100/100');
}
.chat-passage-wrapper[data-speaker='you'] .chat-passage::before {
color: red;
}
Use any valid CSS color value for the color property.
story.showDelayed(idOrName);
. This is helpful to display a next passage without requiring user input, e.g. have two bot speakers reply to each other. Add this code to the passage text:<%
story.showDelayed("idOrName");
%>
Example stories using Trialogue (add yours by submitting a Pull Request, or open an issue with a link):
A possible workflow for collaboration between a Story Author and Format Developer:
.html
file and shares it with Format Developer (infrequently).html
to .twee
using TweeGo/Twee2 (see ‘Testing during development’).twee
to .html
with WIP/’in development’ version of custom Story Format (see ‘Testing during development’)Run npm install
to install dependencies. Run grunt package
to create a release version for Twine under dist/
. Run grunt --help
to list other grunt targets.
A way to test the result of adjustments to the Story Format, is to compile a .twee
Story to .html
using the Trialogue format and check the behaviour & styling in a browser.
(De)compilation can be done using either:
Decompile .html
story to .twee
/.tw2
using Trialogue Story Format:
tweego --decompile --output=[path/to/target.twee] [path/to/source.html] --format=Trialogue
twee2 decompile [path/to/source.html] [path/to/target.tw2]
Compile .twee
/.tw2
story to .html
story using Trialogue Story Format:
tweego --output=[path/to/target.html] [path/to/source.twee] --format=Trialogue
twee2 build [path/to/source.tw2] [path/to/target.html] --format=./dist/Twine2/Trialogue
Trialogue is based on Paloma by M. C. DeMarco: a Jonah-style Story Format for Twine 1 and 2 based on Snowman by Chris Klimas.