So for unfathomable reasons I apparently need to implement a floor, ceiling, and walls in every room in my game. It’s simple enough to put a ceiling in every room:
[code]A ceiling is a kind of thing. It is scenery. The description is usually “It’s the ceiling. What did you expect?”
A ceiling is in every room.[/code]
But Inform specifically prevents me from changing the description of a particular ceiling; the following gets an error:
The description of the ceiling in the dining room is "A fancy crystal chandelier hangs in the middle of the room."
Nor can I just put a specifically named ceiling in rooms that need a different description, since then I’d have two ceilings. Is my only option to actually, as Inform suggests, make one huge text substitution that contains the description of every ceiling in the game?
Yes, that’s the idea of anonymous instances of things – they’re all exact copies of each other. There’s a couple of ways to go around this. The simplest is to change the description at runtime:
When play begins:
now the description of a random ceiling in the dining room is "A fancy crystal chandelier hangs in the middle of the room."
The other is to put the generic ceilings only in rooms that do not already have ceilings, or alternatively remove the duplicates at runtime. This is the preferred method when some instances are genuinely different or significant.
A scenery object is not a way of cloning an object multiple times; rather, it’s a way of moving a single object from room to room along with the player, so that it always appears to be there in the designated rooms. Internally, Inform is literally moving around that ceiling scenery object every time the player moves. That’s why you can’t give a separate description to ‘the ceiling in the dining room’ – because there is no separate ceiling in the dining room, nor is there even a ceiling in the dining room unless the player is also in the dining room.
Presumably, most of your ceilings will have the same description, with a few exceptions for special rooms. If I am correct in that assumption, then a good solution might be to define the standard ceiling scenery as being in every room in the plain-ceilinged region or every room of a plain-ceilinged kind (which you would define according to your map). Leave all the rooms with special ceilings that require individual descriptions out of the definition of ‘plain-ceilinged’, so that they won’t get the standard ceiling moved to them when the player is there. That way the special rooms won’t have two ceilings when you give them a special, separate ceiling scenery object (ceiling2, ceiling3, etc?) of their own.
It’s best to think of scenery as a multi-room effect produced by a single object by always magically jumping to where it needs to be, just in time. Smoke & mirrors. 8)
For a ceiling or a sky, I would use a single backdrop object and use some sleight of hand to change how it was described as needed. That assumes the player’s not going to be doing anything significant to the ceiling in any one room.
For a floor, though, I’d be more careful, because a floor might reasonably be treated as a supporter, possibly an enterable one. So we have to consider:
What happens if the player types PUT (SOMETHING) ON FLOOR? If the floor is a backdrop, I could put a knife on the floor in the kitchen, wander into the living room, and find that the knife was on the floor there too.
Similarly, what if the player types STAND ON FLOOR as a way to get out of objects? What if NPCs stand on floors? Are enterable objects contained within a floor? Those things will all float magically from room to room too if there’s any way for them to get onto the floor supporter.
If we’re sure we’ve covered all our bases about redirecting all actions that might move an object to the floor, we might be able to get away with a floor backdrop, but there are enough complications that it might be more appealing to make one floor object per room.
Could you do this with a say phrase and a table? Something along the lines of:
[code]A ceiling is a kind of thing. It is scenery. The description is “[Ceiling-Description].”
A ceiling is in every room.
To say ceiling-description:
if location is a ceiling-room listed in the Table of Ceiling Descriptions:
say the ceiling-text corresponding to location in the Table of Ceiling Descriptions:
say “Just a plain old ceiling, with some cracks that may or may not have the habit of looking something like a rabbit.”
Table of Ceiling Descriptions
Chapel “The ceiling depicts God creating the universe. You know, that sort of thing.”
Police Station “I was really tempted to put a spoiler for the Third Policeman here, but I can’t. Go read the book.”
I haven’t tested this at all, and I’m not sure if this can get you complex say phrases or even if it works at all, but would it do the sort of thing the original poster wanted? And I suppose it would make more sense for the floor, since you can just use a backdrop for the ceiling.
- What happens if the player types PUT (SOMETHING) ON FLOOR? If the floor is a backdrop, I could put a knife on the floor in the kitchen, wander into the living room, and find that the knife was on the floor there too.
That’s easy: Instead of putting something on the floor, move it to the location. In fact, that totally solves a different problem I was having (moving objects off a supporter without taking them).
For other actions, I should think that a simple response saying that the floor’s existence is passive and it doesn’t need to be interacted with would be enough.