How to cause an event to occur on every turn, but only when the action succeeds?

0 votes
79 views
asked Sep 17 in Authoring by anonymous

Suppose you have something like:

Every turn when monster is chasing, say "He's coming!"

Out-of-game actions don't trigger this as they aren't considered turns, nor do parser errors like trying to kiss something not animate. But checking inventory does, as well as other actions that have no real "result". How do you specify whether an action should result in a turn or not?

I'm thinking specifically in cases like:

Instead of cutting apple with something dull, say "Not sharp enough."

I wouldn't want that to take a turn because the player didn't really do anything; they were preempted by the game from taking any real action.

Also, how do I prevent taking inventory from counting as a turn? I want to treat it as a report that refreshed your memory, not an "action" that would actually require time to go by, which is seemingly how Inform views a turn.

1 Answer

0 votes
answered Sep 17 by bg (692 points)
edited Sep 17 by bg

Sorry, I keep fiddling with this to try to get it to work right. But hopefully it gives you some ideas.

If you just want to be able to control when the message appears, you could adjust the message conditions rather than changing whether an action takes a turn. You could try something like this:

Include After Not Doing Something by Ron Newcomb.

Did-something is a truth state that varies.
Did-something is usually true.

After not doing something:
    now did-something is false;
    continue the action.

After taking inventory:
    now did-something is false;
    continue the action.

Every turn:
    if the monster is chasing and did-something is true:
        say "The monster is coming.";
    now did-something is true.

You'd probably have to tweak this to get it to do exactly what you want.

But if you want to actually prevent an in-world action from taking a turn, check out Joseph Geipel's answer to this question:

http://ifanswers.com/378/how-to-make-commands-timeless?show=378#q378

Maybe there's a more direct way to do what you want. If so, hopefully someone else will chime in.

This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...