ink
ink copied to clipboard
[Question] Is it possible to "reset" a knot?
I'm working on a story that uses repeat scenarios. Is there a way to reset a knot so that the choices contained within can all be picked again? I could make all choices sticky, but I have some knots that contain their own loops where I want choices to only-once each time the knot is revisited.
Nope I'm afraid that's not possible right now, although there're have been a few instances where it's come up. Although it would be something to consider for future, it's not really on our list of priorities because it's not something we need ourselves on our current project.
When we did something similar on Sorcery games (like S2 where you can rewind time) we simply reset the entire story state, but migrated over a list of variables that we wanted to preserve.
If you wanted to be more selective, you'd probably have to rely on getting and setting variables directly rather than relying on read counts (and by extension, non sticky choices, sequences etc).
Thanks for the reply.
Further to what Joe said - Ink leans towards being declarative in style, so rather than allowing a reset of state, you'll have to find a way to specify exactly what behaviour you want.
A good approach here might be to make something using the TURNS_SINCE command; you can use that to compare the time since the knot being chosen was last chosen, and the time since the reset event occurred. You could wrap that up into a function so choices are like
- (a) {new_this_loop(->a)} Choice text
Which is not too bad as a pattern, and where you have
=== function new_this_loop(-> x) // only fail if we've seen both at all... { reset_loop && TURNS_SINCE(x) >= 0: // and we saw the choice more recently than the reset { TURNS_SINCE(x) < TURNS_SINCE(-> reset_loop): ~ return false } } ~ return true
Cheers Jon
On Thu, 15 Jun 2017 at 9:21 pm, Michael Highland [email protected] wrote:
I'm working on a story that uses repeat scenarios. Is there a way to reset a knot so that the choices contained within can all be picked again? I could make all choices sticky, but I have some knots that contain their own loops where I want choices to only-once each time the knot is revisited.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/inkle/ink/issues/329, or mute the thread https://github.com/notifications/unsubscribe-auth/AA40o9I0MHX3sPN8wFK9RPoGCGEZDo7-ks5sEZIugaJpZM4N7sem .
Nope I'm afraid that's not possible right now, although there're have been a few instances where it's come up. Although it would be something to consider for future, it's not really on our list of priorities because it's not something we need ourselves on our current project.
When we did something similar on Sorcery games (like S2 where you can rewind time) we simply reset the entire story state, but migrated over a list of variables that we wanted to preserve.
If you wanted to be more selective, you'd probably have to rely on getting and setting variables directly rather than relying on read counts (and by extension, non sticky choices, sequences etc).
Hey Joe! how did you do the above? Resetting the story state but keeping a list? This is exactly what I'm trying to do!