# every room has a center space(i7)

[size=150]premise[/size]
I have defined a kind called a center space.
There is a center space in every room.
I have defined a cart thing.
The drawbridge is a room.

[size=150]Problem[/size]
I am trying to put the cart inside the center space of the drawbridge. The program is not letting me.

exact error message

p.s. on a completely unrelated note, is it possible to center the text on this forum? I can’t seem to figure out how.

You’re trying to refer to “the center space” as a property, which it isn’t. For all Inform knows you might be able to pick up a center space and move it to a different room, so each room might not have exactly one center space within it at all times.

Could I put it in a random center space?

Of course.

EDIT: Assuming you’re doing it when play begins as Matt W suggested, I forgot to check that.

Well, I think you can’t do the “random center space” trick as an assertion, you’d have to do it as a when play begins rule. So “When play begins: now the cart is in a random center space in the drawbridge.”

If you write “The cart is in a random center space in the drawbridge” then the game will create a container called “a random center space in the drawbridge,” put it out of play, and put the cart in it! But on a test, the when play begins rule should work.

By “there is a center space in every room” I assume you mean you have a statement like “A center space is in every room.” to create an assembly.

So you should be able to follow the standard naming convention for assemblies: “The cart is in the drawbridge’s center space.”

Yes, thank you, that worked.

I think this only works when you’re creating something that’s part of something else. (Maybe a couple of other kinds of assembly, too.) So if you write “A nose is part of every person” then the nose that is part of Jane will be named Jane’s nose. But if you write “a center space is in every room” the center space that is in the drawbridge won’t be named “the drawbridge’s center space,” so the declaration “The cart is in the drawbridge’s center space” will create a new container (not a center space) called “the drawbridge’s center space,” out of play.

RE: my last post.

It worked. … I lied.

@matt w: You’re right - it seems the naming convention only applies to incorporation relations created by assembly, and not containment relations.

The best way I know to do this is to define objects through a relation, and then move them into place.

``````A chair is a kind of thing.

Chair-ownership relates one chair (called the furnishing) to one room.
The verb to chair-own (it chair-owns, they chair-own, it is chair-owned) implies the chair-ownership relation.

Every room is chair-owned by a chair.

When play begins:
repeat with R running through rooms:
let C be the furnishing of R;
now C is in R.

[To test this...]

Check examining a chair:
if the noun chair-owns a room (called R):
instead say "This chair belongs in [the R]."

let C be the furnishing of the location;
say "The chair of [the location] is currently in [the holder of C]."``````

Here the chair-ownership relation is fixed through the game, so you can find the chair matching a room (or the room matching a chair) even if the player moves the object around.

Yes, it’s awkward that it’s “the furnishing of R” in one direction, but “if C chair-owns a room…” in the other direction. The compiler doesn’t provide a simple way to find the unique room for a chair, even though it’s genuinely a one-to-one relation.

…Since the center space can’t move around (in the earlier example), you could handle things more simply:

``````To decide what space is the center of (R - room):
decide on a random space in R.``````

Doesn’t this work? I thought I remembered this syntax.

``Chair-ownership relates one chair (called the furnishing) to one room (called the home).``

Nope. Tried it.