A War of Words?

In the game I am designing I have two authors, Faulkner and Hemingway, that literally are engaging in a war of words. I am trying to design it so that the player responds with a single word when they are prompted. But I cannot get the language to work:

faulknerword is text that varies.
Hemingwayword is text that varies.

every turn during Hemingway_and_Faulkner_Fight:
	if player is in Outside_the_Total_Perspective_Vortex:
		choose a random row in Table of Faulkner words;
		now Faulknerword is the Faulkner word entry;
		now Hemingwayword is the Hemingway word entry;
		blank out the whole row;
		say "Hemingway clears his throat and yells out a word:  [Hemingwayword]!";
		now the command prompt is "What is the Faulkner word response?>";
		let N be a text;
                let N be the noun part of the current action;
		if N is Faulknerword:
			decrease hemingwayhealth by 1;
			if hemingwayhealth is 0:
				now faulknerbattle is 10;
				now the command prompt is ">".

The error I receive is:  You wrote 'let N be the noun part of the current action' but 'N' is supposed to be a stored value holding a text, so it cannot be set equal to noun part of the current action, whose kind is an object.

Any help is always appreciated from you knowledgeable people.  One day I hope to pay it forward!
5 Likes

You can get this to compile by letting N be the printed name of the noun part of the action.

But I wonder if this approach might not work out well in the end; it’s almost like you’re trying to recreate the whole parser structure from scratch.

In particular, the noun part of an action is an object, not some text, and only refers to objects that exist in the game.

If you do go down this path, make sure you check first if the noun sort even exits (like “if the noun part of the action is not nothing:”), otherwise you’ll get runtime errors.

It might be easier to use the pre-existing “answering it that” command, which already gives a text input called “the topic understood”.

Edit:
The example Quiz Show in the manual does almost exactly what you want, I think:

https://ganelson.github.io/inform-website/book/WI_17_17.html

6 Likes

Thank you!

2 Likes

Eagerly awaiting your game. This sounds really fun!

2 Likes

Thanks, I hope so. I have been working on and off on it for about 15 years – I started with ADRIFT and then set it aside when my computer got wiped. Then started over again with INFORM. Took a break for about three years and now am committed to finishing it.

4 Likes