tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
185 stars 42 forks source link

bookmark vs. maxStates #56

Closed Purzelkater closed 4 years ago

Purzelkater commented 4 years ago

If have set Config.history.maxStates = 3 because I want the player can rewind 3 passages at most. Now some passages are tagged with "bookmark".

Sadly the tagged passages are only shown if they are on the maxStates range. If I set maxStates to 100 and go through my story, I can see the links on the bookmark dialog. But if I set maxStates to 3, I can see the last bookmark at most - because all other bookmarks are "older" than 3 passages, I think.

I would like to limit the redwind option to 3 (maxStates = 3) but also want to add particular passages to the bookmark dialog (irrespective of maxStates).

Would this be possible?

tmedwards commented 4 years ago

Unfortunately, no. The moments that are listed within the Jump To menu are those from the story history whose associated passages are tagged with bookmark. Meaning that only moments within the history can show up in the menu.

The Config.history.maxStates setting defines the maximum number of moments that are kept within the story history, rather than how many are accessible. Moments that exceed that limit are expired—i.e., deleted from the history completely. Only a record of their having existed at all is kept, so things like the visited family of functions continue to work.

You could do something sort of similar with saves, but that would require you to claim some of the slots from the player and there's no way to enforce that with the default dialog. You could write your own saves dialog that would allow you to do so, but attempting that isn't for the faint of heart.