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.
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.
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.
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.
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.
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.
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”?
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.