shepard / bardbot Goto Github PK
View Code? Open in Web Editor NEWA Discord bot for supporting role-playing servers
License: MIT License
A Discord bot for supporting role-playing servers
License: MIT License
Unlocks are a way for story authors to set persistent boolean flags on a player from within the story as well as request the state of those flags. They are persistent in that they keep their state after a playthrough ended and can be accessed in another playthrough of the same user. That way they can be used for example to implement some "new game+" content.
Player reaches a certain part or end of the story. The story triggers an unlock with the id "good_end". The game engine shows the player a message "Unlocked! Good end".
The player finishes the story and starts again. At the beginning, the story checks if the "good_end" unlock has been achieved. Based on that, it grants the player some bonus items.
Via a tag in the story:
# unlock: unlock id, text for user
(user id, story id)
. An unlock id is scoped to the story it was triggered in (so you don't have to worry about id clashes with other story authors).Potentially, authors don't want users to know they unlocked something. Therefore, silent unlocks could also be a thing:
# silent-unlock: unlock id
or:
# unlock: unlock id, _silent_
Maybe leaving out the text parameter makes it silent while providing the ',' for it (or '-' as a text) will make it show the unlock but without text?
Via an external function:
hasUnlocked('unlock id')
Checks if the provided unlock id was triggered by this user in this story already (whether in this playthrough or another).
Depends on #2.
With the basic unlock system, unlock ids are scoped to a story and the state of an unlock id can be requested from within the story it belongs to via hasUnlocked('unlock id')
.
While this makes sure there are no unlock id clashes across stories, it would still be desirable if a story could check the state of an unlock id of another story. This way, a story author writing a sequel to a previous story of theirs can "import" some of the achievements of a player of the previous story and adjust its behaviour accordingly.
For this, the story author needs to be able to identify the story that they want to check an unlock id of, ideally via a string parameter to the external function hasUnlocked
.
Accessing the state of an unlock from another story would then be done via the external function call:
hasUnlocked('unlock id', 'story id')
A story author will not be able to change the state of an unlock from another story. Similar behaviour can probably be achieved by instead triggering an unlock in the current story and having the other story check its state.
Depends on #2.
When defining a story suggestion, the story admin will be able to enter an unlock id in a text field in the same dialog where they can enter the text for the suggestion. The unlock id will be shown on the detail administration view of the suggestion.
With this, the suggestion is now conditional. It will only be shown to the player at the end of a story playthrough if the unlock has been triggered for the player beforehand.
Additionally, when the player sees a list of stories via /story show
or /story start
, this will now also show stories which are linked as suggestions of stories for which the user has achieved the unlock id stored in the suggestion.
Potential external functions for providing information from the Discord environment to a story:
getServerName()
- Server name of the server this story belongs to, as configured in the server settings.getPlayerName()
- Display name of the user currently playing the story.getPlayerServerName()
- Display name of the user currently playing the story, as set in their server profile.getBotName()
- Display name of the bot user running the story.getBotServerName()
- Display name of the bot user running the story, as set in its server profile.When defining a character in a story, apart from the mandatory name, the author can set a colour and a URL for a profile picture / avatar.
The colour is currently used for the small strip on the side of the embed of the character speech. Finding a good picture for every character can be difficult. When no URL to a picture is set, the game will currently just not show a picture.
When no URL is set, auto-generate a picture based on the other data. The name can be used for initials. If a colour is defined, it can be used as a background colour.
Depends on #2.
With the basic unlock system, the player might be unfirmed that they achieved an unlock. With #3 an unlock can be used to suggest more (potentially secret) stories conditionally and using #4 an unlock in one story can influence the behaviour of another story.
However, the information that a player has achieved an unlock is not available to anyone outside of the playthrough.
Potential scenarious are:
/manages-stories show-unlocks <user>
.Feedback needs to be collected which of these scenarios are relevant to server admins.
Potential privacy concerns need to be considered.
Currently, the bot will print out all available content of a story up until the next choice as fast as possible, combining lines of text into single messages as much as possible (although there are some improvements to be made to combine character speech embeds). From time to time, Discord will slow it down, creating unnatural pauses in the message sending.
The two main way to influence this currently are the pause
tag, which shows ··· Bot is typing...
for three seconds before sending the next message, and the standalone
tag, which prevents a line from being combined with other lines into one message.
The desired effect of the pause
tag (a dramatic pause) is often not really achieved. It can be hard to tell it apart from a pause created by Discord slowing the bot down. And often, the user is still busy reading the previously sent content and doesn't really see the pause at the right time.
speed
tag.
speed: 0
- post without delay.speed: 1
- post with one second delay.speed: 10
- post with 10 seconds delay.speed
tag.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.