Bringing something in from nowhere

I have a item that exists only as a collection, say, gold cache. Things are working fine unless player wants to examine one of the identical gold pieces. I want to bring in a gold piece from nowhere if the player wants to do something with it. However, I get pre-empted by the “can’t see any such thing” rule. Is there a way to bring something in from nowhere earlier?

I can rebuild the

Rule for printing a parser error when the latest parser error is the can't see any such thing error:
but that requires all possible phrasings to be entered in that rule, practically replacing the parser, for examining, dropping, etc. The parser error does not understand the Understand statement, such as Understand "gp" as gold piece.

I tried

Before examining something from nowhere:
   if player's command contains "gold coin":
       now gold coin is carried by the player;
      say "[description of gold coin]";

but that doesn’t work either (after compiling successfully).

Why does it have to start from nowhere? If you don’t mention it until it is relevant the player won’t even know it’s there.

I didn’t really understand the rules around “nowhere” so for one of my games I had a secret “treasure room” that wasn’t connected to the map from which I’d move things into and out of.

You might do something like this:

a gold piece is a thing. The description is "description of gold piece."

After deciding the scope of the player when examining:
	place the gold piece in scope;
1 Like

That’s actually what “nowhere” is.

The player has a collection of coins in his belt pouch. However, he wants to examine a single coin, not the collection. If I say examine coin, it doesn’t exist; only the collection does.

I think this is what I was looking for. Preliminary results are promising. I’ll let you know.
This could be a general solution to a long-term problem.

1 Like

Yes, this worked great. The player can examine coins in his pouch or a single coin (assumedly from his pouch) if nbrGold is not zero.

Of course, but it tickles me more to have an explicit secret treasure room full of game objects.

Nothing wrong with a secret room holding all the goodies… Here is an extract out of of my One King game:

r-blackhole is a room.

Rule for reaching inside r-blackhole: allow access;

The printed name of r-blackhole is "Black Hole".

Alcaz is a man in r-blackhole.
Lydia is a woman in r-blackhole.
The demon is a monster in r-blackhole.
The stain is a thing in r-blackhole.
The serpent is a monster in r-blackhole.
The corpse is a monster in r-blackhole.
The corpses are scenery monsters in r-blackhole. The corpses are plural-named.
The skeleton is a monster in r-blackhole.
The skeletons are scenery monsters in r-blackhole. The skeletons are plural-named.
The dragon is a monster in r-blackhole.
The hilt is a thing in r-blackhole. The printed name of the hilt is "sword hilt".
The handle is a thing in r-blackhole. The printed name of the handle is "axe handle".
The dragon-shield is scenery in r-blackhole. The printed name of the dragon-shield is "shield of dark magic".

Swapping it with is an action applying to two things.
[ Swap two things. To avoid runtime errors, all things are in a location, worn or carried ]
[ by a person, or in a container. Offstage things are held in the black hole room. ]
Carry out swapping it with:
	let N be the holder of the noun;
	let S be the holder of the second noun;
	transfer the noun to S;
	transfer the second noun to N;
1 Like

Sometimes you have to, and add a reaching inside rule. I think the distinction is you have to do that to support actions that require a touchable noun.

You do know that Inform accepts multi-line comments using the [ ] syntax, right?

Yes I do know I can create multi-line comments…

[ The killing blow delivered with the sword
I made this part of the intro hoping that observant players will remember it and
that they realize they made the wrong choice when history starts repeating itself.
Based on the battle between Conan and a demon described in The Phoenix on the Sword,
one of the original short stories about Conan the Cimmerian written by American author
Robert E. Howard and first published in Weird Tales magazine in December 1932.
]

Looks like I used block comments more often when the number of lines was more than just a few…