Please Help me get my exercise up and running

I’m so sorry to keep asking stupid questions, but I’m really struggling with this. I need to change the temperature of the water to boiling so I can only make tea with boiling (instead of warm, cool, cold, etc) water. Here is what I have:

Check putting the teapot on the brazier:
if the teapot is empty, say “There is no point putting an empty teapot on the stove.” instead;
if the heat of the water in the noun is boiling, say “the water has already boiled.”

I get the error message:
Sometimes this mistake is made because Inform mostly doesn’t understand the English language habit of referring to something indefinite by a common noun - for instance, writing ‘change the carrying capacity of the container to 10’ throws Inform because it doesn’t understand that ‘the container’ means one which has been discussed recently.

I think there is this error because I haven’t worked out how to change the temperature of the water, and have commented it out. Here is the error message I get for the following code.

Every turn:
if the teapot is on the brazier:
now the heat of the teapot is the heat after the heat of the teapot;
the heat of the water in the teapot is the heat after the heat of the water in the teapot.

Problem. You wrote ‘the heat of the water in the teapot is the heat after the heat of the water in the teapot’ : but this is a phrase which I don’t recognise, possibly because it is one you meant to define but never got round to, or because the wording is wrong (see the Phrasebook section of the Index to check). Alternatively, it may be that the text immediately previous to this was a definition whose ending, normally a full stop, is missing?

Thanks in advance! I’ve been looking at others’ code, but can’t quite work out what’s wrong with mine. :frowning:

In the second example, Inform seems to be complaining that you have not defined “the heat of the teapot” properly. Have you included in the code a list of the different temperatures for the teapot? Like:

The teapot has a temperature. The temperature of the teapot can be cold, lukewarm, hot, boiling. The temperature of the teapot is usually cold. (Haven’t tested this, but you get the idea, right?)

By the way, unless you’ve already written up a lot of code using the term “heat,” I respectfully suggest you use the word “temperature” instead, because it is more precise. “Heat” is both a noun and a verb, and text games rarely cope well with words like that.

I already have the following Merlin. You’re probably right Merlin, but since I don’t use the term heat as a verb in this exercise it’s okay, isn’t it?

Heat is a kind of value. The heats are cold, cool, warm, hot, and boiling. Everything has a heat. The heat of a thing is usually cool. The heat of the brazier is hot.

I have tried changing the way I put this in order for it to work to this:
Heat is a kind of value. The heats are cold, cool, warm, hot, and boiling. Everything has a heat. The heat of a thing is usually cool. The heat of the brazier is hot. The heat of the teapot is cool. The heat of the liquid of the noun is the heat of the noun.

But I get the error:
Problem. You wrote ‘The heat of the liquid of the noun is the heat of the noun’ : but this seems to say two different properties are not simply equal but somehow the same thing, like saying that ‘the printed name of the millpond is the printed name of the village pond’. This puts me in a quandary: which should be changed to match the other, and what if I am unable to work out the value of either one?

Seems like I’m getting closer - any suggestions?

You want to use a “decide” statement to determine the heat of the liquid:

To decide what heat is the heat of the liquid of (C - a container): decide on the heat of C.

Thanks so much. That didn’t quite work, but when I tried:
To decide what heat is the heat of the liquid of the noun:
decide on the heat of the noun.

It did. Wicked, I’ve never seen to decide as a command before, obviously perfect. Thanks.

The reason you’re getting this error is because you haven’t actually defined what the liquid of the noun (is this case, the teapot) actually is.

The reason you’re getting this error is because you’re referring to the heat of the liquid in the teapot when the teapot isn’t defined as a container, which is why katz’s solution didn’t work straight off.

Try this.

[code]“Test”

Heat is a kind of value. The heats are cold, cool, warm, hot, and boiling. Everything has a heat. The heat of a thing is usually cool. The heat of the water is cold.

Every turn:
if the teapot is on the stove and the water is in the teapot, now the heat of the water is the heat after the heat of the water.

Rule for printing the name of the water:
say “some [the heat of the water] water”.

The Testing Room is A Room. The stove is a supporter in the testing room. The teapot is in the testing room. Some water is in the teapot.

Test me with “put teapot on stove / l / l / l”.[/code]

It’s best to deal the heat of the water rather than the heat of the teapot.

Hope this helps.

Indeed. I’ll go back and make the required changes.

I’m almost at the endgame now. Please help. I need help with a new verb. I used the raygun example from the documentation (shooting with) as my guide:

[i]Whipping is with is an action applying to two things.

Check whipping something with something:
if the player is not carrying the whisk, say “You aren’t carrying the whisk.” instead;
if the second noun is not the whisk, say “Only the whisk can whip things.” instead;
if the noun is the whisk, say “How…what…that makes no sense.” instead;
if the noun is the player, say “You prefer to inflict pain on others.” instead
if the noun is not the cup, say “You can only whip the cup.”; instead;
if the green powder is not in the cup, say “You need to add the powdered tea first.”.

Definition: a thing is notwhisk if it is not the whisk.

Understand “whip [something notwhisk] with [whisk]” as whipping it with.
Understand “whip [something] with [something]” as whipping it with.

Carry out whipping something with something:
move the frothycup to the holder of the cup;
remove the cup from play;
remove the green powder from play;
say “You whip the tea to a fine froth.”.

The frothycup is a thing. The description of the frothycup is “A cup of tea.”[/i]

I would prefer that, in the case of the second noun not being mentioned that the whisk is assumed, but I’m not sure how to do that, and this doesn’t work - instead giving me the error message:

[b]Problem. You wrote ‘Carry out whipping something with something say “You whip the tea to a fine froth.”’ : but I can’t find a verb that I know how to deal with, so can’t do anything with this sentence. It looks as if it might be a rule definition, but if so then it is lacking the necessary colon (or comma). The punctuation style for rules is ‘Rule conditions: do this; do that; do some more.’ Perhaps you used a full stop instead of the colon?

See the manual: 18.3 > New rules


Problem. You wrote ‘remove the green powder from play’ : but I can’t find a verb here that I know how to deal with, so I am ignoring this sentence altogether.[/b]

Are you copying and pasting your source text from the Inform window into the browser? That’ll make it easier to check. In the error message text it says ‘Carry out whipping something with something say “You whip the tea to a fine froth.”’, with no colon, but in the source text you give there’s a colon in the second “something”; are you sure the colon’s in the right place in your source text?

Also, you’ve written “whipping is with is an action applying to two things”; the first “is” should be “it.”

[i]
I just commented out my Whipping section to see if this worked. It didn’t, and I think that might be because I’ve made liquid a value rather than a noun. Here is my code:

A volume is a kind of value. 1 scoop (singular) specifies a volume. 2 scoops (plural) specifies a volume.

A fluid container is a kind of container. A fluid container has a volume called a fluid capacity. A fluid container has a volume called current volume.

The fluid capacity of a fluid container is usually 1 scoop. The current volume of a fluid container is usually 0 scoops.

Liquid is a kind of value. The liquids are water, boiling water, and tea. A fluid container has a liquid.

After examining a fluid container:
if the noun is empty,
say “You catch just a hint of [the liquid of the noun] at the bottom.”;
otherwise
say “[The noun] contains [current volume of the noun] of [liquid of the noun].”

Before printing the name of a fluid container (called the target) while not drinking:
if the target is empty:
say "empty ";
otherwise:
do nothing.

After printing the name of a fluid container (called the target) while not examining:
unless the target is empty:
say " of [liquid of the target]";
omit contents in listing. [/i]

And here is my heat section:

Part 2 - Heat

Heat is a kind of value. The heats are cold, cool, warm, hot, and boiling. Everything has a heat. The heat of a thing is usually cool. The heat of the brazier is hot. The heat of the teapot is cold.

Every turn when the turn count is odd:
if the teapot is on the brazier and the water is in the teapot:
now the heat of the water is the heat after the heat of the water.

Every turn:
if the heat of the water is boiling:
say “Steam rises from the teapot and the water bubbles.”;

Instead of touching something when the heat of the noun is boiling:
say “You would burn yourself.”

Instead of touching something when the heat of the noun is hot:
say “You would burn yourself.”

Instead of touching the teapot, say “It feels rough and [the heat of the noun] under your fingers.”

Instead of inserting something into the cup:
if the noun is not the green powder, say “The cup is for making tea.”

Instead of pouring something into the cup:
if the heat of the noun is not boiling, say “The water needs to be much hotter to make tea.”

Instead of touching the cup:
if the noun is empty:
say “You run your fingers over the surface, feeling each crack.”;
otherwise:
say “warm beneath your fingers.”.

Two things I noticed.

  1. Should be “Whipping it with is an action applying to two things.” not “Whipping is with is an action applying to two things.”.

  2. The phrase “if the noun is the player, say “You prefer to inflict pain on others.” instead” should have a colon at the end.

Hope this helps.

Do you have a pouring it into action defined for this?

Oh, doh! Just that simple typo and it destroyed the whole verb. Thanks - whipping works now.

Still have the issue with the water - I think it’s due to it being a value. Will I have to change everything? :frowning:

You would if you have pouring mentioned in many other places. However, you can just use the built in find and replace (CTRL+H) for that.

As a last resort when all else fails, give me a copy of the entire code and I’ll fix it up for you.

Although making a drink simulation seems simple enough, it can expand to become extremely complicated, I learnt this the hard way.

Hope this helps.

A semicolon, I think.

I think I have done everything you’ve said. I am getting a new error message now… woo?

[b]Problem. In the sentence ‘if the teapot is on the brazier and the water is in the teapot, now the heat of the water is the heat after the heat of the water’ , you seem to be looking up the ‘heat’ property, but ‘water’ is not allowed to have that property.

I was trying to match this phrase:

now (heat of the water is the heat after the heat of the water - a condition)

This was what I found out:

heat of the water is the heat after the heat of the water = a condition


Problem. In the sentence ‘say “some [the heat of the water] water”’ , you seem to be looking up the ‘heat’ property, but ‘water’ is not allowed to have that property.

I was trying to match one of these phrases:

  1. say "“some " - text”

  2. say “[the heat of the water - object]”

  3. say “heat of the water - text”

  4. say “[heat of the water - number]”

  5. say “[heat of the water - unicode character]”

  6. say “[heat of the water - sayable value]”

  7. say “” water" - text"

This was what I found out:

heat of the water = a property whose value is a heat, holding a heat[/b]

Remember that I made liquid a property. How do I change that? Here is my Liquid section.

[code]Part 1 - Liquids

Chapter 1 - Volumes and Fluid Containers

A volume is a kind of value. 1 scoop (singular) specifies a volume. 2 scoops (plural) specifies a volume.

A fluid container is a kind of container. A fluid container has a volume called a fluid capacity. A fluid container has a volume called current volume.

The fluid capacity of a fluid container is usually 1 scoop. The current volume of a fluid container is usually 0 scoops.

Liquid is a kind of value. The liquids are water, boiling water, and tea. A fluid container has a liquid.

After examining a fluid container:
if the noun is empty,
say “You catch just a hint of [the liquid of the noun] at the bottom.”;
otherwise
say “[The noun] contains [current volume of the noun] of [liquid of the noun].”

Before printing the name of a fluid container (called the target) while not drinking:
if the target is empty:
say "empty ";
otherwise:
do nothing.

After printing the name of a fluid container (called the target) while not examining:
unless the target is empty:
say " of [liquid of the target]";
omit contents in listing.

[Boiling water is a kind of thing. Boiling water is liquid.

The pot is a kind of fluid container. The fluid capacity of the pot is 4 scoops. Some boiling water is in the pot. The description of the boiling water is “The water has boiled, giving off wisps of steam.”]

Chapter 2 - Liquid Actions

[Instead of inserting something into a fluid container that is not fluid:
say “[The second noun] is not a storage ???.” ]

Section 2.1 - Pour/Fill/Empty

Definition: a fluid container is empty if the current volume of it is 0 scoops. Definition: a fluid container is full if the current volume of it is the fluid capacity of it.

Understand “drink from [fluid container]” as drinking.

Instead of drinking a fluid container:
if the noun is empty:
say “There is no more [liquid of the noun] within.” instead;
otherwise:
decrease the current volume of the noun by 1 scoop;
if the current volume of the noun is 1 scoop, now the current volume of the noun is 1 scoop;
say “You take a sip of [the liquid of the noun][if the noun is empty], leaving [the noun] empty[end if].”

Understand the command “fill” as something new.

Understand “pour [fluid container] in/into/on/onto [fluid container]” as pouring it into. Understand “empty [fluid container] into [fluid container]” as pouring it into. Understand “fill [fluid container] with/from [fluid container]” as pouring it into (with nouns reversed).

Understand “pour [something] in/into/on/onto [something]” as pouring it into. Understand “empty [something] into [something]” as pouring it into. Understand “fill [something] with/from [something]” as pouring it into (with nouns reversed).

Pouring it into is an action applying to two things.

Check pouring it into:
if the noun is not a fluid container, say “You can’t pour [the noun].” instead;
if the second noun is not a fluid container, say “You can’t pour liquids into [the second noun].” instead;
if the noun is the second noun, say “You can hardly pour [the noun] into itself.” instead;
if the liquid of the noun is not the liquid of the second noun:
if the second noun is empty, now the liquid of the second noun is the liquid of the noun;
otherwise say “Mixing [the liquid of the noun] with [the liquid of the second noun] would give unsavory results.” instead;
if the noun is empty, say “No more [liquid of the noun] remains in [the noun].” instead;
if the second noun is full, say “[The second noun] cannot contain any more than it already holds.” instead.

Carry out pouring it into:
let available capacity be the fluid capacity of the second noun minus the current volume of the second noun;
if the available capacity is greater than the current volume of the noun, now the available capacity is the current volume of the noun;
increase the current volume of the second noun by available capacity;
decrease the current volume of the noun by available capacity.

Report pouring it into:
say “[if the noun is empty][The noun] is now empty;[otherwise][The noun] now contains [current volume of the noun] of [liquid of the noun]; [end if]”;
say “[the second noun] contains [current volume of the second noun] of [liquid of the second noun][if the second noun is full], and is now full[end if].”

Understand the liquid property as describing a fluid container. Understand “of” as a fluid container.

Section 2.2 - Whipping

Check whipping something with something:
if the player is not carrying the whisk, say “You aren’t carrying the whisk.” instead;
if the second noun is not the whisk, say “Only the whisk can whip things.” instead;
if the noun is the whisk, say “How…what…that makes no sense.” instead;
if the noun is the player, say “You prefer to inflict pain on others.” instead;
if the noun is not the cup, say “You can only whip the cup.” instead;
if the green powder is not in the cup, say “You need to add the powdered tea first.”.

Definition: a thing is notwhisk if it is not the whisk.

Understand “whip [something notwhisk] with [whisk]” as whipping it with.
Understand “whip [something] with [something]” as whipping it with.
Whipping it with is an action applying to two things.

Carry out whipping something with something:
move the frothycup to the holder of the cup;
remove the green powder from play;
remove the cup from play;
say “You whip the tea to a fine froth.”.

The frothycup is a thing. The description of the frothycup is “A cup of tea.”
Instead of smelling the frothycup, say “The sweet scent of well made tea fills your nostrils.”

Section 2.3 - Enter/Swim/Bathe

Swimming is an action applying to nothing. Understand “swim” or “bathe” or “wash” as swimming. Instead of swimming, try entering the spring.

Instead of entering the spring, say “The cold spring water is hardly going relax you.”

Section 3 - Liquid Source

A liquid source is a kind of fluid container. A liquid source has a liquid. A liquid source is usually scenery. The fluid capacity of a liquid source is usually 3000 scoops. The current volume of a liquid source is usually 3000 scoops. Instead of examining a liquid source: say “[The noun] is full of [liquid of the noun].”

Carry out pouring a liquid source into something: now the current volume of the noun is 3000 scoops.
After pouring a liquid source into a fluid container:
say “You fill [the second noun] up with [liquid of the noun] from [the noun].”

Instead of pouring a fluid container into a liquid source:
if the noun is empty, say “[The noun] is already empty.” instead;
now the current volume of the noun is 0 scoops;
say “You dump out [the noun] into [the second noun].”[/code]

If it helps, I’ve just uploaded the full game:
The Tearoom

Of course, if you can’t manage to complete the tea ceremony, you will have no tea. You could always try dropping it. :wink:

Robert Rothman

You got it working? Brilliant!

The problem you were having before was because of the way defined water.

The “heat of the water” will work only when you’ve defined water as a thing and that it has a heat property.

The “heat of the teapot” will work only when you’ve defined the teapot as a thing and that it has a heat property.

The “heat of the liquid of the teapot” will work only when you’ve defined the teapot as a thing as that it has a liquid property that has a heat property.

The “heat of the liquid in the teapot” will work only when you’ve defined the teapot as a container which contains a liquid that has a heat property.

I’m not completely sure whether the last one will work, but the first three should be sufficient.

I’m afraid I don’t have water or boiling water defined as things, as they’re values. Does this mean I need to recode, as I can’t have them as both?

I commented the heating the water bit out to get it uploaded on playfic, but it is still there if someone smarter than me wants to take a look…?

If giving liquid a heat value is too hard to do using my current method I could pinch the liquid part of Casey’s code. :slight_smile:
I do like the things I can achieve with my liquids, but I think having them as properties means they are can’t have a heat value? Can I fudge this using the temperature of the teapot (like I did before) and having “boiling water” as a separate item?

You shouldn’t need to recode it. It’s just best to go with one way of doing it otherwise it will get very very confusing!!

I’ll probably be taking a look at it.

You can have properties of properties, but this means you always have to use the property of the property of the thing (ie. the heat of the liquid of the teapot) rather than the property of the thing (ie. the heat of the water).