Dynamic room descriptions

I usually like to write my own room descriptions and explain what objects are in the room.

(Example: You enter the kitchen and sees your mom cooking your dinner. // You enter the kitchen. You're alone.)

The example above could be a simple if statement but the room I'm working in is a bit more difficult.

The room can have up to 4 certain items (Let's say a dress, a hat, a necklace and/or a bracelet). It could have any combination of these, including having none of them.

If the room HAS a dress, that's already 7 different possibilities. It's not going to be very practical to write them all. Is there a better way to do this? Is it possible to do like

Normal room description here. [If dress is in room, show this next. Otherwise don't show this] [if bracelet is in room, show this next. Otherwise don't show this.]

Sorry, I'm bad at explaining.


For the example you give, it seems like it would be possible to use in-room descriptions for your objects; there's a box to check on the game's "features" tab to enable them, I believe. Then you can give each object a line of text which is added to the end of the room description when it is present.

If that doesn't do what you want:

Is it possible to do like

Yes. Is there some reason not to do that?
If you're using a text description for the room, it would look like:

Normal room description here. {here dress:show this next.}{here bracelet:show this next}

If you're using a script description, it could be something like:

desc = "Normal room description here."
if (ListContains (ScopeVisibleNotHeld (), dress)) {
  desc = desc + " Show this next."
}
if (ListContains (ScopeVisibleNotHeld (), bracelet)) {
  desc = desc + " Show this next."
}
msg (desc)

I have a game, "The house on the hill" that has a very busy front room. There are several sheets that cover the furniture that can be on them, or off. There is a lot that happens in this room. I know it's a wall of text, but it shows you what can be done with mixed items to describe a room.

 <description><![CDATA[{once:You make your way into the house and look around at all the sheets covering the furniture. You are shocked that you really believed they were ghosts! }<br/>Looking around the room, you see several sheets that could be of interest. One {object:sheet:wide sheet} looks like it could cover a small couch or love seat, a {object:sheet1:tall sheet} that looks like it would hide a hat or coat, rack stands next to the front door, a {object:sheet2:small sheet} that looks like it could easily cover a small table. {if chair.visible=False:Left of it, is one looks like a {object:sheet3:chair shape}{if dryclothes.visible=True: with a neat pile of folded {object:dryclothes:dry clothes} resting on it} and another {object:sheet4:chair shape} is on the other side.}{if chair.visible=True:You notice that the left {object:chair} has the sheet removed and a foot stool is sitting in front of it. A blanket is folded neatly on the table inbetween. It looks like someone, or something is inviting you to rest in the chair for the night. You know it is late and sleeping right now does sound like a good idea.} By the east door is {if sheet5.visible=True:a sheet that looks like it covers a {object:sheet5:kneeling statue} on the floor.} {if sheet6.visible=True:a {object:sheet6:flat sheet} lying on the floor. Knowing what you did not find under it, you are not sure you want to get too close!} {if clock.visible=False:By the north doorway is another {object:sheet7:tall sheet} covering something that looks like it could be attached to the wall.}{if clock.visible=True: There is an old grandfather {object:clock} here that is currently not ticking, but still has the current time, and the {object:sheet8:sheet} that covered it lying on the floor.} {if player.dry=False:A sudden draft from somewhere sends a chill up and down your spine reminding you that you are still soaking wet and cold and have now started to shiver. You need to find something dry to wear, but you suspect that anything here may be old and rotten, but you still need to find out. (And a heat source would help too...)} There is a pair of mostly glass doors, French doors you think they're called, to the west, where you can see a table and several chairs, all covered with sheets. A normal wooden door to the east. AND, beyond the wide opening to the north, is a grand staircase leading to the upper floor. {if player.hat_rack=True: {once:A sudden creak catches your attention and you notice that the tall sheet covering the hat rack, is swaying back and forth. (Anywayy....)}} {if wet clothes.visible=True:Your pile of {object:wet clothes} are lying here on the floor. You could leave them there or place them on the {object:clothes rack:rack} by the fire.}<br/>{if fireplace.visible=True:You see a large {object:fireplace} in the northeast corner with a stack of {object:firewood} near by. Now, if you just had some way to start a fire. }{if fireplace1.visible=True:The old {object:fireplace1:fireplace}loaded with {object:firewood:wood} and ready to be lit, you look around but still nothing to start the fire. Oddly, you thought it was empty the last time you saw it.}{if fireplace2.visible=True:The {object:fireplace2:fireplace} is loaded with wood and burning, casting it's light and heat through out the room. You are not sure who to thank, but you do feel better now... somewhat... {if clothes rack.visible=True: You also notice what looks like a wooden {object:clothes rack}, that you could use to dry your clothes, standing close to the fire place.} {if clothes rack2.visible=True:There is an old wooden {object:clothes rack2:clothes rack} here next to the fireplace with your wet clothes draped across the racks. It looks like your clothes will be dry by morning.}}<br/>{if frontdoor2.isopen=True:The {object:frontdoor2:front door} is still open.}<br/>{if frontdoor2.isopen=False:The {object:frontdoor2:front door} is now closed.}]]></description>

And yes, I did have fun with the sheet that covered the kneeling statue...


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums