Help with making rules in Inform 7

Hi I’m new to this forum so I don’t know if this is the right place to ask but. I’m currently in the process of writing an IF adventure, and I’m a bit stuck. I’m trying to create a rule for revealing a door when an object (a rug) is moved. But I’m not quite sure how it should be set up. I’ve already downloaded and included the Secret Doors extention by Andrew Owen.

Anyone know what I need to do?

Thank you for your time.

The usual best method to reveal a hidden object in Inform 7 is to keep it off-stage until it is “found” then move it where it belongs.

Doors in Inform are difficult, and cannot be moved.

I made an extension called “Easy Doors” which creates a door type that can be manipulated by rules. Using this, here’s how I would do it:

[rant=code][code]“Secret Cellar”

Include Easy Doors by Hanon Ondricek.

Barn is a room. “There doesn’t seem to be any way out of here, now that the Sheriff has locked you in.”

A trap door is an easydoor. It leads to Cellar. “The trap door that was previously hidden under the rug [if trap door is open]stands open [otherwise]is firmly shut [end if]in the floor.”

A dusty rug is in Barn. “A dusty rug is rumpled on the floorboards in the center of the barn.” The description is “It looks heavy and lumpy in the center.”

Carry out taking dusty rug for the first time:
say “You roll the rug up, kicking up clouds of dust… Hey, there’s a trap door underneath it!”;
now trap door is in barn.

After taking dusty rug:
say “Even rolled up, the dusty rug is a little too heavy to carry around, so you drop it. The rug unrolls completely again.”;
now dusty rug is in the location.

Instead of doing anything except examining or taking to dusty rug:
try taking dusty rug.

Instead of going down when the location is barn:
if trap door is in barn:
try entering trap door;
say “You’d need a pickaxe of some sort.”

Cellar is a room. “This is a cool dark cellar under the barn. You should be safe down here for now.”

Instead of going up in cellar:
say “You’re safer down here. You don’t want to get your head shot off.”[/code][/rant]



Thank you very much. That’s exactly what I was looking for. :smiley: