Concealing

I have started not long ago and I am trying to find a way to unconceal an item’s possesions when a player examines it. Or you could tell me a way to show the objects but without printing the things inside them. This is my code so far:

"Short story" by Gameker
A state is a kind of value. The states are on and off.
The TV state is a state that varies.
The TV state is off

The Lounge is a room. “The lounge is very unorganised. I’m not going to list everything in here.”.
The TV is in Lounge.
The sofa is in Lounge.
The remote is in sofa.
Rule for deciding the concealed possessions of the sofa: if the sofa is searched, no; otherwise yes.

This is the line that doesn’t work:

Rule for deciding the concealed possessions of the sofa: if the sofa is searched, no; otherwise yes.

I have also tried examined instead of searched and It doesn’t work.
Thanks in advance :grinning:

I’m fairly new in my adventure into Inform also, but what about the following? It creates the remote as a thing which isn’t in the world until the player examines or searches (which includes looking inside) the sofa. The sofa is now a supporter so that the remote can be on it after discovery.

I also changed the TV part for you, as it may be that your “TV state” replicates the built-in “switched off” and “switched on” properties of the “device” kind.

"Short story" by Gameker

The Lounge is a room. “The lounge is very unorganised. I’m not going to list everything in here.”

The TV is a device in the Lounge. 

The sofa is a supporter in the Lounge.

The remote is a thing.

Before examining or searching the sofa:
	now the remote is on the sofa.
2 Likes

Ok. Thanks

You’ll need to place some kind of limit on that (such as for the first time or when the remote is nowhere), otherwise the remote will mysteriously teleport back to the sofa whenever the sofa is examined, even if the player already picked it up or threw it into an incinerator.

1 Like

Haha! Absolutely right. They say a little knowledge is a dangerous thing. Thanks.

2 Likes

On second thoughts it could be quite funny. No matter where you think the remote is, or what you think has happened to it, if you search the sofa it’s guaranteed to be in there.

4 Likes

People might think it was funny, but they would definitely think it was a bug and that you were careless for leaving it in.

1 Like

Absolutely right. The code couldn’t be used as it stands, for the reason you give, but I could imagine incorporating the idea into a story.

2 Likes

Definitely - say a game where the remote is used in different places, you could make an easter egg that the remote always teleports back to the couch cushions if the player isn’t already holding it. Or you could have a mysterious lost sock that always shows up in the dryer every time the player opens it. “I didn’t even know I lost that!”

I meant that the remote was hiding inside the sofa.

Hitchhikers Guide to the Galaxy have a “thing” that always returns to your inventory after a few turns, even if you dropped it far away. It actually was useful…

1 Like

How about this for a bit of fun using the ideas in this thread? If there are better ways to do it then I would be grateful to hear.

"Short story" by Gameker

The Lounge is a room. “The lounge is very unorganised. I’m not going to list everything in here.”

The TV is a device in the Lounge. 

The sofa is an enterable supporter in the Lounge.

The remote is a thing.

remote-found-times is initially 1000;

Before examining or searching the sofa when the remote is nowhere:
	say "After a quick rummage you locate the remote yet again. If you've found it in here once, you've found it [remote-found-times] times[first time]. You suspect that even if you threw it into an incinerator it would mysteriously teleport itself back[only].";
	now the remote is on the sofa;
	increase remote-found-times by 1.
	
After dropping the remote:
	the remote disappears in a random number from 1 to 3 turns from now;
	continue the action.

At the time when the remote disappears:
	now the remote is nowhere.

The Back Yard is south of the Lounge.

The incinerator is a fixed in place container in the Back Yard.

After inserting the remote into the incinerator:
	say "The remote disappears in a cloud of smoke.";
	now the remote is nowhere.
	
Test me with "examine sofa / get remote / s / throw remote into incinerator / n / examine sofa".
2 Likes