Bureaucracy Style Menu

Hope somebody can advise on this.

If I remember correctly Bureaucracy had an application form that needed to be filled out at the beginning of the game.

Is there any examples of something like this for Inform 7 ?

Basically I need the player to complete a birth certificate to get details such as name and sex ( as well as parents ) to put them into the game. :slight_smile:

You may want to take a look at “Example 405 - Identity Theft” in The Inform 7 Documentation, it shows you how to do just that.

Hope this helps.

I think what the OP is referring to is not the kind of serial question-response of Ex 405, but a fillable form, as in Bureaucracy:

You could certainly do that in Inform 7. You’d compile to Glulx and use a custom text grid window to present the fields and their labels. Or you could just use the status window, and compile to either Glulx or Z-code. You would probably want to use character input (i.e., key-by-key input) to allow for maximum player control of the cursor, and set up some helper routines to define the coordinate where each field begins.

However, no one has done this that I know of, and figuring it out on your own isn’t trivial.

I’ve released an extension that allows you to create a fillable form using graphics: Glimmr Form Fields. However, if you aren’t already planning to use graphics in your game, I wouldn’t recommend this as a solution. Your time would be equally well spent figuring out how to build a text version.

The easy way out is to simply ask question-per-question, as suggested by climbingstars’s example.

–Erik

Thank you both for your help here.

I have for the moment gone done the Q/A track as that is in fairness the easy solution once there was an example to work with.

I do think, that when the game is finished it will be worth then attempting a more interesting way of doing this with the form and some extensions - but that is a stretch goal now that I have the Q’s in place.

Thanks again.

Damn, I wish I could figure this out… :cry:

I have the code pasted below working in the game. It is a modification of the Identity Theft example that I was shown earlier.

I have tried for the past few hours to add one more question which I would hope would have been simple to ask their age.

I have tired modifying the name code to only one word and also adding a variable for the age field, nothing seems to work. The original merged code from Identity Theft does work.

Could anyone be good enough to give me a hint on what I should be doing, I don’t mind trying to figure it out but just need a slight pointer in the right direction. I am not a coder, so what is obvious to some, may not be that obvious to me!

Thank you.

[code][Do Character Setup]
When play begins:
say “Should your character be male or female? >”;
if men win, now the player is male;
otherwise now the player is female.

To decide whether men win:
(- Question('male','M//','man','female','F//','woman') -) 

Include (- 

[ Question pos1 pos2 pos3 neg1 neg2 neg3 first_word_typed;
	while (true) {
		VM_ReadKeyboard(buffer, parse);
		wn = 1; first_word_typed = NextWordStopped();
		if (first_word_typed == pos1 or pos2 or pos3) rtrue;
		if (first_word_typed == neg1 or neg2 or neg3) rfalse;
		print "Please choose ", (address) pos1, " or ", (address) neg1, ". > ";
	}
]; 

-) 

The player’s forename is an indexed text that varies.
The player’s full name is an indexed text that varies.

When play begins:
now the command prompt is "What is your name? > ".

To decide whether collecting names:
if the command prompt is "What is your name? > ", yes;
no.

After reading a command when collecting names:
if the number of words in the player’s command is greater than 7:
say “[paragraph break]Some people like long names, others don’t. This game falls into the not liking long names camp! Please try again.”;
reject the player’s command;
now the player’s full name is “[the player’s command in title case]”;
now the player’s forename is word number 1 in the player’s full name;
now the command prompt is “>”;
clear the screen;
say “[banner text]”;
move the player to your bed;
reject the player’s command.

Instead of looking when collecting names: do nothing. 

Rule for printing the banner text when collecting names: do nothing. 

Rule for constructing the status line when collecting names: do nothing. 

The letter is in the apartmentkitchen. “A letter has been left on the floor.”.
The description of the letter is “Dear [player’s forename], [paragraph break]This letter confirms that your mortgage is now two months in arrears and you need to make arrangements to pay the outstanding debt.[paragraph break]Please call us on Hyde 2612 and ask for [if player is male]Frank Morgan and he[end if][if player is female]Francis Morgan and she[end if] will be able to assist. [paragraph break]You will need to quote ‘g/3n/3-[player’s full name]’ as a reference.[paragraph break]Failure to call us within 7 days will result in legal action.[paragraph break]Yours sincerley,[paragraph break]Hyde Mortgages.”.

Instead of examining the player when the player is female:
	say "Probably best for people in your condition to sit down when you go to the toilet." 

Instead of examining the player when the player is male:
	say "Your the kind of person that always leaves the seat up." 

[/code]

That’s not bad for a first try, but I think you’re clinging a little too close to the two pieces of example code you reuse, and perhaps you do not quite follow the logic behind the code. Actually, what you try to do is a little tricky. Here, I think, is one way to do it.

Include Basic Screen Effects by Emily short.

Introduction is a scene. Introduction begins when play begins. Introduction ends when the command prompt is ">". When introduction ends: clear screen; say paragraph break; say banner text; try looking.

Instead of doing anything except setting the player's age during introduction: if the command prompt is "How old is your character? >", say "Please choose an age between 10 and 100."; otherwise do nothing.
Rule for printing the banner text during introduction: do nothing. 
Rule for constructing the status line during introduction: do nothing. 

When play begins:
	now the command prompt is "Should your character be male or female? >".

After reading a command when the command prompt is "Should your character be male or female? >":
	if the player's command matches "man/male/m":
		now the player is male;
		now the command prompt is "What is the name of your character? >";
		say conditional paragraph break;
		reject the player's command;
	if the player's command matches "woman/female/f":
		now the player is female;
		now the command prompt is "What is the name of your character? >";
		say conditional paragraph break;
		reject the player's command;
	say "Please type 'male' or 'female'.";
	reject the player's command.

The player's forename is an indexed text that varies. 
The player's full name is an indexed text that varies. 
	
After reading a command when the command prompt is "What is the name of your character? >":
	if the number of words in the player's command is greater than 7:
		say "[paragraph break]Some people like long names, others don't.  This game falls into the not liking long names camp!  Please try again.";
		reject the player's command;
	now the player's full name is "[the player's command in title case]";
	now the player's forename is word number 1 in the player's full name;
	now the command prompt is "How old is your character? >";
	say conditional paragraph break;
	reject the player's command.

The player's age is a number that varies.

Setting the player's age is an action applying to one number.
Understand "[number]" as setting the player's age while the command prompt is "How old is your character? >".

Carry out setting the player's age:
	if the number understood is less than 10 or the number understood is greater than 100:
		instead say "Please choose an age between 10 and 100.";
	otherwise:
		now the player's age is the number understood;
		now the command prompt is ">".

The Bedroom is a room.
A bed is in the bedroom. The player is in bed.

Felix, I just want to take a moment to say thank you for your help here.

This fixes the problem I was having and the structure has helped me understand fully ( I believe ) what is going on here.

Many thanks for taking the time to do this. Everything is working perfectly and now I have an understanding how to expand the initial questions should I need to.

Thank you.