Help with Inform 7, trying to make stuff untouchable.

First post here, having some trouble with Inform.

So here’s the deal, I need to make an IF for class and in this, I want the player to be a ghost. I want to keep the player from really interacting with most of the environment, instead passing through objects, like a ghost. I’m trying to flag most objects as untouchable but Inform refuses to do this. Here is my current code.

Objects can be physical or mental. Objects are usually physical. Physical objects are untouchable.

Inform then won’t compile the game, saying:
“You wrote ‘Physical objects are untouchable’ : but that’s an implication where the outcome is an adjective other than a simple either/or property, which is the only form of implication I can handle.”

I really don’t want to go and have to find each and every object and mark them as untouchable. Can anyone help?

Is “untouchable” a built-in property? If so, I’d imagine the rules for deciding touchability involve arcane magic like calculating scope and containment, since there are many reasons why something could be not touchable, which is why Inform might be reluctant to just let you declare it. If not, you’d need to define it yourself.

But in either case, it seems like you basically want it to be redundant with “physical,” so you can just do: Instead of touching a physical object: say "Your fingers slide right through it." (And of course you’ll also need to handle taking, eating, etc.)

As tove said, you can’t declare something untouchable like that: it’s not a simple property, but something that must be tested every time based on the world model - is there direct physical access from the player to the object?

What you can do is modify the world model with an accessibility rule:

Accessibility rule:
	if the noun is physical:
		if the action requires a touchable noun, say "Your ghostly hand passes right through [the noun].";
		stop the action;
	if the second noun is physical:
		if the action requires a touchable second noun, say "Your ghostly hand passes right through [the second noun].";
		stop the action.

Which is a great opportunity for me to plug my new “Flexible action requirements” extension. Please check it out and let me know if it’s useful or if you have any suggestions for it! … ements.i7x

In particular, you’ll discover that actions like listening and smelling require a touchable noun. Using Flexible Action Requirements, you can declare

Listening is flexible about touching the noun.

and then use a preamble like this:

Accessibility rule when a physical thing (called the item) is only available when touchable:

katz just did something like this in “House of Fear”, no?

Maybe this is saying the same thing that SJ_43 just said, but wouldn’t it be more resource friendly to set a player property and check that property before interacting with a noun?

That depends on whether the player will ever need to become solid at some point in the game. If not, then just blocking all actions other than examining (and I suppose listening to) should be sufficient. If the player will be switching between a ghostly state and a solid state during the course of the game, then things become a bit more complex-- for example, mental objects will have to be dropped when the player becomes physical (and vice versa), and X ME should reflect the current status.

This should be a good start for that scenario though:

[code]A thing can be mental or physical. A thing is usually physical.

The player is mental. [heh heh] The description is “[if the player is mental]You seem to be translucent and glowing[otherwise]You seem solidly tangible[end if].”

Xyzzying is an action applying to nothing. Understand “xyzzy” as xyzzying.
Carry out xyzzying:
if the player is mental:
say “You solidify.”;
repeat with possession running through carried things:
if the possession is mental, silently try dropping the possession;
now the player is physical;
say “You ectoplasmize.”;
repeat with Larry running through carried things:
if Larry is physical, silently try dropping Larry;
now the player is mental.

Instead of doing something other than listening to or examining with a physical thing when the player is mental, say “Your ghostly hand passes through [the noun] without effect.”

Instead of doing something other than listening to or examining with a mental thing when the player is physical, say “Your solid hand passes through the ephemeral [noun] without effect.”

Haunted Living Room is a room. “This place is all spooky and whatever. On the wall the word XYZZY is written… in blood, of course.”

The lamp is in the living room. The description is “It’s a lamp.” The couch is in the living room. The description is “It’s a couch.” It is fixed in place.

The ectoplasm is in the living room. It is mental. The description is “It glows eerily.” The indefinite article is “some”.

test me with “x me / x lamp / listen to lamp / get lamp / x couch / eat couch / push couch / get ectoplasm / lock ectoplasm with lamp / lock lamp with ectoplasm”.

test me2 with “xyzzy / test me”.[/code]

Hello person who is in my class.