Turning a man into a door.

Hi, I’m working on a game in which I want a man to turn into a door (don’t ask).

Tried “now the overweight man is a door” but that gave me “You wrote ‘now the overweight man is a door’ : but the kind of something is fixed, and cannot be changed during play with a ‘now’.”

How do I get around this?

The easy solution is to make another object, say, “overweight door”, set the printed name to “overweight man”, and swap the objects at the correct moment.

Thanks, I was just trying that. But how do I make a door turn up from nowhere?
I tried just typing “Door is a door”. But it wants a location. So I tried “Door is a door east of cell. It is invisible”.
But that wasn’t allowed either.

You could include the extension “Secret Doors” by Andrew Owen, define the overweight door the way you want it to be when it’s revealed (e.g. “The overweight door is a door. It is east of cell and west of Corridor.”), and add “The overweight door is unrevealed.” Then when you want to swap the objects, remove the overweight man from play and say “Now the overweight door is revealed.”

(BTW, if you look at the source code for that extension, it’s pretty simple; the only obscure parts are the bits about printing the “you can’t go” and “you can’t see” messages, but you could replace those with commands that print out “You can’t go that way.” and “You can’t see any such thing.” without any fuss, or use your own custom messages.)

Oops, sorry, you can’t move doors. Try something like this:

[code]Test is a room. Lab is a room. The overweight man is in test.

The overweight door is a door. Overweight door is north of lab and south of test. Overweight door can be revealed or hidden. It is hidden, privately-named and scenery.

Understand “oveweight” and “door” as overweight door when overweight door is revealed.

Instead of going through hidden overweight door:
say “There’s no door there!”

Instead of examining the overweight man:
say “As you watch the man turns into a door!”;
remove overweight man from play;
now overweight door is revealed.

Test me with “s/x man/s”.[/code]

The Secret Doors extension would be easier, but you need to tweak it a bit since it doesn’t compile in the latest version of Inform without small changes.

Works like a charm! Thanks!

Here’s a tweaked version of the extension.

[spoiler][code]Secret Doors by Andrew Owen begins here.

“Doors and switches that cannot be acted upon until they are discovered.”

A secret door is a kind of door.
A secret door can be revealed or unrevealed.
A secret door is unrevealed.
A secret door is scenery.
A secret door is closed.

A secret switch is a kind of thing.
A secret switch can be revealed or unrevealed.
A secret switch is unrevealed.
A secret switch is scenery.

To print the you can’t go message:
(- L__M(##Go, 2, 0); -).

To print the you can’t see message:
(- L__M(##Miscellany, 30, 0); -).

Before going through an unrevealed secret door:
print the you can’t go message instead.

Before doing something to an unrevealed secret door:
print the you can’t see message instead.

Before doing something when the second noun is an unrevealed secret door:
print the you can’t see message instead.

Before doing something to an unrevealed secret switch:
print the you can’t see message instead.

Before doing something when the second noun is an unrevealed secret switch:
print the you can’t see message instead.

Secret Doors ends here.

---- DOCUMENTATION ----

Secret Doors is an extension which provides robust support for hidden doors and hidden switches. It creates two new kinds: “secret door” (a kind of door) and “secret switch” (a kind of thing) with the properties “revealed” or “unrevealed”.

Example: * Secret Passage - A setting with lots of secrets.

*: "Secret Passage"

Include Secret Doors by Andrew Owen.

Instead of pulling the lever for the first time:
	now the passage door is revealed;
	now the passage door is open;
	say "As you pull the lever, a secret door opens, revealing a secret passage!".

Instead of searching or examining the cave wall:
	now the lever is revealed;
	say "In a gap between two rocks you discover a lever.".

Instead of pulling the lever which is revealed for the first time:
	now the passage door is revealed;
	now the passage door is open;
	say "As you pull the lever, a secret door opens, revealing a secret passage!".

The passage door is a secret door. The passage door is west of the Big Cave and east of the Secret Passage.

The lever is a secret switch in the Big Cave. The lever is fixed in place.

The cave wall is scenery in the Big Cave. The rock is in the big cave.

Test me with "w / pull lever / throw rock at lever / x wall / pull lever / w".

If the player attempts to walk through a secret door, the same response to attempting to travel in a non-existent direction is given:

>west
You can't go that way.

If the player attempts to interact with a secret switch, the same response to attempting to interact with a non-existent object is given:

>pull lever
You can't see any such thing!

>throw rock at lever
You can't see any such thing!

It might be that we want the switch to be in plain sight. In that case it should be defined as a normal object rather than a secret switch. On the other hand, if we want the switch to be hidden as well, then we need a way of revealing it so that it can be used.
[/code][/spoiler]

Hope this helps.

I keep seeing this subject line and thinking of the Soul Coughing song, “Casiotone nation.” Apparently I’ve been hearing the lyric wrong, but I always think he’s saying “Door, door, he’s a man, he’s a man!”