How do I display the full / initial room description when the player looks?

+1 vote
71 views
asked Mar 29 in Authoring by Paul_Erdos (39 points)
retagged Mar 29 by Dannii

I want to have more descriptions of rooms when they're first entered, which is well handled by the usual [if unvisited] method. I can then write a new, concise description in the [otherwise] section. This works well, but I want the player to be able to re-read the initial description if they want, i.e., when they explicitly ask to look at the room again. I can't seem to figure out how to reuse the initial description. I haven't tried, but I wouldn't think resetting the room to unvisited if they look is a good idea, as it might screw with other things that rely on knowing if the room is unvisited.

Is there a good way to get this to happen while still having all the text nicely consolidated in the room's description, or will this require special rules and conditions?

Pretty Landscape is a room. "[if set to unabbreviated room descriptions]Rich, descriptive imagery![otherwise]You are here. You can do this and that."

Instead of looking:
    now use verbose descriptions;
    say room description;
    now use brief descriptions;
[this isn't flexible, it would rest whatever description setting was there initially]
commented Mar 29 by Paul_Erdos (39 points)
the markdown is kindof weird, backticks don't seem to work for code, and it's wrapping all weird.

1 Answer

0 votes
answered Mar 29 by bg (692 points)
selected Sep 7 by Paul_Erdos
 
Best answer

Here's one way you could do it.

Pretty Landscape is a room. The description of Pretty Landscape is "[if long-desc is active]Long description goes here[otherwise]Short description goes here[end if]."

To decide if long-desc is active:
    if the location is unvisited:
        decide yes;
    if the player's command exactly matches the text "look", case insensitively:
        decide yes;
    if the player's command exactly matches the text "l", case insensitively:
        decide yes;
    decide no.
commented Mar 29 by Dannii (329 points)
Rather than testing the player's command I'm sure you could directly check whether the current action is looking.
commented Mar 29 by bg (692 points)
edited Mar 29 by bg
@Dannii--I would, but I don't know how to do that and still make the short description show when you enter a visited room. I was testing the player's command as a way of distinguishing between an automatic looking action that happens when you enter a room, and a manual looking action.
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...