Can you force a turn without player input?

I’ve made some decent progress on this thing after figuring out Mike Callaghan’s Questions extension. However one thing is irking me slightly. After the first yes/no question “Do you open your eyes?”, nothing happens unless the player takes an action to look or wait or something, then it kicks into the next sequence; going through the character details just fine. After finalizing those it prints the say “You feel cold and disoriented as you try to get your bearings…” just fine, then it again does nothing until the player does a look or wait, then the description of the next room (the Chamber) appears. Is there any way to automate this a little better so it runs without empty key-presses on the player’s part?

[spoiler][code]Part 1 - The Player

Blackness is a room. It is private. The printed name of Blackness is " ".

A person can be conscious or unconscious.

The player is a person.

The player is unconscious.

When play begins:
say “You stir groggily. It feels like you’ve been asleep for an ungodly long time, and your whole body is stiff and sluggish.”;
now current question is “Do you open your eyes?”;
ask a closed question, in yes/no mode.

A yes/no question rule (this is the waking up rule):
if the player is unconscious and location is Blackness:
if the decision understood is yes:
say “You open your eyes.”;
now the player is conscious;
exit.

Data is a kind of value. The data are name, age, sex, height, ethnicity, eye color, hair color, finalise and complete.

Gathering is a scene. Gathering begins when the player is conscious.
Gathering ends when stage is complete.
Stage is data that varies.

When Gathering begins:
now stage is sex.

When Gathering ends:
say “You feel cold and disoriented as you try to get your bearings…”;
move the player to the Chamber.

Every turn during Gathering:
if stage is sex:
now current question is “Do you want to play as a male or female character?”;
ask a closed question, in gender mode;
if stage is age:
now current question is “How old are you?”;
ask a closed question, in number mode;
if stage is height:
now current question is “How tall are you in inches?”;
ask a closed question, in number mode;
if stage is ethnicity:
now current question is “What is your ethnicity:”;
now current question menu is { “Asian”, “Caucasian”, “African”, “Hispanic” };
ask a closed question, in menu mode;
if stage is eye color:
now current question is “What is your eye color:”;
now current question menu is { “brown”, “blue”, “green”, “black”, “grey”, “hazel” };
ask a closed question, in menu mode;
if stage is hair color:
now current question is “What is your hair color:”;
now current question menu is { “brown”, “black”, “red”, “blonde”, “platinum” };
ask a closed question, in menu mode;
if stage is name:
now current question is “What is your name?”;
now current prompt is “Enter your name >”;
now punctuation removal is false;
ask a closed question, in text mode;
if stage is finalise:
say “You have chosen:[line break]Name: [player’s name][line break]Age: [Player’s age][line break]Sex: [Player’s sex][line break]Height [Player’s height][line break]Ethnicity: [Player’s ethnicity][line break]Eye color: [Player’s eye color][line break]Hair Color: [Player’s hair color][line break]”;
now current question is “Are you happy with your responses?”;
ask a closed question, in yes/no mode.

The player’s sex is a gender that varies.
The player’s age is a number that varies.
The player’s height is a number that varies.
The player’s ethnicity is text that varies.
The player’s eye color is text that varies.
The player’s hair color is text that varies.
The player’s name is indexed text that varies.

A gender question rule (this is the gather gender rule):
if gathering is happening and stage is sex:
now the player’s sex is the gender understood;
say “You are [the player’s sex] gender[line break]”;
now stage is age;
exit.

A number question rule (this is the gather age rule):
if gathering is happening and stage is age:
if the number understood is less than 13:
say “It seems improbable that one of such tender years would be venturing so far.[line break]”;
retry;
if the number understood is greater than 50:
say “Let’s try to be realistic about this.”;
retry;
now the player’s age is the number understood;
say “Your starting age is [the player’s age]. [line break]”;
now stage is height;
exit.

A number question rule (this is the gather height rule):
if gathering is happening and stage is height:
if the number understood is less than 48:
say “Aren’t you a little short for a stormtrooper?[line break]”;
retry;
if the number understood is greater than 84:
say “Somebody get David, Goliath is here! Seriously though.”;
retry;
now the player’s height is the number understood;
say “You are now [the player’s height] inches tall.[line break]”;
now stage is ethnicity;
exit.

A menu question rule (this is the gather ethnicity rule):
if gathering is happening and stage is ethnicity:
let temp be the number understood;
now the player’s ethnicity is entry temp in the current question menu;
say “You are now [player’s ethnicity].[line break]”;
now stage is eye color;
exit.

A menu question rule (this is the gather eye color rule):
if gathering is happening and stage is eye color:
let temp be the number understood;
now the player’s eye color is entry temp in the current question menu;
say “Your eyes are [player’s eye color].[line break]”;
now stage is hair color;
exit.

A menu question rule (this is the gather hair color rule):
if gathering is happening and stage is hair color:
let temp be the number understood;
now the player’s hair color is entry temp in the current question menu;
say “Your hair is [player’s hair color].[line break]”;
now stage is name;
exit.

A text question rule (this is the gather name rule):
if gathering is happening and stage is name:
if the number of words in the current answer is greater than 1:
say “I think we will simply refer to you as [word number 1 in the current answer][line break]”;
now the player’s name is word number 1 in the current answer;
otherwise:
now the player’s name is the current answer;
say “Welcome to this venture, [player’s name].[line break]”;
now stage is finalise;
exit.

A yes/no question rule (this is the confirm answers rule):
if gathering is happening and stage is finalise:
if the decision understood is Yes:
say “The light hurts your eyes as you finally open them. [line break]”;
now stage is complete;
exit;
otherwise:
say “OK. Let’s start again, shall we[line break]”;
now stage is sex;
exit.
[/code][/spoiler]

You attached quite a wall of code, but it doesn’t compile. You forgot to say which extensions you’re using. (That’s the lines at the top of your source file that look like Use "Things" by Sue Dunham. You should also prune down your huge test case to something manageable. But, just thinking about it, I suspect the issue is that you’re using “every turn” rules and global variables when you should really just be asking the laundry list of questions to the player right there in the “When play begins” rule.[code]
When play begins:
say “You stir groggily. It feels like you’ve been asleep for an ungodly long time, and your whole body is stiff and sluggish.”;
now current question is “Do you open your eyes?”;
ask a closed question, in yes/no mode.

A yes/no question rule (this is the waking up rule):
if the player is unconscious and location is Blackness:
if the decision understood is yes:
say “You open your eyes.”;
now the player is conscious;
exit.
[/code]I don’t understand what you want to happen if the player answers “no” to this question. :stuck_out_tongue:

I just figured out a better solution last night actually. I was trying to reverse engineer one of the examples from the Questions extension, that relied on a scene to determine when the questioning began and ended. I got rid of the scene and tied it to the location, then moved the player at the confirmation of the last question.

I haven’t actually defined anything for answering ‘no’ to the ‘open your eyes?’ query yet. :smiley: I’ll get to that at some point here I imagine.

I don’t have a definite goal in mind at the moment, I have something of an idea of a game I want to work towards, but I’m largely playing around and learning what I can do at the moment. So far everything is doing about what I want. I wish I could figure out a way to make it use the terms male/female for the gender descriptions, but Inform just can’t conceive a way that those might both fall under a category of some sort so that I can use a [gender] or [sex] tag of some sort to easily reference. I don’t like how the gender function in Questions uses masculine, feminine, and neutral. It sounds (reads?) unnatural. Its a little annoying, I wish I had some way to modify the lexicon or something to expand their definitions or something. I suppose I could build an ‘if’ statement of some sort to perform word replacing shenanigans, but I haven’t gotten around to it yet.

This is what I’ve done so far.

I’m going to try to figure out some timing related things, and how to make it so that there’s a command of some sort that pulls up your “character sheet” in some way. I think I may try to modify the status command from Basic Characters, but I’m not sure yet. At some point I’m going to get around to defining attributes for characters as well. I’m going for something RPG/Survivalist eventually.

[spoiler][code]
Include Rooms And Objects by Narly_thotep. (some stuff for furniture)
include Liquid Handling by Al Golden.
include Food and Drink by Narly_Thotep. (general rules for the fruit and water)
include Basic Characters by Shadowchaser.
Include Questions by Michael Callaghan.

Part 0 - Misc

Use serial comma.

Part 1 - The Player

Blackness is a room. It is private. The printed name of Blackness is " ".

A person can be conscious or unconscious.
The player is a person.
The player is unconscious.

Rule for printing the banner text when the player is unconscious: do nothing.

When play begins:
say “You stir groggily. It feels like you’ve been asleep for an ungodly long time, and your whole body is stiff and sluggish. A faint glow seeps through your eyelids.”;
now current question is “Do you open your eyes?”;
ask a closed question, in yes/no mode.

A yes/no question rule (this is the waking up rule):
if the player is unconscious and location is Blackness:
if the decision understood is yes:
now the player is conscious;
say “You open your eyes. You feel cold and disoriented as you try to get your bearings. You realize after a moment that you are lying down on something firm but soft. A curved transparent glass pane reflects your image in the dim light, less than a foot away.”;
now stage is sex;
exit.

Data is a kind of value. The data are name, age, sex, height, ethnicity, eye color, hair color, finalise and complete.
Stage is data that varies.

Every turn while location is Blackness:
if stage is sex:
now current question is “Are you a man, or a woman?”;
ask a closed question, in gender mode;
if stage is age:
now current question is “About how old are you?”;
ask a closed question, in number mode;
if stage is height:
now current question is “How tall are you, in inches?”;
ask a closed question, in number mode;
if stage is ethnicity:
now current question is “What is your ethnicity:”;
now current question menu is { “Asian”, “Caucasian”, “African”, “Hispanic” };
ask a closed question, in menu mode;
if stage is eye color:
now current question is “What color are your eyes?”;
now current question menu is { “brown”, “blue”, “green”, “black”, “grey”, “hazel” };
ask a closed question, in menu mode;
if stage is hair color:
now current question is “What about your hair?”;
now current question menu is { “brown”, “black”, “red”, “blonde”, “platinum” };
ask a closed question, in menu mode;
if stage is name:
now current question is “What is your name?”;
now current prompt is “Enter your name >”;
now punctuation removal is false;
ask a closed question, in text mode;
if stage is finalise:
say “You have chosen:[line break]Name: [player’s name][line break]Age: [Player’s age][line break]Sex: [Player’s sex][line break]Height [Player’s height][line break]Ethnicity: [Player’s ethnicity][line break]Eye color: [Player’s eye color][line break]Hair Color: [Player’s hair color][line break]”;
now current question is “Are you happy with your responses?”;
ask a closed question, in yes/no mode.

The player’s sex is a gender that varies.
The player’s age is a number that varies.
The player’s height is a number that varies.
The player’s ethnicity is text that varies.
The player’s eye color is text that varies.
The player’s hair color is text that varies.
The player’s name is indexed text that varies.

A gender question rule (this is the gather gender rule):
if location is Blackness and stage is sex:
now the player’s sex is the gender understood;
say “You are [the player’s sex][line break]”;
now stage is age;
exit.

A number question rule (this is the gather age rule):
if location is Blackness and stage is age:
if the number understood is less than 13:
say “It seems improbable that one of such tender years would be venturing so far.[line break]”;
retry;
if the number understood is greater than 50:
say “Let’s try to be realistic about this.”;
retry;
now the player’s age is the number understood;
say “Your starting age is [the player’s age]. [line break]”;
now stage is height;
exit.

A number question rule (this is the gather height rule):
if location is Blackness and stage is height:
if the number understood is less than 48:
say “Aren’t you a little short for a stormtrooper?[line break]”;
retry;
if the number understood is greater than 84:
say “Somebody get David, Goliath is here! Seriously though.”;
retry;
now the player’s height is the number understood;
say “You are now [the player’s height] inches tall.[line break]”;
now stage is ethnicity;
exit.

A menu question rule (this is the gather ethnicity rule):
if location is Blackness and stage is ethnicity:
let temp be the number understood;
now the player’s ethnicity is entry temp in the current question menu;
say “You are now [player’s ethnicity].[line break]”;
now stage is eye color;
exit.

A menu question rule (this is the gather eye color rule):
if location is Blackness and stage is eye color:
let temp be the number understood;
now the player’s eye color is entry temp in the current question menu;
say “Your eyes are [player’s eye color].[line break]”;
now stage is hair color;
exit.

A menu question rule (this is the gather hair color rule):
if location is Blackness and stage is hair color:
let temp be the number understood;
now the player’s hair color is entry temp in the current question menu;
say “Your hair is [player’s hair color].[line break]”;
now stage is name;
exit.

A text question rule (this is the gather name rule):
if location is Blackness and stage is name:
if the number of words in the current answer is greater than 1:
say “I think we will simply refer to you as [word number 1 in the current answer][line break]”;
now the player’s name is word number 1 in the current answer;
otherwise:
now the player’s name is the current answer;
say “Welcome to this venture, [player’s name].[line break]”;
now stage is finalise;
exit.

A yes/no question rule (this is the confirm answers rule):
if location is Blackness and stage is finalise:
if the decision understood is Yes:
say “The light hurts your eyes as you finally open them. [paragraph break]”;
say “[banner text][paragraph break]”;
now stage is complete;
say “Your surroundings are unfamiliar, you certainly aren’t in your bedroom. You rub your eyes as you sit up and look around. The room is spartan, to say the least, a fact made more obvious by its size. You could easily fit your whole apartment in here. Its roughly circular, and the walls are a uniform off-white into grey color, with a darker floor and lighter ceiling. Actually, the entire ceiling seems to be a light source, so you aren’t sure if it’s lighter or not. You’re pretty sure it was that light that woke you up, and it seems to be getting gradually brighter. Also, the cold might have something to do with the fact that you’re naked. There’s no sign of you’re clothing around. The bed you were asleep on is a solid slab of somethign akin to memory foam, it wasn’t uncomortable at any rate. A small boxy table that looks to be a contiguous piece with the floor is within arm’s reach, and there’s a folded swath of some sort of silvery fabric laying on it, next to a [glass] and a [bowl].”;
move player to The Chamber;
exit;
otherwise:
say “OK. Let’s start again, shall we[line break]”;
now stage is sex;
exit.

Part 2 - Waking Up

The Chamber is a room. “A strange but somehow comfortable room, with a high arched ceiling that is giving off a pleasant light.” The Chamber is private. The printed name of the Chamber is “The Chamber”.

A basic bed called an unusual bed is in The Chamber. The description of the bed is “A dark grey slab of some sort of space-age foam. It’s far more comfortable than it looks.”

A basic table called a strange metal table is in The Chamber.
An open transparent container called a glass is on the table.
The glass contains water.
instead of drinking water:
remove the water from play;
say “It’s cool and refreshing.”

There is an open container called a silver bowl on the table.
	There is an apple in the bowl.
	There is an orange in the bowl.

Rule for printing the name of the glass:
if the glass contains something begin;
say “glass of [list of things in the glass]”;
otherwise;
say “empty glass”;
end if;
omit contents in listing.

After printing the name of the strange metal table while listing contents:
if the strange table supports something, say “, on which is [a list of things on the strange table]”;
omit contents in listing.

Rule for printing the name of the silver bowl while listing contents:
if the silver bowl contains more than one thing begin;
say “silver bowl of [a list of things in the bowl]”;
otherwise;
say “silver bowl[if the silver bowl contains one thing] with [a list of things in the bowl] in it[end if]”;
end if;
omit contents in listing.

Before listing contents: group fruits together as “fruit”.
Rule for grouping together fruits when not taking inventory: say “fruit”.[/code][/spoiler]

It should say, “Alright, stay unconscious, then!”

  • Wade