Off and On-stage, if Player does... and so on.

I’m pretty sure the answer is to be found in the documentation or on this forum, but I haven’t been able to search it up, sorry. (I’ve really tried!)

I want An Idea to swirl about. Since We can’t see an Idea, I used the following code.

I’ve added the presence of the Idea to the description, and I’ve told Inform the Idea exists.
But now I can’t find out how to do the next thing.

When the player gets the idea (or takes it) I need it to be takable.
It isn’t now.

I’ve tried to make it touchable, I’ve tried to place it in a Storage-room and move it into the location, but it won’t work.

So 1;
How do I write something like

If the player takes An Idea, move it to location/inventory/Players head.


Where in the documentation can I find how to define an object as visible, invisible, touchable (and so on) at the beginning of the game? It won’t let me now.

It refers to the manual, but I can’t understand how to translate that example into what I try to achieve.

I think the manual is wonderful, humorous and very well written. But I do not always get the examples. :frowning:


Your problem is that the idea is offstage (not in any room).
You can confirm that by clicking the Index panel and then the World subtab. It will bring up a map of the game, show you the initial location of all things at the start of the game and a list of all objects in the game (directions are a kind of object).

So, explicitly placing the idea in the office should solve your problems (things in the same place with the player are visible and touchable by default).

[code]Personal Office is a room. “You’re sitting in your home office staring blankly at the white papersheet on the left side of Inform7’s GUI.There is an Idea swirling about.”

In the Personal Office is An Idea.[/code]

Touchable is not a value one can set easily (if one can, and I’m not sure). It is set by the positioning of an object etc and not by direct messings.

What you want to do is (I think):

[code]An idea is in the Personal Office. It is scenery. The description is “You can’t really [italic type]see[roman type] and idea. It’s more a matter of feeling.”

Instead of touching the idea, say “Yeah, you can really feel it!” [note: I didn’t check if “touch” and “feel” are the same, I’m going by memory]

At this point, you can do whatever with your idea, except taking it if not via another instead or similar rule.

Edit: Ouch, Felix. Too fast for me :slight_smile:

Anyway, the “scenery” value means an object is there but is not listed in the room’s description. Also, it is fixed in place, so you cannot move it.

Also, while not a thorough example:

Personal Office is a room. "You're sitting in your home office staring blankly at the white papersheet on the left side of Inform7's GUI."

Instead of thinking:
	Say "It suddenly hits you!";
	Move the Idea to the player.

The Void is a room.

The Idea is in the Void.

Test me with "l/think/i".

Yeah, I love this approach. I don’t think you have to put things in a fake room to make this work, though (I think this is I6 old habits). Just say “An Idea is a thing (etc)”. And then:

Instead of thinking: Say "It suddenly hits you!"; now the Idea is carried by the player.

You’re absolutely right. This also works:

Personal Office is a room. “You’re sitting in your home office staring blankly at the white papersheet on the left side of Inform7’s GUI.”

The Idea is a thing.

Instead of thinking:
Say “It suddenly hits you!”;
Now the idea is carried by the player.

Test me with “l/think/i”[/code]

More resource friendly.

[pre-posting UPDATE: While I was typing, a bunch of people posted some of the stuff I was going to say, but I hope this is helpful.]

The problem is that, if Inform doesn’t think you can reach or touch the Idea to begin with, then the game won’t even understand a command that refers to the idea. So a rule along the lines of “If the player takes an idea…” won’t work, because you don’t even get to the rules for taking an idea – the game won’t even process the option “TAKE IDEA,” because it doesn’t understand “IDEA” as something you can interact with at the moment.

[It also won’t work because you don’t want the rule to start “If the player takes an idea…” If you’ve got a rule for taking an idea, it should begin something like “Before taking an idea…” or “Instead of taking an idea…” or “Carry out taking an idea…” See chapters 7, 12, and 18 of the documentation – hopefully you won’t need to read all the way through all three of those to understand what I’m saying, though!]

Inform has some complicated rules to decide whether something is visible (which basically means you can refer to it in a command) or touchable. That’s why it’s saying you can’t set that directly; Inform wants to be able to calculate that by itself. If you want to take something that wouldn’t be visible otherwise, and make it visible so that the player can refer to it in a command, you have to place it in scope. The way to do this is described in section 17.27 of the manual.

That won’t let you take the idea, though, because in order to take something you have to be able to touch it. Section 12.18 might help here.

I think that if you put these together, it may do what you want. I tried something along these lines and it seemed to work:

Brain is a room. An idea is a thing in Brain. After deciding the scope of the player when taking or examining: Place the idea in scope. Rule for reaching inside Brain: allow access.

(“When taking or examining” means you can take the idea, or examine the idea, but you can’t put it on the table. Actually a better thing to do would probably be to write a rule that blocks any action involving the idea other than taking or examining, as discussed here.)

You’ll note that this is pretty complicated! Another thing you could do [pre-posting UPDATE: as Felix says] is actually put the idea in the room, but make it scenery (so the game doesn’t print “You can see an idea here”) and portable (so you can take it); though then you’d only be able to take the idea in that room. You’ll also want to make sure people can’t do anything outlandish with the idea once they have it, unless you want them to. And you might want to think of a way [pre-posting UPDATE: as I4L says] to let people do something with “think” or similar commands, because most people aren’t going to try “take idea.” After all, ordinary ideas can’t be picked up in real life.


Thank you all for all that input, so fast!

A lot to digest, but hey; this looks fun. And I think I’ve got the idea ( :smiley: ) now.

I will try to solve the problem with this new information, although I had slightly different plans for it.
When the player “gets” the idea, a counter starts. If he doesn’t use the idea fast enough, it will vanish.
Or something like that


Ok, I more or less managed to pull this off by myself.
(I stole some ideas from this thread though)

Although this IS working (kinda), I can see several small problems.

First of all, to be able to count I turned the Idea into a device that is switched on, and counted when switched on.
Not the best solution maybe? :mrgreen:

Secondly, and this is the real problem:
It should not start to count until the player thinks. Now it starts counting wether you try to feel the Idea or if you just wait.

I managed to turn the variable back to zero though, struggled a bit until I understood it was a matter of positioning in the code.

Anyway, it has been fun so far!


(Going to look into the other solutions mentioned now)

[edit: PS, I’m not sure now, if An Idea (which is the device) and the Idea is two different things. Not sure how I could check that]

I think you don’t need neither a counter nor a scene running.

The syntax (not tested) could be

[code]Instead of thinking:
Say “It suddenly hits you!”;
Move the Idea to the player;
Now the idea is switched on; [watch out for periods and colons… a period strops the rule]
The time runs out in 6 turns from now.

At the time when the time runs out:
now the idea is switched off;
remove the idea from play.[/code]

Inform7 has a nice way to run daemons.

Yeah. The articles are not important. Usually.

Edit: Watch out for indents, also. They are mandatory.

Cool. That worked. Thx!


I think indents are only important to rules that contain some kind of control phrase, like “if” or “repeat”.

The problems with your code as it stood was

Instead of thinking: Say "It suddenly hits you!"; Move the Idea to the player. An Idea is switched on.
You had a full stop after “player”, which meant the rule ended there; in consequence “An Idea is switched on” was read as initializing the switched property of the idea (so the idea started out switched on).

When UseIdea begins: Every turn when An Idea is switched on: Increase SomeNumber by 1; say SomeNumber;
You can’t put an “every turn” rule inside a “when scene begins” rule like that (generally, you can’t put a rule inside another rule like that (though, you can tell a rule to consider/follow another rule)). Inform read this as

[code]When UseIdea begins: do nothing.

Every turn when An Idea is switched on: Increase SomeNumber by 1; say SomeNumber.[/code]
So nothing special happened when UseIdea began; and since the idea was switched on from start, the counter started immediately.

I got to thinking about this whole business of managing things the player can think about. I think maybe having an idea object and moving it to the player is perhaps a bit artificial. Here’s an example I whipped up that I think may do what’s needed.

[code]The dining hall is a room. “You can go south from here.”

The kitchen is south of the dining hall. “You can go north from here.” A banana is in the kitchen.

Thinking about is an action applying to one visible thing. Understand “think about [any thing]” as thinking about.

A thing can be known or unknown. A thing is usually unknown. A thing has a number called memory. The memory of a thing is usually 6.

Before printing the name of something (called the target):
now the target is known;
now the memory of the target is 6.

Every turn when the location of the banana is not the location of the player:
decrease the memory of the banana by 1.

Check thinking about the banana:
if the banana is unknown or the memory of the banana is less than 1:
say “Banana? What banana?”;
stop the action.

Report thinking about the banana:
say “Possibly the banana is yellow.”

Test me with “think about banana / s / think about banana / n / think about banana / g / g / g / g / g”.[/code]
The point of this is that the player can think about the banana for some number of turns after leaving the vicinity of the banana, but eventually the memory of the banana will fade, until the banana is forgotten.

This code could easily be modified so that the memory of some items lasts longer than the memory of others, or so that things can be thought about even before they’re encountered. It would malfunction, however, if the things being thought about are scenery, because the name of a scenery item is not printed when the room description is printed.

Thanks for this. You gave me the solution for what I was struggling with now.
I tried to use

Instead of using: Say "You managed to use the idea."
but it refused to compile.

It worked however when I wrote the rule as “Using is an action…”

I’m struggling a bit with the solution felix gave.

Trying to figure that one out now.

Anyway, again. Thx for solutions. I’ve learned a lot today!


Nice solution, as mentioned, but I’ve been trying to stop the timer.
Can that be done without a counter in action?


“The time runs out in 6 turns from now” in effect creates a counter that gets the name “the time runs out” and that counts down from 6 (I suppose).

The rule “At the time when the time runs out” tells the game what to do when the counter “the time runs out” reaches 0.

So it seems, it does what you want. (You’ll find it documented in Ch. 9.11)

So I thought, I was writing it wrong. sometimes I keep on going for to long :slight_smile:


Well, I am beginning to be able to achieve kinda difficult tasks. ( I think I know enough now to actually write a short and easy game. )

BUT, i can’t get this particular thing to work.

I don’t want stuff to show up as “There is a Thingy” here. It is not supposed to be visible until after a task has been done.

Ok, so I make it a scenery. But then I can’t take it (cause it’s fixed.)
(( I have also tried to make it both scenery and portable, but the respons is anyway “that’s hardly portable”. ))

The MOST annoying thing, however, is that I actually found a word that could be used instead of scenery…

  1. That particular code wasn’t saved, for some reason :frowning:
  2. I can’t seem to find that word again.

There might be a good trick of word-combination that would make me be able to search the word in either documentation or forum, but words as “invisible” “not” “visible” “description” (and so on) generates an astounishing amount of (not relevant) hits :slight_smile:

Any way. Thx


There are a couple ways around this (I thought you could make something both scenery and portable, but could be wrong), but have you considered just leaving the object off-stage and then moving it into the room after the task has been done? I think that’s how it’s usually done.

I’d probably go by Matt’s suggestion. As for the lost word, it may have been “undescribed” (doc. 3.24).
You can create portable scenery; but to actually take it, you also need to unlist or replace the can’t take scenery rule.
(The debug commands RULES and ACTIONS are very useful devices, if you want to find out what’s happening on the I7 level in a game.)