My question is:
The player is in the Starting Room. They can only go north to the lab. So they do. They enter the lab. The player has a set of blueprints for the lab. If they read the blueprints, a secret passage opens to the north. But if they read the blueprints twice or more, I want a message to say “You already read the blueprints and you can’t open an already opened secret passage twice.”
-
I cannot get the game to print this message. There is something wrong with my if/else statement in To say blueprints_desc.
-
The statement “else if north from the lab is Secret_Room” is wrong. For the life of me, I CANNOT find one example in the Recipe Book that contains that statement. I have looked 500 times. I know I saw that statement somewhere before because at one point in my debugging I had that statement right and now I can’t find it again in the Recipe Book.
-
So what is the correct statement? And if you can find the correct statement, it still won’t print out “You already triggered the secret passage once already.”
-
As I type this, a box has opened to my right. It contains similar topics to mine about exits and if/else statements. But I click on these topics and nothing happens. I don’t want to repeat a topic, but nothing happens when I try to see them.
-
Thank you for all your help.
Starting_Room is a room. The description of Starting_Room is "The player starts here." North of Starting_Room is the Lab.
Lab is a room. The description of Lab is "This is a lab." South of Lab is Starting_Room.
Some blueprints are a thing. The player carries blueprints. Blueprints are portable. The description of blueprints is "[blueprints_desc}".
To say blueprints_desc:
if location is not Lab:
say "You are not in the lab, and the blueprints only talk about things in the lab.";
else if north from the lab is nowhere:
say "You discover a secret passage to the north!";
change the north exit of Lab to Secret_Room;
change the south exit of Secret_Room to Lab;
else if north from the lab is Secret_Room:
say "You already discovered the Secret Room and you can't discover it twice. Nothing happens."
Secret_Room is a room. The description of Secret_Room is "The room is secret." South of Secret_Room is nowhere.