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
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.
Solution
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.
The story id saved in the database could be used. It's a UUID auto-generated when a story gets uploaded to a server. It is unique and never changes. The admin interface would have to provide access to it. However, it's also quite cryptic, it doesn't convey to a reader what story is being identified. And it's not available until after the story has been created in the server, so the story author can't know it beforehand.
The title of the story is much more readable. But it can also be changed after the fact, making its use for identification purposes from within the story content quite fragile.
A user-defined id could be added. This could maybe be set via a metadata tag or in the admin interface when creating the story. The admin code would ensure it is unique in the server. It would not be changable afterwards.
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.
The text was updated successfully, but these errors were encountered:
Depends on #2.
Motivation
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.
Solution
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.
The text was updated successfully, but these errors were encountered: