Continuous Action

In relation to a previous post of mine, I’m curious: Is there a way to make the player’s action continue until stopped by another action? If my player types “Knit hat”, is there a way to make every subsequent turn say “You keep knitting the hat.” until the player performs another action - maybe “stop knitting” or just something else like “go west” or “look at the painting”?

Conversely, is there a way to make another actor do the same?

Really, I only care about the end result of seeing the same action printed on screen. There is a simple way to do this with a backdrop, if the backdrop is in the presence of the player, you can make it say the same line over and over again, or different cycling lines. Can this be done with actors and the player too?

Fundamentally you’re talking about an “every turn” rule. It doesn’t have to be connected to a backdrop. Store the information about what the player is doing somewhere, and then write an “every turn” rule that prints an appropriate message as long as that value is set.

Could I trouble you for a simple example?

I’ve actually been working on something similar to this, for long-distance movement. Effectively, the player types “go to New York”, then the command prompt is hidden and the player continues moving toward New York as long as they keep tapping ENTER or SPACE. If they type any other character, the movement pauses and the command prompt appears. Typing “continue” resumes their journey.

If you want I can clean up the code and post it here, but it’ll take a while.

Here’s a quick example:

[spoiler][code]Twisting Passage is a room. “The road stretches ever onward.”

Currently moving is initially false.

Instead of going nowhere in Twisting Passage:
unless currently moving is true, say “You resume walking.”;
now currently moving is true.

Before doing something other than going or waiting or examining or taking inventory or stopping in Twisting Passage, now currently moving is false.

Every turn when currently moving is true and currently moving was true: [Don’t display this message the first round you start moving]
say “The path twists and turns as you make your way up the mountainside.”

Stopping is an action applying to nothing. Understand the command “stop” as something new. Understand “stop” as stopping.

Check stopping when currently moving is false: try waiting instead.

Carry out stopping: now currently moving is false.

Report stopping: say “You decide to stop here for a moment.”

Instead of waiting when currently moving is true: do nothing.[/code][/spoiler]

Thanks this is awesome!