-
Notifications
You must be signed in to change notification settings - Fork 120
Description
Describe the bug
Fallback choices are supposed to be invisible to the player, taken automatically by Ink if no other choices remain. However, in InkJS, they can become visible if you save the story state to JSON while at a choice block with a fallback and then restore from the JSON. The now-visible fallback can even be selected and followed.
To Reproduce
I have a gist that demonstrates the issue using a looping failure block similar to the "find_help" example in Writing With Ink's section on fallback choices. (Excuse all the Apache 2.0 license stuff; my employer requires it.)
Essentially, if the story state is at a choice block with a fallback and you save the state with story.state.ToJson(), then if you later restore that state with story.state.LoadJson(), the fallback choice will become visible as a regular choice with no text.
Expected behavior
From Writing With Ink: "Fallback choices are never displayed to the player".
Ink files
See demo.ink in this gist, along with main.mjs.
Environment
- OS: Windows
- Node.js version: 16.10.0, but I've also seen this behavior in the browser
- Web browser version: Firefox 93, but I've also seen this behavior in Node.js
- inklecate version: 1.0.0
- inkjs version: 2.0.0