[I7] Ending a Question Scene with a Variable?

Hello!

I’m currently playing around on a project and I decided I want to start my game/project with a question to the player, gathering a personality trait to begin the game with, before moving on to the main game/scene. I’ve got the question functioning but the scene won’t end, so the game won’t start. I thought it would be simple, using a variable to end the scene, but it’s just not working and it’s making me question that maybe I’ve done something wrong or gone about it the wrong way. Here’s how I’ve gone about it:

Playeranswered is a truth state that varies. Playeranswered is false. [Decides whether the player has decided on a trait or not.]

Trait is a kind of value. The traits are Charismatic, Loving, Frugal, and None.

A person has a trait. The trait of the player is none.

Debug is a room.

Rule for printing the name of debug:
	do nothing;
	stop the action.

Collecting is a scene. Collecting begins when play begins. Collecting ends when playeranswered is true.

When play begins:
	now the player is in debug;
	now the left hand status line is "Time: ???? ????, ????";
	say "[line break]Before the game begins, pick a trait to start with that best represents you and what you'd like to accomplish in (game name).[paragraph break]- Charismatic (trait explanation)[line break]- Loving (trait explanation)[line break]- Frugal (trait explanation)";
		now the command prompt is "Which are you? >";
		continue the action.
	
To decide whether collecting traits:
	if the command prompt is "Which are you? >", yes;
	no.

After reading a command when collecting traits:
	if the player's command includes "[trait]":
		now the trait of the player is the trait understood;
		if the trait of the player is none:
			say "[line break]Please choose a trait. [run paragraph on]";
			reject the player's command;
		if the trait of the player is Charismatic:
			say "[line break]Welcome to the world, silver-tongue. May you make many friends along your journey.";
			 now the player is charismatic;
			now playeranswered is true;
		if the trait of the player is Loving:
			say "[line break]Welcome to the world, compassionate soul. May you be met with warmth and love along your journey.";
			now the player is loving;
			now playeranswered is true;
		if the trait of the player is frugal:
			say "[line break]Welcome to the world, canny one. May you find the riches and pleasures that you seek.";
			now the player is frugal;
			now playeranswered is true;
		now the command prompt is ">";
		reject the player's command;
	otherwise:
		say "[line break]Please enter one of the given traits. [run paragraph on]";
		reject the player's command.

Nextscene [placeholder name] is a scene. Nextscene begins when collecting ends.

When nextscene begins:
	say "Game begins!";

So to recap, the game opens just fine, I am prompted with the question, and I can answer it perfectly before being given the corresponding ‘say’. But the scene simply doesn’t end after that. It’s like i7 isn’t reading the ‘now playeranswered is true’ string. Thanks for any help provided, I appreciate it greatly. I’m sure I am overlooking something in my inexperience.

When you reject the player's command the turn ends immediately and it won’t process any further rules, including the ones that would trigger the next scene. If you type any valid command after selecting the trait you’ll notice that the scene begins at the end of that turn when the scene changing rules get to run for the first time.

In this specific case if the question scene is at the start of the game you can just leave out the “collecting” scene and start immediately with “nextscene” (Nextscene begins when play begins.) Remove the playeranswered variable and put the “when nextscene begins” rule contents inside the “after reading a command” rule when the trait has been selected (now the command prompt is ">"; say "Game begins!"; reject the player's command;)

2 Likes