Way to get Inform to read any player input as a turn?

Hey all–

My game has a lot of “After reading a command: if the player’s command includes ‘keyword’” in it. There probably was a more elegant way to do this, but this is the way I did it, and it’s a Petite Mort, so I don’t have a lot of time to change the structure, which is working like I want it to.

But I’d like to change things about the game’s state after a certain number of turns (I have a gamenumber that decrements with each turn so that if the player tries a certain action, it will only trigger after a certain amount of turns). Of course, the parser isn’t reading those “after reading a command” keywords the player inputs as turns. Is there an easy way to get the parser to understand anything the player types as a turn? Something that takes, very, very little time to implement?

Thanks!

1 Like

One or both of these should work:

increment the turn count;
increase the time of day by 1 minute.

You can do both by saying
follow the advance time rule

But neither of those will run ‘every turn’ rules, so you could also add:

follow the every turn rulebook.

So I guess the best combined approach might be:

follow the advance time rule;
follow the every turn ruleboook;
1 Like

I don’t recommend this in general, but for something like a Petite Mort:

Letting time pass is an action applying to nothing.
Understand "time passes" as letting time pass.

Now, instead of ending your rules with:

reject the player's command;

Instead:

change the text of the player's command to "time passes";

This will convert all of those rejected commands into an action that makes time pass, with no other effects.

4 Likes

A shortcut for this is “follow the turn sequence rules”, which has special code to not do any action processing unless it’s called from the top level.

2 Likes

This works like a charm and is super easy to implement. Ask and ye shall receive!

Thanks!

2 Likes