[I7] Corrupted projects [Resolved]

I have my source text up to 6318 words, and it’s happened again. After adding a new block which should have worked, but instead mysteriously produced errors and unexpected effects, the game is now ignoring text which previously worked [and hasn’t been edited, and has nothing in common with the new block other than that they both reside in my project].

This time, all my “check [verbing] the player:” entries stopped working, although “check attacking yourself:” does. I haven’t set any new rules for defining the player or yourself or whatnot. The grammar “the player” seems to have spontaneously ripped itself out of the program about 20 minutes ago – except it still works in If statements!

Last time something like this happened, everything threw an error. Everything. I deleted all recent additions and changes, then the old stuff refused to compile as anything other than a massive collection of errors. I plucked out section after section of Source that, only moments previously, compiled happily. Nothing. I closed the project, and it saved without confirmation. I lost three days.

Excuse me if I come off as a little irritated: what the hell is going on?!

Without seeing an example, the most likely explanation is that you added something that makes the rest of the code refer to the wrong thing – perhaps inadvertently created an object that has the word “player” in it.

It would help if you could show the new block you added, and also the error messages you get (the first one should be enough).

There was a previous thread where someone had a similar problem, and it turned out that they had omitted a period at the end of a line with “the player” in it. So you might want to check your punctuation. Certainly, you should search for every instance of “player” in your new block of code and check the punctuation, spelling, etc. carefully.

Thank you. You people are amazing.

I found the offending block. I’m still very curious about the earlier error that cost me three days [everything gave an error – it was like I’d deleted a vital chunk of the Standard Rules or something], but at least it made me keep a paranoid amount of back-ups of my project.

If anyone’s curious, this was it [and of course it’s not the block I which thought was the culprit at all]. The error’s at the bottom.

Instead of going to The Ruined Stairway the second time: say "A whole ton of omitted dialogue goes here. Thanks again folks!"; Now the wreckage of the stairs is in the antechamber; Remove the stairway from play; The Side Hurts in three turns from now; Move the player to the Antechamber, without printing a room description. [FULL-STOP: ERROR] Now the player is on the wreckage of the stairs.

I don’t know why I wasn’t given at least two error messages about this, but it was easy to find when I knew to look for a thing that shouldn’t exist [“Now the player” was the thing].

I’m wondering why I wasn’t offered a confirmation dialog when I exited. I’ve used Close Project and the upper right Windows “X” button, and when these major code-breaking events occur, they’ve both saved automatically.

[I’ve since fixed the Postures extension room description problem also. If anyone finds this code through a search, “Move the player to the wreckage of the stairs, without printing a room description.” will still put the player ON the posture-supporting wreckage.]

The project is saved when you compile the code. I7 didn’t save the code when you exited but when you tried to compile it.

Oh. Well, that’s scary, but I can work with it. Thanks yet again.

I was reading this and am glad you were able to back up your code relatively easily. I have made a case of just backing up my code whenever I want to try something new, so that I don’t delete anything crazy.

Also, if I do get an error I don’t understand, and I have backup code, I can easily find the difference in the code so I can post it here to ask questions.

Here, though,I think I see what is wrong with the code.

Move the player to the Antechamber, without printing a room description. [FULL-STOP: ERROR] Now the player is on the wreckage of the stairs.

you should probably have a semicolon after the first line. I know that Inform tends to give very good and detailed error messages about actual syntax where it can suggest what you actually wanted to do, but I remember being very confused by this sort of less-clear error where I had forgotten a semicolon. It happened often enough, though, that eventually I figured it out. it is obviously easy just to add on one airline of code after you have already used to, and when that spawns this sort of error, it’s confusing at the start.

in fact, I think Inform would have said something much more helpful if you had forgotten the period at the end. I tend to avoid using periods at the end of a code block at all because I think I have been stung by this a few times.

I’ve gotten some other seemingly cryptic errors that make sense once I see why they’re there. One of the most common ones for me is when I forget to end with a quote and I get several weird errors–I suppose this happens in any language where commenting or quotes go awry. It would be useful to have a database of stuff that new people mess, but the problem is, after a bit, you get used to it and you remember what a certain air message really means.

Given that Inform is a lot more descriptive and helpful in its error messages than a lot of other languages I have messed around with, my instinct is just to say, well, you take the good with the bad. And there is a lot of good. But obviously, this sort of thing happening even once is not fun for newer programmers, and having some list of error messages that could be tweaked would be a help. Or having it more accessible.

It’s very hard to determine that “now the player is on the wreckage of the stairs” is an error because it follows the perfectly legal “[object name] is on [supporter]” form.

In theory I7 could reject any line that tries to create an object with the word “player” in it. It will almost always cause problems because any subsequent mentions of “the player” will now refer to this new object, not the player variable defined in the standard rules. On the other hand it is not beyond reason that someone would want to remove the player variable from the standard rules and redefine it, so I’m not sure if specail-casing that word would be wise.

(On the third hand, problem would be solved if I7 would always pick the object or variable that’s a perfect match to the wording used to refer to it. That is, if you have an “apple” and an “apple tree”, using the word “apple” would always refer to the apple and not the tree because the word matches exactly the object’s name.)

Thanks for the tip on not using full stops aschultz, I’ll see if I can pick that habit up.

I’m fine with having the option to make an object called “now the player,” the only problem is that it broke previously defined grammar. Some sort of confirmation dialog from Inform on new definitions would save this newbie a lot of time, but perfect matching wordings might save me more.

Rejecting anything containing the word “player” would be a fairly half-assed solution. The library has several single-word variables which can be confused by this sort of construction. (“player”, “location”, “score”, “noun”.)

I7 doesn’t really have a mechanism for warnings or confirmation prompts – perhaps unfortunate, but I don’t see a way to stick them in. (If you hit a false warning, you’re going to see it for the rest of the project’s development – in which case you stop reading warnings – or you need a way to suppress it, which is further complication and probably means you stop reading warnings.)

Exact-word matching should be the correct solution (as far as I can tell, outside the development process). This is filed as bug 956.