Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic unlock system #2

Open
Shepard opened this issue Sep 9, 2023 · 0 comments
Open

Basic unlock system #2

Shepard opened this issue Sep 9, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@Shepard
Copy link
Owner

Shepard commented Sep 9, 2023

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

  • 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant