Hereâs a version which hews closely to the previous versions from the other threads and which lets the player create four different adventurers, using a list which we deplete one item at a time. The properties always refer to the âcurrent adventurerâ variable.
At the end of a characterâs creation, we remove the first entry from the list and check whether the list is not empty. If it isnât empty, we still have to create another character, so we set the âcurrent adventurerâ to the new first entry, and set the stage to stName again, to start with that stage for the next character.
Look further below for the output, which I think is roughly as desired.
Include Questions by Michael Callaghan.
Lobby is a room.
Description of Lobby is "Welcome to the Ugly Ogre Inn! Excitement-starved adventurers meet here to form teams. We are meeting now so all players can define their adventurers.";
An adventurer is a kind of person.
A fighter, cleric, scout, and magician are kinds of adventurers.
An adventurer has some text called adv_name.
An adventurer has some text called adv_class.
An adventurer has a number called dex.
Char1 is a male fighter.
Char2 is a male fighter.
Char3 is a male fighter.
Char4 is a male fighter.
The character-list is a list of adventurers which varies.
The current adventurer is an adventurer that varies.
Data is a kind of value. The data are teamSize, stName, stSex, stClass, stDex, and complete.
Stage is data that varies.
After looking for the first time:
now the character-list is {Char1, Char2, Char3, Char4};
now the current adventurer is Char1;
now stage is stName;
follow the every turn rules;
follow the advance time rule;
Every turn when stage is stName:
now current question is "";
now current prompt is "What is the name of the character? ";
now punctuation removal is true;
ask an open question, in text mode;
A text question rule when stage is stName:
now the adv_name of the current adventurer is the current answer;
now stage is stSex;
exit.
Every turn when stage is stSex:
say "What is the gender of the character?";
now current question menu is {"male", "female"};
now current prompt is "Enter the number of an option: ";
ask an open question, in menu mode;
A menu question rule when stage is stSex:
if the number understood is 2:
now the current adventurer is female;
now stage is stClass;
exit;
Every turn when stage is stClass:
say "What is the class of the character?";
now current question menu is {"fighter", "cleric", "scout", "magician"};
now current prompt is "Enter the number of an option: ";
ask an open question, in menu mode;
A menu question rule when stage is stClass:
let C be the number understood;
now the adv_class of the current adventurer is entry C in the current question menu;
now stage is stDex;
exit;
Every turn when stage is stDex:
now the dex of the current adventurer is a random number from 8 to 18;
say "[line break]Okay, you created [adv_name of the current adventurer], [if current adventurer is male]male[otherwise]female[end if] [adv_class of the current adventurer], with a dexterity of [dex of the current adventurer].[paragraph break]";
remove entry 1 from character-list;
if character-list is not empty:
say "Proceeding to the next character...[paragraph break]";
now the current adventurer is entry 1 in the character-list;
now stage is stName;
follow the every turn rules;
follow the advance time rule;
otherwise:
now stage is complete;
Output:
Release 1 / Serial number 240407 / Inform 7 v10.1.2 / D
Lobby
Welcome to the Ugly Ogre Inn! Excitement-starved adventurers meet here to form teams. We are meeting now so all players can define their adventurers.
What is the name of the character? Alice
What is the gender of the character?
1 - male
2 - female
Enter the number of an option: 2
What is the class of the character?
1 - fighter
2 - cleric
3 - scout
4 - magician
Enter the number of an option: 1
Okay, you created Alice, female fighter, with a dexterity of 13.
Proceeding to the next characterâŚ
What is the name of the character? Bob
What is the gender of the character?
1 - male
2 - female
Enter the number of an option: 1
What is the class of the character?
1 - fighter
2 - cleric
3 - scout
4 - magician
Enter the number of an option: 2
Okay, you created Bob, male cleric, with a dexterity of 10.
Proceeding to the next characterâŚ
What is the name of the character? Carla
What is the gender of the character?
1 - male
2 - female
Enter the number of an option: 2
What is the class of the character?
1 - fighter
2 - cleric
3 - scout
4 - magician
Enter the number of an option: 3
Okay, you created Carla, female scout, with a dexterity of 10.
Proceeding to the next characterâŚ
What is the name of the character? Dave
What is the gender of the character?
1 - male
2 - female
Enter the number of an option: 1
What is the class of the character?
1 - fighter
2 - cleric
3 - scout
4 - magician
Enter the number of an option: 4
Okay, you created Dave, male magician, with a dexterity of 9.
There are still some TO DO points, such as relating the adv_class to the kind of adventurer, for example. But I thought it would be helpful to get the basic mechanism going, at least.