Converse is a Lua module designed to create interactive conversation interfaces between people with branching-choice support.
Installation
Lua installation
CSS installation
Usage
To create a conversation, use the Converse template with stepped parameters (for example., step1, step2, step10).
It is recommended that steps are numbered with big increments, such as 10, to allow for easy insertion of new lines later.
General Parameters
header: Text displayed at the top of the container.footer: Text displayed at the bottom of the container.
Step Parameters
Each step requires a type and text. Replace N with the step number.
stepN-type: The type of content. This can be set to:npc: A character speaking (left side).player: The user speaking (right side).action: Descriptive text (centered and italicized).option: An interactive button for the user to make a choice.empty: An empty gap that is mostly used as a visual spacer.
stepN-text: The main dialogue content or the text of the option button.
Character Parameters
Used when type is set to npc.
stepN-name: The name of the speaker displayed above the bubble.stepN-img: The file name for the character's portrait (for example,Example.png).
Option Parameters
Used when type is set to option to define the immediate result of the choice.
stepN-result-text: The text displayed as the immediate response to this choice.stepN-result-type: The style of the response. Defaults toplayer(can also benpc,action,empty, orraw).raw: Outputs without any styling at all. Is not available instepN-typeand may be removed in the future.
stepN-result-name: (If result-type isnpc) The name of the character.stepN-result-img: (If result-type isnpc) The portrait of the character.stepN-continue: Controls the flow. Set tonoorfalseto stop the conversation after this choice is made. Set to a branch label (e.g.yes,no-feedback) to fork into a separate path.stepN-branch: Marks a step as belonging to a named branch. Steps with this parameter are only shown when the matching branch is triggered bystepN-continue. Branch labels must be plain slugs with no spaces or special characters.
Example(s)
The Airlock Dilemma
[SCENE START] The airlock door malfunctions. Oxygen levels are critical, and there is an android with you.
Android UnitBeep boop, there is a problem! Your probability of survival is 12%. I calculate that ejecting the cargo will increase survival to 84%.
"Eject the cargo immediately!"
[BAD ENDING] The cargo was ejected. Unfortunately, the life-support systems were in that cargo. You suffocated, lmao.
"I'll cut the red wire."
[BAD ENDING] Sparks fly. The door seals permanently, you are trapped...
I feel blue today.
Okay, let me cut the blue wire.
{{Converse
| header = The Airlock Dilemma
| footer = Situation End
| step10-type = action
| step10-text = [SCENE START] The airlock door malfunctions. Oxygen levels are critical, and there is an android with you.
| step20-type = npc
| step20-name = Android Unit
| step20-img = Example.jpg
| step20-text = Beep boop, there is a problem! Your probability of survival is 12%. I calculate that ejecting the cargo will increase survival to 84%.
| step30-type = option
| step30-text = "Eject the cargo immediately!"
| step30-result-type = action
| step30-result-text = [BAD ENDING] The cargo was ejected. Unfortunately, the life-support systems were in that cargo. You suffocated, lmao.
| step30-continue = no
| step40-type = option
| step40-text = "How about no? Find another way."
| step40-result-type = npc
| step40-result-name = Android Unit
| step40-result-img = Example.jpg
| step40-result-text = Understood. Attempting to bypass the safety protocols... Beep beep, error! Manual assistance required.
| step50-type = npc
| step50-name = Android Unit
| step50-img = Example.jpg
| step50-text = You must sever the red wire or the blue wire to override the lock.
| step60-type = option
| step60-text = "I'll cut the red wire."
| step60-result-type = action
| step60-result-text = [BAD ENDING] Sparks fly. The door seals permanently, you are trapped...
| step60-continue = no
| step70-type = option
| step70-text = I feel blue today.
| step70-result-type = player
| step70-result-text = Okay, let me cut the blue wire.
| step80-type = action
| step80-text = The airlock hisses and opens successfully.
| step90-type = npc
| step90-name = Android Unit
| step90-img = Example.jpg
| step90-text = Success! Oxygen levels are stabilizing. We have survived without losing the cargo.
| step100-type = option
| step100-text = "Good job, robot."
| step100-result-type = npc
| step100-result-name = Android Unit
| step100-result-img = Example.jpg
| step100-result-text = Thank you, Captain.
| step110-type = option
| step110-text = "That was too close. I'm scrapping you."
| step110-result-type = action
| step110-result-text = The Android Unit stares at you in silence as you begin smirking.
| step120-type = action
| step120-text = The end.
}}
Text above can be found here (edit)
