You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Example
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.
Triggering unlocks
Via a tag in the story: # unlock: unlock id, text for user
When reached in the story, it posts an embed with the title "Unlocked!", an icon of an open lock and the text the author defined in the embed description (can be left empty).
Also stores the unlock id for the tuple (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).
Allowed characters, length etc. of unlock ids to be defined.
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?
Checking for unlocks
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).
The text was updated successfully, but these errors were encountered:
Basics
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.
Example
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.
Triggering unlocks
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?
Checking for unlocks
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).
The text was updated successfully, but these errors were encountered: