Easy way to check items carried by the player that may be in a container?

Is there an easy way to determine if the player is carrying a certain object, even if it is in a container? Unfortunately, the following does not do the trick:

The wallet is carried by the player. It is a container.
An ID card is in the wallet.

Before going north in Checkpoint Charlie:
	if the player carries the ID card:
		say "You briefly flash your ID to the soldier on duty. He nods at you and you walk on into an uncertain future and into the dark heart of the GDR.";
	else:
		say "The soldier on guard duty stands in your way. 'I'm sorry, sir, I need to see a valid piece of identification,' he says.";
		stop the action.

The only relation that will find things in a container the player possesses is enclosure.

So you can say ‘if the ID card is enclosed by the player’ and that will return true if it’s anywhere on their person - carried, held, worn, or inside something.

I put out a cheat sheet a couple of years ago that shows you what the four adjectives - held, carried, enclosed, worn - apply to. Have a look here: Inform's World Model and the Player - cheat sheet

-Wade

5 Likes

Wonderful, that’s exactly what I needed!