I’m having trouble figuring out how to make this work. My goal is to take one detergent pod from the box and put it into the compartment. I want the compartment to be able to hold only detergent pods, and only one at a time. There will be (but I haven’t coded it yet) an action for running the dishwasher, which will result in the detergent pod that was in the compartment being “nowhere.” (If the last detergent pod is being used to run the dishwasher, I’ll make sure the player isn’t put in a situation of needing more.)
I’m starting the scene with ten detergent pods in the box, though, and I think this is where my problem is. I want there to be multiple detergent pods so that the player can run the dishwasher more than once. But Inform doesn’t know which of the ten detergent pods I’m talking about. At least, I think that’s what the error is; I’m very new to this.
So here’s my code, and I’m hoping someone can help me figure out how to make it do what I want it to!
A detergent pod is a kind of thing. The description is "Wow, all the dish-cleaning power you need in this one little pod!" Ten detergent pods are in the box of detergent. The compartment is a container in the dishwasher. The carrying capacity of the compartment is 1. The compartment is fixed in place. The compartment is openable. The compartment is open. The description of the compartment is "This looks like the place to put a detergent pod." Instead of inserting something into the compartment: if the player carries the noun and the noun is not a detergent pod: say "That's not what belongs here."; if the player does not carry the noun: say "You don't have that."; if the noun is a detergent pod and the player carries a detergent pod and a detergent pod is in the compartment: say "There's already a detergent pod in there."; if the noun is a detergent pod and the player carries a detergent pod and the compartment contains nothing: say "You put the detergent pod into the compartment, which closes automatically."; now the player does not carry a detergent pod; now a detergent pod is in the compartment; now the compartment is closed.
And here’s the report Inform gives me:
Problem. You wrote ‘now a detergent pod is in the compartment’: but this is not explicit enough, and should set out definite relationships between specific things, like ‘now the cat is in the bag’, not something more elusive like ‘now the cat is carried by a woman.’ (Which woman? That’s the trouble.)