"That would be like saying Laurel is Hardy" error

I had to replace my laptop last week and as part of setting it up, I installed a fresh version of I7 from the website. Now my code is showing an ‘X is Y’ error and won’t compile. (Perhaps because of changes in the updated Inform release?).

John is an NPC who has two states: he is either ‘seeking wine’ or ‘dormant’. I7 no longer likes this.

At the time when level 2 begins:
	if level 2 timer cancelled is true, stop;
	now all things enclosed by the player are nowhere;
	now John is seeking wine. [StartDaemon(John);]
There is a man called John.
John has a number called turns active.
John can be seeking wine or dormant. John is dormant.

Every turn when John is seeking wine:
	now turns active of John is turns active of John + 1;
	if turns active of John is:
		-- 1: say "John enters, picks up a discarded bottle, and leaves.";
(etc)

Error messages:

I am sure it is just a matter of restating the X or Y states somehow, but I can’t work it out.

Do you have an action called “seeking” defined in your code?

Otherwise this works for me in 6L38, the most recent version I have on hand.

6M62 also.

In fact it compiles correctly if a “seeking” action is defined, or if a “wine” object is defined. If you define both, then the compiler throws a “two things are the same” error.

‘Seeking’ is not defined in any way.

The wine is an object, though looking back it is defined as ‘the wine bottle’ (…is an edible thing in the Wine bar, etc).

I replaced all references to ‘seeking wine’ - of which there were only three or four - with ‘seeking the wine bottle’. This gives me the same two error messages, plus

As I mentioned at the top, I’m positive the game ran before I swapped machines.

It’s usually best to use entirely distinct words or phrases when creating new properties, to avoid ambiguity.

For example, rather than saying seeking wine or dormant you might use wine-seeking or dormant (note the hyphen, it’s important) – or perhaps even something more generic such as active; this is especially useful if you have multiple NPCs in your story that you might want to set to be active, but are each seeking different things.

I’ve tried it with ‘wine-seeking’ but am still getting the errors - though the error for wine-seeking or dormant states is now the same:

It makes me think I have changed something else that has mucked things up in another way, that in turn has a knock-on effect here. But honestly my memory is of the code working, me changing laptops and installing a fresh version of I7 and it not working.

That’s not to say it’s I7 causing the problem, but it doesn’t seem like I have picked up an earlier version of script.ni, or that the file has been corrupted somehow (it certainly opens in the IDE okay), etc.

Perhaps I need to advertise for an Inform Whisperer or a licenced Inform Wrangler to look through what I laughingly call my code…

Sometimes it does only take one incorrect phrase somewhere in the script to throw Inform completely for a loop.

In this particular case, it sounds like what has it upset is that now John is wine-seeking is written somewhere outside of all rules – that particular phrasing is only valid within a rule, since it alters the current state at runtime rather than describing the initial state of the world.

Often this can happen due to a misplaced period instead of a semi-colon, or poor indentation.

I’m happy to help you look through it, if you like. Send me a message with the details if you’d rather not share it publicly.

Thanks Gavin, that would be much appreciated.

I’ll send a message soon.

If you’re most familiar with I6 or other procedural-style languages, you might find this a useful read.

It’s written for an older version of the compiler and library, so there are a few aspects that are different now (or can be done in better ways), but it’s still a good reference in conjunction with the more up-to-date manuals.

This problem is now sorted thanks to Gavin.

The “now John is wine-seeking” followed on from another instruction before it, but I’d inserted some comments - and some blank lines around the comments to make them stand out - and it was the blank lines that were causing the issue.

This didn’t work:

.
.
now the player is in the Wine bar;

now John is wine-seeking.

…but this does:

.
.
now the player is in the Wine bar;
now John is wine-seeking.

Thanks Gavin & everyone who responded.

2 Likes