I’m new to Inform7 (and not to strongest coder so sorry in advance if this is any easy fix) I want to make an if statement in the middle of a description. In a previous room, I had an impression in the dirt that implied that someone might have been dragged away. In another room, there’s a corpse that I want to add extra description for if you’ve already examined the impression in that other room. I tried two different ways and neither works so I’m curious what I’m doing wrong.
I wrote I wrote the first one like this:
The Forest is a room.
The Impression is an undescribed fixed in place thing in the Forest.
Understand "marks", "The mud spot", "The Mud Impression" as The Impression.
The description of The Impression is "There’s a deep groove in the mud. From the looks of it, you would guess something fell into the mud here and scrambled to get back out. Long grooves in the mud lead all the way back in the direction of the hag’s house. They look like drag marks."
The Living Room is a room.
The Corpse is an undescribed thing in The Living Room.
The Corpse is in the Secret Nook.
Instead of examining the corpse:
say "You would have thought the man was just sleeping by the peaceful look on his face. That is, if it wasn't for the smell of copper clinging to him. His limp hand rests against his side where you can see a large hole in the side of his body. His leathers partially cover the wound but the dried red blood still covers his side and the floor beneath him.[paragraph break]His sharp cheekbones are covered in scratch marks and his well taken care of beard is covered in mud. Looking over the side of him that isn't covered in red, he looks as if he must have fallen into the mud at some point.";
if the player has examined The Impression:
say "You look over his fingers and see that they're covered in mud. He must have been the one dragged inside of the house.";
otherwise:
say "His back is propped oddly against the wall. When you look underneath him, you see that he is laying on top of a small chest.";
I also tried to rewrite the examine corpse line like this instead:
"You would have thought the man was just sleeping by the peaceful look on his face. That is, if it wasn't for the smell of copper clinging to him. His limp hand rests against his side where you can see a large hole in the side of his body. His leathers partially cover the wound but the dried red blood still covers his side and the floor beneath him.[paragraph break]His sharp cheekbones are covered in scratch marks and his well taken care of beard is covered in mud. Looking over the side of him that isn't covered in red, he looks as if he must have fallen into the mud at some point. [if the player has examined The Impression] You look over his fingers and see that they're covered in mud. He must have been the one dragged inside of the house. [otherwise:] His back is propped oddly against the wall. When you look underneath him, you see that he is laying on top of a small chest.";
Neither of these worked. If someone could let me know what I’m doing wrong, it would be appreciated. Thank you!
IMVHO you’re underusing Inform 7/10… in its stronger point, the adaptive prose.
you can instead of your Instead simply use the description of the corpse, e.g.
The Lamp is a lightsource. The description is "An ancient brass carbide lamp, at least 50 years old. Around the base is embossed an inscription [if switched off], currently off[otherwise], rblazing with brilliant yellow light[end if]. ".
in your case, you can write:
The corpse is a thing in the living room. the description of the corpse is "[if the Impression is examined] You look over... [otherwise] His back is...".
HTH and
Best regards from Italy,
dott. Piergiorgio.
I might have done something wrong but I go this as a problem.
Problem. In the sentence '“[If the impression is examined] Yo […] e one dragged inside of the house.” I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘impression is examined’.
I was trying to follow what you said so I just did this:
The description of the Corpse is "[If The Impression is examined] You would have thought the man was just sleeping by the peaceful look on his face. That is, if it wasn't for the smell of copper clinging to him. His limp hand rests against his side where you can see a large hole in the side of his body. His leathers partially cover the wound but the dried red blood still covers his side and the floor beneath him.[paragraph break]His sharp cheekbones are covered in scratch marks and his well taken care of beard is covered in mud. Looking over the side of him that isn't covered in red, he looks as if he must have fallen into the mud at some point. You look over his fingers and see that they're covered in mud. He must have been the one dragged inside of the house. [otherwise] You would have thought the man was just sleeping by the peaceful look on his face. That is, if it wasn't for the smell of copper clinging to him. His limp hand rests against his side where you can see a large hole in the side of his body. His leathers partially cover the wound but the dried red blood still covers his side and the floor beneath him.[paragraph break]His sharp cheekbones are covered in scratch marks and his well taken care of beard is covered in mud. Looking over the side of him that isn't covered in red, he looks as if he must have fallen into the mud at some point. You look over his fingers and see that they're covered in mud. He must have been the one dragged inside of the house."
did you use the suggested code from cortjstr? That’s what makes it possible for something to be “examined.” Without it, Inform won’t understand what [If The Impression is examined] means.
so (as above):
A thing can be examined or unexamined. A thing is usually unexamined.
Carry out examining something: now the noun is examined.
the description of the corpse is "[if the impression is examined]description.[otherwise]the other description."
(re: wall of text: One of the reasons I prefer the “after…” idea from my post is that I have trouble reading large blobs of text while proofreading.)