Puzzles which require several conditions

Hi I’m getting familiar with Inform 7 by attempting to write a very short piece of IF, it’s not meant to make any sense just an excuse for me to learn. The aim is to make some porridge and bribe a Knome with it but I’m not certain how to allow for multiple requirements.
To make the porridge I need the following things:
-The logs are in the fireplace.
-The pot is in/hanging in the fireplace.

  • Once the pot is hanging over the fire, the player should then put the oats and the milk in the pot.
    Which should then give me some porridge.

This is as far as I’ve gotten that works:
The fireplace is a container. The fireplace is fixed in place. The fireplace is in Roran’s house. The fireplace can be empty or full. The fireplace is empty. The description is " It’s your fireplace [if empty] you’ll need to find some wood before you can light it [ end if]. [If full] It’s stacked with logs [end if][if the pot is in the fireplace] A pot hangs above the fireplace ready for you to cook. [end if]".

Instead of inserting logs into fireplace:
say " You put the logs in the fireplace where they ignite by magic.";
move logs to fireplace;
now the fireplace is full.

After inserting the pot into the fireplace:
say " You hang the cooking pot into the fireplace. [if full] The flames from the fire gently heat the pot [end if].";

This doesn’t

Instead of inserting the oats into the pot:
if the fireplace is full, and the pot is in the fireplace;
move the oats to the pot.
end if.

Am I formatting wrongly? and how do I define multiple conditions to do something? My initial thought was to use the " full" property to cover both the logs and pot being in the fireplace, to then trigger the next part of the puzzle where the player needs to add the oats and milk, but I just can’t get my head around scripting puzzles with multiple requirements.

Any help or advice would be appreciated.

It looks to me as if the problem is that you’ve got “begin” in the wrong place (and I suspect you’re not allowed a comma before the “and” in your if statement). Also, you’d need a semi-colon, not a full-stop after “pot” (since it’s followed by another statement). So I think what you meant was:

Instead of inserting the oats into the pot:
if the fireplace is full and the pot is in the fireplace begin;
move the oats to the pot;
end if.

That said, since you only have only statement after the if condition you don’t need to use “begin” and “end if” here, you could just have:

Instead of inserting the oats into the pot:
if the fireplace is full and the pot is in the fireplace then move the oats to the pot.

That said, I’m not sure why you don’t just make the pot a container so the player can insert the oats into it. Perhaps what you’re trying to do is to stop the player inserting the oats into the pot before they’re ready to, perhaps with something like:

Instead of inserting the oats into the pot when the fireplace is not full or the pot is not in the fireplace:
say "The pot isn't ready for the oats yet."

– Eric

Eric beat me to it, but I’ll just post (some of) this anyway. For the puzzle solution you described, I believe something more like this is in order:

Every turn when the fireplace is full and the pot is in the fireplace and the oats are in the pot and the milk is in the pot: say "You have just made porridge!"; move the porridge to the pot; remove oats from play; remove milk from play.
This checks the puzzle condition at the end of every turn. It makes sure that the porridge is created regardless of the order in which the player does things (even when he puts the oats and the milk in the pot before hanging the pot over the fire.)

Cheers, now that you’ve both explained it I see where I’ve gotten confused thanks! :smiley: