I7 trying to omit a name

I’m trying to make a code work. It is supposed to work like the secret doors extension, but apply to any kind of thing. I do not want to make everything scenery like the extension does.

the code is like this:

[code]A thing can be secret.

a thing can be revealed or hidden.

a thing is usually revealed.
rule for writing a paragraph about a hidden thing:
say “[run paragraph on]”

help :confused:

The basic solution is to not have the object there at all and move it in place when it’s revealed. The reason why there’s an extension for doors specifically is that you can’t apply that trick to doors.

If you don’t want the player to be able to interact with the hidden thing at all before it’s revealed, you should do as Juhana suggests and only move it to the location when it’s revealed.

If you do want to let the player interact with the hidden thing, but just omit it from room descriptions, you can initially make it scenery and then remove that property when it’s revealed. Note that the standard rules also exclude any scenery things from matching “all”, so the player can’t accidentally reveal them with “get all”:


The Testing Chamber is a room.

An invisible pink unicorn is an animal in the testing chamber.  It is scenery.

Before doing something with the invisible pink unicorn: now the noun is not scenery.

Test me with "look / get all / x unicorn / look / get all".

I never knew you can stop something being scenery. I’ve always made clone objects and swapped them out as necessary. This is so much easier!! Thanks.

Would undescribed work?

Actually, I was trying to make something which I could leave them where they are, because i have problems moving things around. this way, they already are in the place they need to be later.

It’s very hard to prevent the player from interacting with a single object that is present in the same location – you’d have to fight Inform’s world model all the way. The way Inform’s scoping rules are set up, it’s easy to add more objects to scope, but almost impossible to remove an object from scope if Inform thinks it should be in scope. (Making the room dark would do the trick, but with some rather undesirable side effects. Ditto for completely overriding the standard “deciding the scope” activity.)

The only way I know of to do it (other than not having the object present in the first place) is to make the object privately-named and only let the player refer to it using conditional “understand” rules, as in Example 345, “Low Light”. However, you’ll also need to take care of various edge cases, like hiding the object from room descriptions and excluding it from matching “all”. (Actually, it occurs to me that making the object temporarily scenery would take care of both of those issues.) That’s a lot of work for something that’s usually better done just by moving the object.

Ps. Just to see if I could, I went and rewrote the “Low Light” example using moving objects instead of conditional understanding. Here it is:

"Lower Light"

The Workroom is a room. The desk is in the Workroom. The brilliant lamp is a device on the desk.

To decide whether the light level is high:
	if the brilliant lamp is switched off, no;
	if the player cannot see the brilliant lamp, no;

To decide whether the light level is low:
	if the light level is high, no;

The shadow is a thing on the desk.
Understand "invisible" or "barely-visible" or "barely visible" as the shadow.
The shadow has an object called the former holder.

Before printing the name of the shadow:
	if the light level is high:
		say "barely-visible ";
	otherwise if the player encloses the shadow:
		say "invisible (but tangible) "

After dropping the shadow when the light level is low:
	say "You let it go and it fades into the ambient gloom."

When play begins: update the presence of the shadow.
Every turn: update the presence of the shadow.

To update the presence of the shadow:
	if the light level is low and the shadow is not off-stage and the player does not enclose the shadow:
		now the former holder of the shadow is the holder of the shadow;
		remove the shadow from play;
	otherwise if the light level is high and the shadow is off-stage:
		move the shadow to the former holder of the shadow.

Test me with "look / get shadow / turn on lamp / look / get shadow / i / turn off lamp / i / drop shadow / look / get shadow / turn on lamp / look".

In this case, at least if one goes by counting lines of code, the object-moving implementation doesn’t really turn out to be significantly simpler than the original one. It’s not really any more complicated either, though, especially given that it implicitly fixes the bug in the original example that I mentioned above.

Oh, I see—I didn’t understand what you were going for until reading the post vyznev just made. FWIW, it’s not too hard to add an unscopable property to Inform’s world model, such that the parser will deny unscopable things’ existence:

[code]A object can be scopable or unscopable; an object is usually scopable.
An unscopable thing is usually scenery.

Include (-
[ DoScopeAction item;
if (~~GetEitherOrProperty(item, (+ scopable +))) {
#Ifdef DEBUG;
if (parser_trace >= 6) {
print "[DSA on ", (the) item, " with reason = ", scope_reason,
" p1 = ", parser_one, " p2 = ", parser_two, “]^”;
@push parser_one;
@push scope_reason;
switch (scope_reason) {
if (item == parser_one) {
parser_two = 1;
if (parser_one ofclass Routine) {
indirect(parser_one, item);
@pull scope_reason;
@pull parser_one;
-) instead of “DoScopeAction” in “Parser.i6t”.

[Adapted from vyznev’s first post.]

The Testing Chamber is a room.

An invisible pink unicorn is an unscopable animal in the testing chamber.

Before jumping:
now the invisible pink unicorn is scopable;
now the invisible pink unicorn is not scenery.

Test me with “get all / x unicorn / jump / look / x unicorn / get all”.[/code]

The “scopable” example seems really useful, you should release it as an extension.

I don’t think I have the skill. but I’ll try.

As an extension.

Thank you!