Making a "playable" prologue -- huge error

So, I know you can make a “Prologue” that shows up before the banner text – the Recipe Book goes over it in 11.1 – but getting it to work isn’t working out so well.

Essentially, I want the player to wake up in a one-off room, get a bit of flavor text, >look (or >stand up), which triggers more flavor text, and then finally triggers the banner, before finally transporting the player into the starting room.

But, for some reason, Inform doesn’t like that I’ve formulated the rule as: After looking: say "flavor text.[banner text]" And it immediately bypasses the thing that catches errors and overflows Glux, totally skipping the >look command and just saying the text outright, from what I can tell before the thing is just flooded with info. I even commented the rule for pausing the banner text until then, just to make it work that far.

And that’s after trying to formulate the statement numerous, longer ways that make more sense. For whatever reason, Inform just… doesn’t seem to understand that I want it to wait until a player enters a certain command before giving the text.

So… I don’t know what to do. I’ve tried looking through the manual, but the amount of stuff I can look up on how to formulate this sort of rule with commands, to me at least, seems limited. Anyone willing to help? Should I try posting some code?

First of all, you just want:

say "[banner text]"

to display it.

To delay the banner for something more than just a prologue text, you need to specify a “printing the banner text” rule.

[code]
b-text is a truth state that varies. [default is “false”]

Rule for printing the banner text when b-text is false:
do nothing.

Instead of jumping:
now b-text is true;
say “[banner text]”[/code]

After looking: say "flavor text.[banner text]"

There’s nothing wrong with this line of code; the problem must be elsewhere. Have you written a “rule for printing the banner text” that might be interfering?

If you post all the relevant code we might be able to spot the problem.

Do you have a “printing the banner text” activity rule which does a “try looking”?

Or maybe something like this?

Rule for printing the banner text: say "[banner text]".

This would be bad.

I’m not exactly sure, but it seems as though your game is compiling and running, but then you get your text without waiting for a command, and that in turn gives you a Glulx overflow error?

The reason it’s not waiting for a command is because every game starts with a “looking” action. That’s what prints the initial room description. So if you have a rule that’s hooked on to the looking action, it will automatically run at the start of the game. If you want to delay the text until the player types “look,” then you could try hooking your rule to looking for the second time:

[code]Starting location is a room. “This is the starting location.”

After looking for the second time: say “Text for an active look command goes here.”
[/code]

On the other hand, if you want to suppress the initial looking action and make the player type “look,” you could remove the rule that generates that initial looking action and prompt the player to “look” instead:

[code]Starting location is a room. “This is the starting location.”

The initial room description rule is not listed in the startup rulebook.

When play begins: say “You wake groggily and get the idea you should LOOK around before doing anything.”

Before looking for the first time: say “Text for an active look command goes here.”[/code]

As far as the Glulx overflow error goes, the other folks are right that it’s probably an infinite loop, and posting some code would help.

Okay – there’s already some good suggestions in here, but I’ll just post the code, and maybe we can figure out the loop issue.

[rant]“Feather Light Map” by A Trizbort User

There is a room called You Wake Up. “You come to suddenly, on something too hard to be a bed. (…)When it does, you see that you’re in your room, by the looks of it. But, why are you on the floor…?”

After looking: say “You look up. (…)reflected in the mirror.[banner text]”; move the player to the Messy Bedroom.

[Rule for printing the banner text if the player has not entered a command: do nothing.]

There is a room called Messy Bedroom.[/rant]

Okay – cut down on some of the text in between to make it shorter. There was some italics in there, but nothing I think that should cause this level of problems. As you can see, I commented the rule for the banner text so it wouldn’t activate.

There’s almost certainly a more elegant way to do this, but you can just set a variable that turns the banner text off at the beginning, then turns it back on after the first LOOK command.

[code]“Feather Light Map” by A Trizbort User

awaken is a number that varies. awaken is 0.

Rule for printing the banner text when awaken is 0: do nothing.

There is a room called You Wake Up. “You come to suddenly, on something too hard to be a bed. (…)When it does, you see that you’re in your room, by the looks of it. But, why are you on the floor…?”

After looking in You Wake Up:
now awaken is 1.

Before looking for the second time:
say “You look up. (…)reflected in the mirror.[paragraph break][banner text]”;
move the player to the Messy Bedroom;
stop the action.

There is a room called Messy Bedroom.[/code]

“move the player to R” causes an implicit look action. That’s the cause of the infinite loop.

There are many ways to handle this. A scene is reasonably tidy:

Waking-up is a scene.
Waking-up begins when play begins.

Waking-up ends when looking.

When waking-up ends:
	say "End of initial scene.[paragraph break]";
	say banner text;
	move the player to the Messy Bedroom.

The Messy Bedroom is a room. "The bedroom."

And a rule for “After looking:” will run every single time types “look.” Or, as zarf points out, every time they move to another room. So you wouldn’t want that to happen even if it didn’t cause a loop.

(You could fix the loop by writing “move the player to the Messy Bedroom, without printing a room description” (I think)–that removes the looking action–but you have to adopt one of the other solutions anyway.)

One thing to keep in mind is that an “After” rule runs every time the relevant action is performed (as long as it doesn’t get interrupted by a check, instead, or before rule). So if you want a one-time effect you something more than a plain “After looking” rule.

Okay guys, thanks for all the help! I got the beginning of the game up and running, and things are going well.