listing items in the room

Okay, so I have this source text:

Rule for printing the locale description of rooms: stop.

The reason for this was because I wanted to customize each room so that it didn’t produce the bland, “You see a thing, another thing (on which is a thing), another thing (in which is a thing), and another thing (closed).” type of message at the end of the room description. The problem is, now when a player drops an item, it’s not listed at all, so they can’t find an item when they do a LOOK.

I tried fixing this slightly with

In the room is [a list of unconcealed portable things in *name of the room*]."

which KIND OF gave me the results I wanted, since it only includes items that can be taken by the player and not ones that are fixed in place, only the description also includes the player. For example, if I’m in the room, and I DROP some keys, then LOOK, I will get the description of the room along with “In the room is keys and yourself.”

How can I write it so that the results are just “In the room is keys?” Or, is there a better alternative to the way I’ve programmed it? Thanks for any help you can provide!

Well, if you want things that are fixed in place not to appear in the “You can also see” paragraph, you can declare them scenery. So if you write:

Bar is a room. "There's a table here." A table is fixed in place in Bar.

then you’ll get “You can see a table here,” but if you write

Bar is a room. "There's a table here." A table is scenery in Bar.

then it shouldn’t say “You can see a table here.”

There are lots of other ways to tweak these things. For instance, if you write:

Rule for writing a paragraph about Echo: say "Echo is here, wasting away."

then you will get that paragraph about Echo and Echo will not appear in the you-can-also-see paragraph. And if you write:

Rule for writing a paragraph about Echo: say "Echo is here, wasting away[if the location encloses Narcissus]and staring longingly at [Narcissus][end if]."

then neither Echo nor Narcissus will show up in the you-can-also-see paragraph, because Inform knows that they’ve already been mentioned. (This only works because we put Narcissus’s name in brackets, so Inform knows we printed his name. This gives Narcissus the mentioned property, which means he doesn’t get mentioned in the you-can-also-see paragraph.)

There are lots of other ways to manipulate the room description. Section 3.1 of the Recipe Book has many examples. “Rip Van Winkle” and (for some much more complicated stuff) “Copper River” might be especially of interest.

Those are good. When it comes to things that never move from the spot, I like to interleave them into the room description. While that’s a risky habit to get into, it does make it a lot more compact IMHO:

The Bar is a room. "This is your typical Irish bar. Behind the wide oaken [counter] you see [Paddy]." Paddy is a man in the Bar. The counter is a thing in the Bar. The counter is fixed in place.

Thanks matt w and Eleas.

I have tried the methods which you described, but I’m still not getting the results I want. I also may not have been very clear about what I was trying to produce. Initially, here is how the story would normally result:

Both James (on James’s bed) and the music player are in separate paragraphs, making it glaringly obvious to the player that these are things which are of importance. I would like a way to incorporate them more organically into the room description.

I have tried stopping the rule for printing the locale description of rooms, which gave me the effect I wanted while allowing me to put the descriptions of the items in the room description, but as I’m sure you already guessed, this was not an appropriate solution. In doing so, I would get the result:

So at first glance, this looks like it would suffice, and I certainly thought it would at first. Unfortunately, now if the player (of the game) takes the music player or takes James, the room description will still say that the music player is sitting on the dresser or that James is still in the bed.

I hope I’m getting my point across. I only started learning how to write IF games last month, and I’m not sure if I’m even expressing my problem clearly.

Well, the quickest way to get the room description in one paragraph is to use the extension Single Paragraph Description by Emily Short, which wraps everything up into one paragraph.

If you want those specific sentences to appear you could fold them into the room description, conditional on the object you’re talking about being in the right place. And if you bracket the name of the object, then Inform will know that the object has already been mentioned and won’t write a you-can-see paragraph about it.

So like this:

[code]James’s Room is a room. “James’s room. The walls are painted blue, with a large Superman decal on the wall. In one corner of the room is James’s racecar bed. On the opposite side of the room are his dresser and toychest[if the music player is on the dresser]. On the dresser sits [James’s sleepy time music player][end if][if James is on the bed]. [James] is peacefully asleep in bed, clutching his blue blankie and sucking his thumb[end if].”

The dresser is a scenery supporter in James’s Room. The toychest is a scenery supporter in James’s room. James’s bed is a scenery supporter in James’s room. James is on James’s bed. James’s sleepy time music player is on the dresser.

After looking in James’s room, say “If you go south, you will be in the Guest Bathroom. Southwest takes you to the Bottom of the Attic Stairs. West leads back to the Master Bedroom.”[/code]

Try this and you’ll see that when you take the appropriate object the relevant sentence disappears from the room description. If you then put it somewhere else you will get a you-can-see paragraph, but that’s desirable–you don’t want to have to write a special sentence for everywhere James can be, and you certainly want him to appear in the room description if he’s there even if he isn’t in his usual place. You could perhaps combine this approach with Single Paragraph Description.

By the way, the reason the periods are in weird places is that Inform likes to put paragraph breaks after periods when they appear just before substitutions, so it’s a pretty good idea to make sure that doesn’t happen. Putting one period just after the “if” and another just after the “end if” is a way around that.

I took a look at Single Paragraph Description by Emily Short. I got confused. Then I cried. No, not really, but it did get me far more lost than I’d initially expected it to. Perhaps one day when my understanding of how to efficiently use extensions, I will give it another shot.

Thank you again, both matt w and Eleas. I now better understand what Eleas was trying to tell me about interweaving them, after matt w explained what the brackets around the object does. Using the if/end if statements was something I already had a little bit of experience with, but hadn’t thought to use it in this respect in order to remove them from the description. I had previously only used it to describe an object if it had two possible conditions, i.e. “James is awake” versus “James is asleep”.

Thanks!! I’m very grateful for the help!

You didn’t say what problems you had with Single Paragraph Description, but if you are using Inform 6M62 you will probably also need the latest Room Description Control from here.

I tried this. I possibly might suggest you use the “handled” adjective to keep things out of the room description after they’ve been moved by the player. After they set them down again, it will produce a stray paragraph, but that’s not a bad thing - once items are disturbed you want to remind the player where they left them.

The trick is using the brackets in the room description around actual names of the objects so they will be marked mentioned.

Sorry if this is a repeat, I’m just having a try at this.

[code]“Paragraphs”

James’s Room is a room. “James’s room. The walls are painted blue, with a large Superman decal on the wall. In one corner of the room is James’s [racecar bed]. On the opposite side of the room are his [dresser] and toychest. [if music player is not handled]On the dresser sits James’s sleepy time [music player]. [end if][if James is on racecar bed][James] is peacefully asleep in bed, clutching his blue blankie and sucking his thumb. [end if][paragraph break]
If you go south, you will be in the Guest Bathroom. Southwest takes you to the Bottom of the Attic Stairs. West leads back to the Master Bedroom.”

A racecar bed is an enterable supporter in James’s Room. James is on racecar bed.

James’s dresser is a supporter in James’s Room. A music player is on dresser.[/code]

Edited to add an alternate description if James is on the floor.

James's Room is a room. "James's room. The walls are painted blue, with a large Superman decal on the wall. In one corner of the room is James's [racecar bed]. On the opposite side of the room are his [dresser] and toychest. [if music player is not handled]On the dresser sits James's sleepy time [music player]. [end if][if James is on racecar bed][James] is peacefully asleep in bed, clutching his blue blankie and sucking his thumb. [otherwise if James is in the location][James] sits on the floor looking around bewilderedly. [end if][paragraph break] If you go south, you will be in the Guest Bathroom. Southwest takes you to the Bottom of the Attic Stairs. West leads back to the Master Bedroom."

Oops on dropping James.

After dropping James: say "You set James down carefully."

Hanon,
Thanks! I am slowly piecing together everyone’s advice, and it’s coming out exactly how I initially desired. Also, thanks for the bit on dropping James. This was actually on my to-do list to figure out later – I’m glad the solution is so simple. I thought I was going to have to create a new rule or unlist one or something.

Angstsmurf,
With Single Paragraph Description, I basically just had issues understanding how to even use it. I did understand I needed to get Room Description Control, so I installed it (thank you for the link, though). I guess my first impression was that Single Paragraph Description would be an extension…

Scratch that… Last night all I found was source text and thought that I was supposed to copy and paste it into my own source text, then customize it to my needs, which didn’t make ANY sense to me. As I was about to post the link just now, I found the link to actually download the extension. I’m going to give it another go.

Depending on your OS (it definitely works on the Mac, maybe on others), you should be able to get these extensions through the Public Library in your Inform app. Click on Extensions (on the side), Public Library (on the top), “Commands” §5 and “Looking” §5.1 and you should get “Download” buttons for the extensions–then you can download them and install them. (If you don’t want to go through Commands and Looking and you know the name of the extension you’re looking for you can click on the “show everything” button on the top and do a Find command to search for the title of the extension you need.)

Is there a reason why using “after looking” is more preferable than using a paragraph break?

If you make the exit list part of the room description, then if you move James the “You can see James here” shows up after the exit list. Making it an “after looking” makes sure that it shows up after absolutely every part of the room description.

ah got it. thank you very much.