Still No Resolution To You Must Supply A Noun Problem

I still have no resolution to my problem. I did find a reference in Aaron Reed’s book that seems to point to my problem, but still no cigar! Look below:

[code]Closet off Bedroom
You can see a closed trap door in the floor of the closet and a few worn out pieces of clothing hanging on a wood closet pole. The walls of the closet have been painted an off-white and even the cloths rod has a film of white paint.

You can go north to Bedroom of House, east to Living Room of Friend’s House, and down through the trap door (closed) from here.

The Renter arrives from the north.

2:20 am>open door
(first unlocking the trap door)
(with rusty key)
The old rusty hinges on the trapdoor squeak and grown as you pull the door up.

2:21 am>d

Slimy Wet Steps
Moss and mushrooms are growing and the smell is overwhelmingly of rot. As you go down a few steps, the old wooden steps behind you crumble and fall away.

You can go southeast, west, and up through the trap door to Closet off Bedroom from here.

You must supply a noun.[/code]

I added the final line but that did not help. ----- So, HELP!!!

In-game, type the commands ACTIONS, then RULES, and play a few turns. What output do you get? It should reveal something about what in your source code triggers the “You must supply a noun” response.

(Back-link: the poster is referring to earlier post https://intfiction.org/t/error-message-you-must-supply-a-noun/4077/1 )

Does your code have something similar to this, where you have an action applying to one thing with a corresponding try statement, like so?

[code]Doing is an action applying to one thing.

Every turn: try doing.[/code]

What’s going on here is that you have defined an action to apply to one thing, then not supplied that thing in the try statement referring to the aforementioned action, therefore the noun is still nothing and the error message is given.

There are three ways you can fix this.

  1. You can add a rule for supplying a missing noun to automatically set the noun, like so.

[code]“Test”

Doing is an action applying to one thing.

Rule for supplying a missing noun while doing: now the noun is the person asked.

Every turn: try doing.

The Testing Room is A Room.[/code]

  1. You can supply the noun directly, like so.

[code]“Test”

Doing is an action applying to one thing.

Every turn: try doing the player.

The Testing Room is A Room.[/code]

  1. You can redefine the action to apply to nothing, like so.

[code]“Test”

Doing is an action applying to nothing.

Every turn: try doing.

The Testing Room is A Room.[/code]

Overall, you need to make sure you have the right number of nouns to fit the action.

If this is not the case, post your full source code here and we’ll diagnose the problem for you.

Hope this helps.

It would appear that the problem has been solved with the elimination of a block of code. Now, I have to replace the code and or figure out just what I am doing.
The source for the code is in Jim Aikin’s Information 7 Handbook on page 173 - Characters Who Follow the Player -
So, now to the solution . Greg

So, it seems what goes wrong is that when you try Renter going the way, the way is nothing; presumably because there is no best route from the location of Renter to the location of the player. Perhaps you have some code that sees to it that, when the old wooden steps behind the player crumble and fall away, there is no longer a way down from the Closet? If so, then there is no best route from Closet off Bedroom to Slimy Wet Steps, and the ‘way’ variable will be nothing.

Try and see if this helps:

Every turn:
	if the location of Renter is not the location of the player:
		let the way be the best route from the location of Renter to the location of the player;
		if the way is not nothing, try Renter going the way.

Another reason there might be no best route from the Renter to the player is if you have doors. By default, “the best route” in Inform doesn’t include doors; if you want to allow the Renter to go through doors on his/her way to the player you can say “let the way be the best route from the location of Renter to the location of the player, using doors.”

(This information is filed away rather obscurely in section 6.17 of the documentation.)

In any case, it’s always a good idea to include something like what Felix did in his last post whenever you’re using “the best route,” just in case route-finding fails somehow.

It’s all coming back to me now. There should be a rule: If you get the error “you must supply a noun” when no one has typed a command, check your NPC movement rules and make sure you test if “the way is nothing.” Happens all the time.

It’s actually more general that that. Consider this.

[code]Food is a kind of thing. Food is edible.

Every turn: try eating random food in the location of the player.[/code]

Here, if there is no food in the location of the player, the player will end up literally “eating nothing”, which will give the “You must supply a noun.” error.

Hope this helps.

I wonder if this would be considered a bug? Surely the “you” in the error message is meant to refer to the player, not the author; other similar author-directed error messages are cast as run-time errors by NI.