Scene description before room description?

Hello everyone! I apologize if this has already been answered on the forums, but I didn’t find anything through the search function. Anyway, I’m currently working on my first IF game and I’m wondering: how do I get a scene description to appear before my room description? I’m using IF7.

I essentially want the scene to start by spitting a little text at the player right as they enter a room for the first time. However I keep having the description of the room you enter appear before that, making what I want to say in the scene’s text somewhat odd. The scene appears first and the room description needs to only pop up if the player types “look” or if they re-enter the room another time. Here’s what I have currently:

Would it just be easier to change the room description so that it says something different upon first entrance? If so, how exactly would you code that? Thanks in advance for reading! Any help is appreciated.

Surely so! I’ve been extensively using that in my WIP. It’s just something like:

Throne Room is east of Library. The description is "[if unvisited]After finally leaving the library...[otherwise]Large and cold..."

Which of course only makes sense if you are sure the first time you’re entering the throne room you are coming from the library.

That’s perfect! Thank you very much.

I’m sorry, that seems so simple now that I read it.

If you want some text to show up before the room heading, instead of putting it in the room description, you can try an “after going” rule like “After going east from the Library for the first time…” or “After going to the Throne Room for the first time…” (I haven’t checked either of those.) As rockersuke says, you don’t want to use the second one unless you’re sure that you’re going from the library.

I managed to hack up something ugly that seems to work with the scene-changing mechanism too. The deal seems to be that I7 only checks for scene changes at the beginning and end of the turn, so I wanted to delay going east until after the scene-changing machinery had run. That meant trapping the “going east” action when it’s going to trigger the scene change, using a flag to make that trigger the scene, and then making the player go east as part of the “when trapped begins” rules.

Trapped is a scene.
Trapped-cue is a truth-state that varies. Trapped-cue is false. Trapped-triggered is a truth-state that varies. Trapped-triggered is false.
Last check going when the room gone to is the Throne Room and trapped-triggered is false:
now trapped-cue is true;
now trapped-triggered is true;
rule succeeds.

Trapped begins when trapped-cue is true;
When Trapped begins:
say “After finally leaving the library you find yourself still unsure about the world you stumbled into. However, you’re ripped out of your thoughts as you’re greeted by piles of slumping bodies. They are strewn in various places throughout the large room you just entered: some are at tables with rotten food, others are immobile on the floor. You’re once again met with complete and heavy silence. What could have happened here?”;
now trapped-cue is false;
try going east.

Library is a room. The description is “The only thing to do is go east to the Throne room.”
Throne Room is east of Library. The description is “Large and cold, a feeling of loneliness sweeps over you. As you turn about you can see a large ornate chair against the southern wall facing the rest of the room. Sitting on it is a slumped figure with something hanging around his neck. It glitters in what little light can make it through the arched windows.”

The reserved book is in the Library.
Check going east when the location is the library and the Library encloses the book and the player does not enclose the book::
say “Not without the book you were supposed to get!” instead.

Every turn when the location is the Library: say “You hear a faint shushing sound.”
Every turn when the location is the Throne Room: say “You hear a faint flushing sound.”[/code][/spoiler]

I used a “last check going” rule to make sure that the check rules are properly respected – if you change it to an “instead of going” rule, then you can go east without the book. Somewhat to my surprise, the “every turn” rules do work properly, though I wouldn’t be surprised if this is breakable somehow. You probably also can check something like “if Trapped is happening or Trapped has happened” instead of using the trapped-triggered global.

(BTW, there are a couple typos; it should be “loneliness” and “ornate,” and you have a missing period which will mess up your line breaks as well as being missing.)

@matt w: Oh wow! First of all, thank you for catching my typos. I really need to be careful about that so I don’t run into problems later.

Second: This was a great example! I’m learning how to use IF7 primarily through Aaron Reed’s book, so I haven’t really seen this “cue” system before. I noticed this was appearing in a couple of other threads as well.

Thanks a lot! I’ll definitely keep this format in mind.

Well, there isn’t really a “cue” system per se; “trapped-cue” is just the name of something that could be set to true or false, which lets us use it to start the scene (with the line “Trapped begins when trapped-cue” is false). I could have called it anything else and it would work the same.

Also, I’ll bet Aaron’s book has something nicer about how to deal with scenes. I don’t really know much about them; I basically just tinkered until I got something that seemed to work.