Compilation problems with 6L02

I’m sure there will be many people who come across unexpected compilation errors, so perhaps we can help each other out. I’m coming up against this. This used to be legal code:

Challenging it in is an action applying to one visible thing and one visible object.

But now it throws the following error:

You wrote 'Challenging it in is an action applying to one visible thing and one room': but an action can only apply to things or to kinds of value, for instance: 'photographing is an action applying to one visible thing'.

I have no idea what’s going on here, and what I should do to fix it. I needed “object” instead of “thing” because the second noun is supposed to be a room. But changing “object” to “room” doesn’t help, and I’m not sure what else to do.

I don’t think that’s true. This works for me:

Challenging it in is an action applying to two visible things. Understand "challenge [something] in [any room]" as challenging it in.

Okay, I think I fixed my own problem. You can just say “thing”, and it will also be allowed to apply to rooms. This is weird, because a room is not a thing. Here’s a sample game:

[code]“Game” by Author

The Church is a room. The player is here.

Decorating is an action applying to one thing.
Understand “decorate [any room]” as decorating.

Carry out decorating:
if the player is in the location:
say “You decorate [the noun].”;
now the printed name of the noun is “A maze of decorations”;
otherwise:
say “You have to get there first.”[/code]
Cross-posted with Juhana. Yes, it does seem to work. But I don’t understand why it works? Surely it shouldn’t?

Actions can only be defined as applying to objects or kinds of value. They cannot apply to subclasses of object.

The action declaration (necessarily) uses the word “thing” to mean “object” here. This may be for simplicity or just historical reasons.

OK. It used to also accept “object”, and I find it strange that the “thing” syntax is now mandatory even though the “object” syntax would be correct. But I can live with it. :slight_smile:

I managed to get Slouching running under GL02 with some changes. Here’s some of the issues I saw:

  • Rob Newcomb’s Default Messages no longer compiles, as “Section SR5/8/2 - Message support - Intervention - Unindexed” no longer exists in the Standard rules.

I’m presuming this is going to take a significant rewrite. The Example “We” in the documentation states:

…however, I’m not seeing any such extension?

  • Procedural rules obviously no longer work – need to change handling of supporter/container content listings.

  • “change the {object} to {value}”

Example: change the current menu to Table of Hints; no longer works - needed to be reformatted as “now the {object} is {value}”

  • “if {condition} then say ‘text’ instead” no longer worked in certain cases, replaced with “if {condition}, say ‘text’”:

Previously working:

Check pointing at: if Triage is not visible then say "Nothing happens." instead. Check pointing at: if Triage is visible and the emerald is not switched on then say "Nothing happens." instead.

Currently working:

Check pointing at: if Triage is not visible, say "Nothing happens." Check pointing at: if Triage is visible and the emerald is not switched on, say "Nothing happens."
  • “instead of doing anything other…” when setting up (in)valid actions for objects causes the code to be run every turn, needs to be replaced with “doing something…”

Previously working:

Instead of doing anything other than examining or searching or pointing at a person when the noun is dead, say "A difficult and futile task."

Currently working:

Instead of doing something other than examining or searching or pointing at to a person when the noun is dead, say "A difficult and futile task."
  • “[contents of the noun]” no longer works, list the contents of the noun, as a sentence, tersely, not listing concealed items; seems a valid replacement.

  • “response” is no longer a valid value name, as it’s being defined/used by Standard Rules (The Logos used to have a list of texts called the response.)

  • “instead of going nowhere while in {location}” used to work, replaced with “instead of going nowhere from {location}.”

After deciding the scope of the player while in the Circular Chamber:
[/code] previously worked, changed to [code]
After deciding the scope of the player when the location is the Circular Chamber:

These changes got the story (basically) running, but there are definite runtime issues, most particularly the dial for the pyramid/spider/file system.
Turning the dial to any symbol produces:

Glulxe fatal error: Stack overflow in function call.

I think the code in question is:

say "... revealing ['][the current input of the pedestal]['] imprinted on its surface.";

Since the current input is an indexed text and those have been modified, I’m presuming that’s the issue, but I haven’t gotten to look at it in detail.

-d-

That’s a great list. Here are some things I noticed.

** Starting a blank table – that gets filled up with continuation later in your source – with a row of (values) no longer works. You must change

power faculty1 faculty2 (a power) (a faculty) (a faculty)
to

power (a power) faculty1 (a faculty) faculty2 (a faculty) -- -- --

** Fixed Point Maths no longer compiles, but it also no longer needed. Plurality is no longer part of the install, but it also no longer needed.

** If you’re using the singing action, you need to reimplement it. This is of course very easy:

[code]Chapter - Singing

Singing is an action applying to nothing. Understand “sing” and “hum” as singing.

Carry out singing:
say “You hum a battle hymn.”.[/code]

** Inform used to allow stuff like this:

The blood magic cost of the gown of the red court is 4; The blood magic maximum of the gown of the red court is 5; The minimum blood timeout of the gown of the red court is 2; The maximum blood timeout of the gown of the red court is 8;
It now always requires full stops.

** In headings, “not for use with” needs to be replaced with “for use without”. So

Section - Defining perform syntax (not for use with Glimmr Canvas Animation by Erik Temple)

becomes

Section - Defining perform syntax (for use without Glimmr Canvas Animation by Erik Temple)

It seems that you can no longer negate kinds of action. The following used to work:

[code]“Attacklike” by Victor Gijsbers

The arena is a room. “You’re here to fight.” The player is here.

Attacking is attacklike behaviour.

Before attacklike behaviour:
say “That’s the spirit!”

Before not attacklike behaviour:
say “No, you’re here to FIGHT!”[/code]
But it no longer does. Here is the best workaround I’ve found so far (though it’s not very elegant, so maybe someone can improve it).

[code]“Attacklike” by Victor Gijsbers

The arena is a room. “You’re here to fight.” The player is here.

Attacking is attacklike behaviour.

To decide whether (deed - a stored action) is unattacklike:
if deed is attacklike behaviour, no;
yes.

Before attacklike behaviour:
say “That’s the spirit!”

Before doing anything:
if the current action is unattacklike:
say “No, you’re here to FIGHT!”[/code]

Library messages are now changed with a built-in mechanism so separate extensions are no longer needed for that. It seems that the example you’re quoting hasn’t been updated for the new system. For example:

The examine undescribed things rule response (A) is "[The noun] [are] unremarkable."

(Ch. 14.10-14.12 in the manual.)

[code]A stellar distance is a kind of value. 1.00 LY specifies a stellar distance.

Equation - Distances in three dimensions
d^2 = (x^2 + y^2 + z^2)
where d is a stellar distance, x is a stellar distance, y is a stellar distance, and z is a stellar distance.[/code]

This compiles under NI but the source translation fails. I may have misunderstood how equations work, of course, and I’d much prefer it if I could do the square root of (x² + y² + z²), but…

…anyway. The equation itself fails translation under z8 but compiles under Glulx. However, as soon as I add

[code]Use no deprecated features.

A stellar distance is a kind of value. 1.00 LY specifies a stellar distance.

Equation - Euclidean Distances in Three Dimensions
d^2 = (x^2 + y^2 + z^2)
where d is a stellar distance, x is a stellar distance, y is a stellar distance, and z is a stellar distance.

When play begins:
let x be 11.0 LY;
let y be 8.4 LY;
let z be 41 LY;
let d be given by Euclidian Distances in Three Dimensions;
say “[d]”.

There is a room.[/code]

I get a problem:

What am I doing wrong?

EDIT: Interesting. So apparently, the error seems to have been that I misspelled the call to the equation, yet the error suggested the wrong culprit. Is this a bug?

I’d report it as such on the Inform Mantis bug tracker, yes.

Ah. My bad. It appears the compiler objects when you write the LY definition as 1.00 and then want decimal fractions above that. Of course. Well, I found another bug and this seems legit, so that’s okay.

So you always have to write out all the trailing zeroes?

No, perhaps I should have said “decimal numbers” instead – this is a consequence of non-decimal fractions like we have in (for instance) the case of hours:minutes (which would be defined as something like “10:59”, I believe). Defined in this way, a time of 11:89 would be disallowed as it makes no sense to the compiler.

I see!

Oooh, I don’t like this.

I’ve filed it as a bug: http://inform7.com/mantis/view.php?id=1244

Perhaps its a removed feature, but it might just be a bug.

Let’s hope it is. Kinds of action already felt overly restrictive in 6G60. I make frequent use of them for their natural syntax, and I really wish they would be more flexible. In particular, I want to be able to write things on the form of

Addressing a commoner is vulgar behaviour.

or even

Jumping when the actor is infirm is courting a relapse. Attacking when the actor is infirm is courting a relapse. [...] Instead of the player courting a relapse, say "A tremor seizes your limbs, and you fall back onto the sheets, gasping."

Small note: apparently you can use roots, logs, and trig functions in equations now, so that’s not a concern.

Oh, you can? I tried, but couldn’t get it to compile. I’ll try some more once I get home.