[I7] Anthing to include at the very end of story code?

Every time I try to compile my story code, I get three problems (or perhaps the same problem three times) with the last item described in the code.

If I move the code for the last item elsewhere, I still get the error but in relation to the new ‘last item’ at the bottom of the code. The text that previously had the problem raises no issues.

I just added this to the end of my listing:

The carrot is scenery in MacGregor's garden.

and now I get the same error messages but relating to the carrot:

As with the previous occurrences, this is the very last thing written in my code. It seems the problem is to do with the position of the code (at the very end of my listing) rather than anything in the code itself.

Is there something I need to put after this to tell Inform it has reached the end of the code?

There’s nothing special that you need to include at the end of your code.

It’s possible that the problem is with something earlier in your code, such as a construct that’s never completed, and that this is only being detected when the compiler reaches the end of your program.

What’s the code just before the last item?

I got the same error message when trying to update Counterfeit Monkey to 6M62. I haven’t been able to determine what the real problem was.

I’ve bumped up against this before, and seem to have better luck with

The carrot is scenery.  It is in MacGregor's Garden.

Other than that, do a search and make sure you haven’t defined “carrot” as something elsewhere. I know it’s weird that you can move it. For that, check the code right before it for missing punctuation.

You know, I’d posted that very thing. Then I deleted it because I thought “no, it can’t be that simple and it wouldn’t account for the “end of the code” thing”.

I’m now very curious to see whether it makes a difference!

Perhaps right at the end the compiler is having problems applying the same verb “is” to two different modes of definition - it “is scenery” and “is in the garden.” Splitting them apart with their own verbs often seems to satisfy it. It might be a matter of weirdness that a vague definition causes the compiler to fail tying up other definitions neatly.

The compiler can only give so much advice (and it’s VERY improved since the earliest version of Inform I’ve used), quite often one missed punctuation mark or grammar error can cause a chain-reaction sequential train wreck with all of the following code. (Witness when one quotation mark is missing, it makes all of the following quoted text and code reverse quoted and not quoted, and correcting that one mark will fix 20 errors that follow.)

More specifically in this situation, this “is [two different things]” confusion with the compiler might just be the first one of these Inform is catching, and the compiler stops before it gets to others, which could explain why only the one at the end is seems to crash it.

Which is a handy hint - unless you know every error it gives you in a list is an actual error, try correcting just the first one and re-running so you don’t spend time goofing up your code where it doesn’t need fixing.

If all of that turns out to be true, it should definitely be reported.

We’ll have to have for the OP or Dannii (who reports similar issues) to confirm that, though.

One thing that’s going on here is that Inform is producing an error that’s meant to be spread across two sentences, while only pointing to one sentence. So if you write:

[code]Garden is a room.

The carrot is in the Garden.

The carrot is portable.

The carrot is fixed in place.[/code]

you get

as you’d expect.

If you contradict yourself in one sentence you the kind of error you got in the original post:

[code]Garden is a room.

The carrot is portable fixed in place in the Garden.[/code]

Of course, this doesn’t answer the question of why Inform thinks the sentence you have is contradicting itself three times.

I’ve always attributed it to the “trainwreck” thing I mentioned. I don’t think the compiler goes in code order, so it grabs all the adjectives and processes them…then new verbs (or whatever). That’s why you can clear one error and then be presented with a whole new set of errors that it didn’t mention before.

Are there any carrots in Counterfeit Monkey?

Maybe the compiler is trying to tell us it’s allergic to carrots. I think it’s crying out for help with its carrot allergy in the only way it can.

-Wade

You didn’t find the truncator-anagrammer in the shed with the tractor?

Thanks everyone for the suggestions so far.

I’ve replaced my code with HanonO’s suggestion above. Now “It is in MacGregor’s Garden.” is the problem.

[code]Problem. You wrote ‘It is in MacGregor’s Garden’ : but this looks like a contradiction, because the same property seems to be being set in each of these sentences, but with a different outcome.

Problem. You wrote ‘It is in MacGregor’s Garden’ : again, this looks like a contradiction.

Problem. You wrote ‘It is in MacGregor’s Garden’ : again, this looks like a contradiction.[/code]

There are no other carrots or root vegetables in the game (though it may contain traces of nuts).

As far as I can tell, this was caused by people carrying scenery elsewhere in the code.

Seems right. This gives us the same error message:

[code]Garden is a room.

The rock is scenery. The player carries the rock.

The carrot is portable scenery in the Garden.
[/code]

Now that we’ve got a small test case, I’ve reported it as a confusing error message.

So Badger, it looks like you should go through to find out what you’re declaring to be carried by the player, and see if you’ve accidentally declared a scenery item to be carried by the player. Keep in mind that the compiler can get confused when you try to create something whose name is part of another thing’s name; if you write

Garden is a room. The player carries a carrot cake. The carrot is scenery.

then Inform thinks “the carrot” is an abbreviated way of referring to the carrot cake, and will throw an error.

Thanks matt and everyone. It seems to be working.

I found some portable items I’d described as scenery. I changed them to ‘undescribed’ and now the error is only coming up twice instead of three times.

I think I fixed all the scenery issues (I searched for ‘scenery’ and reviewed every instance) but I’ll have a second look on the weekend.

Check for “fixed in place” also.

I’ve made more progress but I’m now getting another error, this time for any items that have an initial description in addition to their normal description:

The old map is an object. "An old map sits on the bench next to the trowel." The printed name of the old map is "Davey Jone's treaure map". Understand "old/ancient/brittle/map/parchment" as the old map. The old map has the description "An ancient and tattered parchment, brittle at the fold lines."

When I try to compile the source, I get two error messages:

When I comment out the initial description -

The old map is an object.  ["An old map sits on the bench next to the trowel."]
  • the compiler then reports the same error with the next item it finds with an initial description.

Have I worded the descriptions in the wrong way? Is that what Inform means by “the same property seems to be being set in each of these sentences”?

I don’t think “object” is a synonym for “thing”.

Try putting another period outside the quotes, or double spacing.

[code]The old map is a thing. “An old map sits on the bench next to the trowel.”.

The printed name of the old map is “Davey Jone’s treasure map”.

Understand “old/ancient/brittle/map/parchment” as the old map.

The description of old map is “An ancient and tattered parchment, brittle at the fold lines.”[/code]

You can also put all this together in one paragraph for neatness:

An old map is on a park bench.  "An old map sits on the park bench.".  The printed name is "Davey Jones' treasure map".  The description is "An ancient and tattered parchment, brittle at the fold lines.".  Understand "ancient/brittle/tattered/parchment/Davey/Jones" and "fold lines" and "treasure map" as old map. 

Thanks HanonO.

I implemented both changes but I still get the same error messages.