Help with Code

Okay. Bunch of code here. Question to follow:

[code]nclude Basic Screen Effects by Emily Short.
Include Questions by Michael Callaghan.

[Setup Variables]
The player’s race, current skill and player’s class is text that varies.
The player’s sex is gender that varies.
The player’s stamina, skill count and experience is a number that varies.

Table of Status
left central right
"Race: [player’s race] " “Sex: [player’s sex]” “Stamina: [player’s stamina]”
“Class: [player’s class]” “Skills: [skill count]” “Exp: [experience]”

Rule for constructing the status line:
fill status bar with Table of Status;
rule succeeds.

Table of Skills
Learned Name Category Disabled
“No” “Alchemy” “Combat” “No”
“No” “Arcana” “Combat” “No”
“No” “Archery” “Combat” “No”
“No” “Brawling” “Combat” “No”
“No” “Dueling” “Combat” “No”
“No” “Military” “Combat” “No”
“No” “Agility” “Physical” “No”
“No” “Athletics” “Physical” “No”
“No” “Endurance” “Physical” “No”
“No” “Stealth” “Physical” “No”
“No” “Awareness” “Mental” “No”
“No” “History” “Mental” “No”
“No” “Reasoning” “Mental” “No”
“No” “Survival” “Mental” “No”
“No” “Willpower” “Mental” “No”
“No” “Deception” “Mental” “No”
“No” “Empathy” “Mental” “No”
“No” “Persuassion” “Mental” “No”
“No” “Streetwise” “Mental” “No”
“No” “Craftsmanship” “Utility” “No”
“No” “Devotion” “Utility” “No”
“No” “Performance” “Utility” “No”
“No” “Runes” “Utility” “No”
“No” “Thievery” “Utility” “No”

Listing skills is an action out of world. Understand “skills” as listing skills.

Carry out listing skills:
say “Skills (Disabled?):[line break]”;
repeat through Table of Skills:
if there is a Learned entry and the Learned entry is “Yes”:
if there is a Name entry:
say “[name entry] ([disabled entry])”;
say line break.

[Character Creation]
Welcome is a room. Welcome is north of Character Creation.
“Welcome to Legacy of Dragonholt. First thing is to read the Character Creation book. Once you have created your character, answer the following questions to put your character into the game. NOTE: This Inform game is designed strictly for a solo player.[paragraph break]For now, head south by entering ‘s’.”
Character Creation is a room.

Data is a kind of value. The data are race, class, sex, finalize, skillsone, skillstwo and complete.

player’s stamina is 18.

Introduction is a scene. Introduction begins when the location is the character creation.
Introduction begins when play begins. Introduction ends when stage is complete.
Stage is data that varies.

When introduction begins:
now stage is race.

Every turn during introduction:
if stage is race:
now current question is “What Race did you choose?”;
now current question menu is {“Baronial Human”, “Free City Human”, “Tribal Orc”, “Stone-Dweller Orc”, “Dunwarr Dwarf”, “Forge Dwarf”, “Latari Elf”, “Dawnsmoor Elf”, “Burrow Gnome”, “Wanderer Gnome”, “Hyrrinx Catfolk”, “Half-Catfolk”};
ask a closed question, in menu mode;
if stage is class:
now current question is “[line break] What Class did you choose?”;
now current question menu is {“Apothecary”, “Bard”, “Brawler”, “Knight”, “Sage”, “Thief”, “Wildlander”};
ask a closed question, in menu mode;
if stage is sex:
now current question is “[line break] Do you want to play as a male, female or neutral character”;
ask a closed question, in gender mode;
if stage is finalize:
say “You have chosen:[line break]Race: [player’s race][line break]Class: [player’s class][line break]Sex: [player’s sex][paragraph break]”;
now current question is “Are you happy with your responses?”;
ask a closed question, in yes/no mode;
if stage is skillsone:
say “Now tell me which skills you have :[paragraph break]”;
repeat through Table of Skills:
if there is a Learned entry and the Learned entry is “No”:
if there is a Name entry:
say “[name entry]”;
say line break;
Now current question is “”;
Now the current prompt is "Type name of skill: ";
Ask a closed question, in text mode;
if stage is skillstwo:
say “[paragraph break]Now tell me which skills you have:[paragraph break]”;
repeat through Table of Skills:
if there is a Learned entry and the Learned entry is “No”:
if there is a Name entry:
say “[name entry]”;
say line break;
Now current question is “”;
Now the current prompt is "Type name of skill (or type Finished if done selecting skills): ";
Ask a closed question, in text mode;

A text question rule (this is the skills one rule):
if introduction is happening and stage is skillsone:
if there is a name of current answer in the Table of Skills:
increase skill count by 1;
choose a row with a name of current answer in the Table of Skills;
now the learned entry is “Yes”;
if skill count is 5:
now stage is skillstwo;
otherwise:
say “Please choose avalid option.[paragraph break]”;
exit.

A text question rule (this is the skills two rule):
if introduction is happening and stage is skillstwo:
if there is a name of current answer in the Table of Skills:
increase skill count by 1;
decrease player’s stamina by 2;
choose a row with a name of current answer in the Table of Skills;
now the learned entry is “Yes”;
if skill count is 8:
now stage is complete;
if current answer is “Finished”:
now stage is complete;
otherwise:
say “Please choose avalid option.[paragraph break]”;
exit.

A menu question rule (this is the choose race rule):
if introduction is happening and stage is race:
if the number understood is 1:
now player’s race is “Baronial Human”;
now stage is class;
if the number understood is 2:
now player’s race is “Free City Human”;
now stage is class;
if the number understood is 3:
now player’s race is “Tribal Orc”;
now stage is class;
if the number understood is 4:
now player’s race is “Stone-Dweller Orc”;
now stage is class;
if the number understood is 5:
now player’s race is “Dunwarr Dwarf”;
now stage is class;
if the number understood is 6:
now player’s race is “Forge Dwarf”;
now stage is class;
if the number understood is 7:
now player’s race is “Latari Elf”;
now stage is class;
if the number understood is 8:
now player’s race is “Dawnsmoor Elf”;
now stage is class;
if the number understood is 9:
now player’s race is “Burrow Gnome”;
now stage is class;
if the number understood is 10:
now player’s race is “Wanderer Gnome”;
now stage is class;
if the number understood is 11:
now player’s race is “Hyrrinx Catfolk”;
now stage is class;
if the number understood is 12:
now player’s race is “Half-Catfolk”;
now stage is class;
exit.

A menu question rule (this is the choose class rule):
if introduction is happening and stage is class:
if the number understood is 1:
now player’s class is “Apothecary”;
now stage is sex;
if the number understood is 2:
now player’s class is “Bard”;
now stage is sex;
if the number understood is 3:
now player’s class is “Brawler”;
now stage is sex;
if the number understood is 4:
now player’s class is “Knight”;
now stage is sex;
if the number understood is 5:
now player’s class is “Sage”;
now stage is sex;
if the number understood is 6:
now player’s class is “Thief”;
now stage is sex;
if the number understood is 7:
now player’s class is “Wildlander”;
now stage is sex;
exit.

A gender question rule (this is the gather gender rule):
if introduction is happening and stage is sex:
now the player’s sex is the gender understood;
now stage is finalize;
exit.

A yes/no question rule (this is the confirm answers rule):
if introduction is happening and stage is finalize:
if the decision understood is Yes:
say “Thank you.”;
now stage is skillsone;
exit;
otherwise:
say “OK. Let’s start again, shall we[line break]”;
now stage is race;
exit.[/code]

So, everything was working like I was wanting, until the program gets to “skillstwo”. The prompt changes like I want it to, but when I enter a name of a skill, it doesn’t update like it was doing in “skillsone”. It gets stuck in endless loop. I’ve looked at it for half an hour. It seems like it should work. What is wrong?

In the “skills two rule”, try replacing

if current answer is "Finished":

with

otherwise if current answer is "Finished":

No. It’s still not working. After I enter the 5th skill, it shows the correct prompt for skillstwo but when I put in a valid skill nothing updates. Skill Count is still 5 and the skill doesn’t disappear from the list of options and it never exits from its stage. Not even entering Finished works.

Nevermind. I found a work around. Thanks!

Your problem was that the “exit” was misaligned in the skills one rule. It needs to be subordinate to the first “if”, not aligned with it.