Kind of Value Issue

I’m encountering a weird problem, and could use some advice. I apologize for not being able to list more details than provided here- i’m writing this from work and don’t currently have access to my project, but i’ll do my best to give enough context!

While compiling some new code, I suddenly sprang a compiler error from some code which had previously worked fine.

The source of the problem was listed as:

Heat is a kind of value. The heats are whole, damp, and flaming. A thing has a heat. A thing is usually whole.

A thing has a number called endurance. The endurance of a thing is usually 5. A thing has a number called turns of burning. A thing can be flammable or flame-retardant.

(cribbed from example 401 “In Fire or in Flood,” from the recipe book)

I don’t remember the specific wording, but the gist was that “A thing has a number called turns of burning” was invalid because ‘only objects/etc can have conditions or values associated with them.’ The “turns of burning” statement was the only one mentioned (for whatever reason).

After rolling back my new code, I found that the project compiled like usual. I did some experimenting, and found the following:

Any attempt to create a new kind of value BELOW this text would throw up that same error. Any attempt to create a new kind of value ABOVE the text would compile.

For reference, my wording was formatted like so:

size is a kind of value. The sizes are small, medium, and large.

…with a few different names and definitions tested for good measure. I also tested defining a value using a table as opposed to an x,y,z list, with the same result.

I double-checked my existing kind-of-value definitions (all previously listed above the text), and moving them below it triggered the error too.

I’m really not sure how to approach this one…

Anybody have any insight…?

Move the definitions to where they work? Seems like an obvious approach.

It looks like your example boils down to this, which throws that error:

The Kitchen is a room.
A thing has a number called turns of burning.
Heat is a kind of value. The heats are whole, damp, and flaming. 

I’m not sure why this doesn’t work. It may be confusion around the word “of”. If you change this to

The Kitchen is a room.
A thing has a number called burning-turns.
Heat is a kind of value. The heats are whole, damp, and flaming. 

…then it seems to be fine.

1 Like

I’m sure relocating everything would work- like I mentioned in my post, it compiles fine when placed above.

That being said, I’m learning this system by trial and error. Even if I find a work around, if I don’t understand why it works or what even went wrong, then I haven’t learned anything, you know?

In IF, learning that you can get it to compile and then move on to the next part of your game counts as learning. :)

4 Likes