ArgggHHHH!!!!

My program is doing something it hasn’t before: It somehow is receiving an instruction during the “start of play” section that prints the description of the first room and immediately moves the player to the next room and prints its description.
Since this is at the start of play, I can’t turn on Actions or Rules, can I?

Turn on rules and restart the game.

Sounds like you have an “Every turn” rule that is firing prematurely.

OK, don’t recompile, just type “rules” and then type "restart’, right?
If that is the case, it didn’t work.

Sorry, thought that would work. Do a search for “now the player is in” and see what you got that’s firing on the first turn.

I’ve done that. Too bad there’s too much relevant code, else I would put it in a message. This has really got me stumped!

Figured it out: it has to do with the grave and the cemetery being in scope with each other. Player is not being magically transported from grave to cemetery at start of play, he’s just able to see the cemetery from the bottom of the grave. All I gotta do now is to figure how to suppress the view when the player is in the grave.
Should be a piece of shortbread.

Seems like all you have to do is not put the cemetery in scope from the grave–you can make it go one way and not the other.

How do I do that?
This is the best I could come up with:

After deciding the scope of the player:
if the player is in Cemetery, place Bottom of the Grave in scope;
otherwise:
if player is in Bottom of the Grave:
continue the action.

But it gives the message:

Problem. The phrase or rule definition ‘After deciding the scope of the player’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘otherwise’ , in case that helps.

Your first if uses a comma instead of using a colon-linebreak-indent.

So I changed the code according to lux’s suggestion to:

After deciding the scope of the player:
if the player is in Cemetery:
place Bottom of the Grave in scope;
otherwise:
if player is in Bottom of the Grave:
continue the action.

And wind up with the same problem: the cemetery is still in scope from the grave and gets described at the start of the game.
How do I place the cemetery out of scope from the grave? How can I make the scope go one way and not the other at matt w said? I’ve tried everything I can think of.

It’s almost impossible for us to diagnose the problems with your code when (a) you only post tiny snippets of it and (b) you neglect to use the Code button at the top of the posting window. If you use that button after selecting your code, at least we’ll be able to see your indentation, which might conceivably help.

I can promise you that setting up one-way scoping is very simple. Here is a basic example game that operates in the way I think you’re trying to achieve:

[code]The Ledge is a room. “Standing here on the ledge, you can see down into the ravine.”

The weeping willow is fixed in place in the Ledge. “A willow is weeping here.” The description of the willow is “It looks very sad.”

The Ravine is down from the Ledge. “A narrow, rubble-choked ravine. You could probably clamber back up to the ledge.”

The rubble is scenery in the Ravine. “Sharp-edged rocky boulders.”

After deciding the scope of the player:
if the player is in the Ledge:
place the Ravine in scope;
otherwise:
continue the action.

Test me with “d / x willow / x rubble / u / x rubble”[/code]
If you copy this into a new, empty game, compile it, and enter TEST ME, you’ll see that the result is very straightforward: You can see what’s in the ravine from up on the ledge, but you can’t see what’s up on the ledge when you’re down in the ravine.

If you’re having trouble doing this in your game, it’s because your code has gotten tangled up somehow. Computer programming is all about being patient and thinking in step-by-step logic. The way to disentangle your code is to take one tiny step at a time. We can’t tell you exactly which steps to take or in what order, because we don’t have your code to look at.

You don’t even need the “continue the action” phrase. “After deciding the scope of the player” rules don’t cut anything off when they run. That’s because “deciding the scope of the player” is an activity, not an action, and activity rules don’t have the same rulebook structure–they just have “Before…”, “For…”, and “After…”–and the idea is that all the “Before” and “after” rules run and the most specific “For” rules run. But in the case of deciding the scope, you don’t want to mess with the “For” rules–an “after” rule is all you need.

(Also the phrase for activities would be “continue the activity.”)

So you could just write:

After deciding the scope of the player: if the player is in the Cemetery, place the Bottom of the Grave in scope.

Or even:

After deciding the scope of the player in the Cemetery: place the Bottom of the Grave in scope.

Thanks for the replies. Sometimes the code button doesn’t show up, so I can’t use it. Don’t know why, just doesn’t.

matt w:
I tried your code, but Inform wouldn’t accept it.

I oot the message:

Problem. You wrote ‘After deciding the scope of the player in the Cemetery’ , but the description of the thing(s) to which the rule applies (‘the player in the Cemetery’) did not make sense. This is an object based rulebook, so that should have described an object.

Jim Aiken:

Your code does the same thing my old code did, which was to print both room descriptions at the start of the game. It’s looking like there is no way to suppress the cemetery description, so I may just rewrite the description slightly and move on.
Thanks to all who replied.

Perhaps I should change the name of this thread to “Double ArgggHHHH!!!”

I eliminated the “scope” code and still get the same result: two room descriptions printed at the start of the game. Guess I’m spending the rest of the day combing through my code.

I’m sending this out of desperation. I can’t find anything here that would trigger two room descriptions at once.

[code]Part 1 Rooms

A room can be either visited or unvisited.

Chapter 1 Graveyard

Graveyard is a region.

Bottom of the Grave, Cemetery, Path, Outside of the Shed and Inside of the Shed are in Graveyard.

Section 1 Bottom of the Grave

Bottom of the Grave is a room. It is below Cemetery. There is an open unopenable door between Bottom of the Grave and Cemetery.

The swing is a thing in Cemetery.

The description of Bottom of the Grave is “You come to at the bottom of what appears to be a 6[’]x4[’]x9[’] pit. OMG, it’s a grave! Your so-called ‘buddies’ must have played some kind of dirty trick on you, like liquoring you up and kidnapping you, and here you are! You’re this Hallowe’en’s goat!
You look around you and see only four bare, steep walls. You look straight up and see a tire attached to a tree limb by a rope. You wonder why whoever dug the grave didn’t cut down the rope swing first. But that’s not your biggest problem right now.”

Instead of going up when player is in Bottom of the Grave: say “The grave is too deep for you to reach the edge with your hands. You’ll have to think of something else.”

Instead of jumping while player is in Bottom of the Grave:
say “You jump as hard as you can and grab the inner rim of the tire. You kick your heels in the air and gain enough momentum to swing yourself over solid ground.”;
now player is in Cemetery.

Understand “grave” as Bottom of the Grave.

Understand “grab swing/grab tire/grab tire swing” as jumping.

Section 2 Graveyard proper

Cemetery is a room. It is east of Path, and south of Outside of the Shed.

Path is a room. It is west of Cemetery and south of Steps.

The description of Cemetery is “You’re in the middle of a graveyard, standing next to a newly-dug grave which is right under a tree limb with a rope swing attached to it. There’s a shed to the north and a path to the west that appears to lead in the direction of Dr. Frankenstein’s old, creepy house. The only other thing you see is a 12-foot fence with barbed wire on top which appears to completely surround the property.”[/code]

And here’s a weird thing I discovered just now: I can move from the grave to the cemetery, and get the double room descriptions (only reversed, with the cemetery description first and the grave second), despite the fact that I have taken all “scope” references out of the code: it’s still acting as if those references were still in there.

That segment of code isn’t the problem. I copy and pasted it into a blank Inform project file and it printed only the Bottom of the Grave description.

How much exactly did you cut and paste?

The entire thing that you posted.