Climbing trouble

I started an Inform project a while ago and have now returned to it after a year or so to find that some of the things I had written no longer work (likely due to an update in versions); climbing seems to be one of them.

I have a drainpipe that I wish to climb. The drainpipe is a supporter. I would like the player to ‘climb drainpipe’ and have the following take place:

Instead of climbing drainpipe when player is in Garden: say "You climb up the drainpipe until you are on the roof."; move player to the Rooftop; move drainpipe to Rooftop

Instead, when I state ‘climb drainpipe’ I get told “I don’t think much is to be achieved by that.”

I have the following in place:

Understand "climb [something]" as climbing. 

Instead of going up when player is in Garden: Say "You climb up the drainpipe until you reach the roof."; move player to Rooftop; move drainpipe to Rooftop.

Though the player moves up to the roof when I stand in the garden and type “Up” , the climbing drainpipe text does not appear, and the drainpipe no longer moves to the rooftop.

I’m sure there’s something very obvious I’m doing wrong, but can’t for the life of me figure out what. Any ideas?

Thanks

My best guess is that the rules don’t fire because the player is not “in” the garden: “in” means being directly in something, so if the player is for example on a bench that’s in the garden, the player is not in the garden but in the bench. Try changing the rules to “Instead of climbing drainpipe when the location is the Garden” and see if that works better.

Understand "climb [something]" as climbing. 

This is not in fact necessary; the same line is already defined in the standard library.

Thanks for your response; the error does certainly appear to be location based and I am in the correct location, i.e. not on a bench. I’m assuming Regions do not play into this?

When I try and remove the conditions for where I am and simply state:

Instead of climbing drainpipe: say "You climb up the drainpipe until you are on the roof."; move player to the Rooftop; move drainpipe to Rooftop.

I get the following response:

My location stays in the garden.

Thanks

I tested with the following and it works ok:

[code]The garden is a room. The rooftop is a room. The drainpipe is in the garden.

Instead of climbing drainpipe when player is in Garden:
try going up.

Instead of going up in the Garden:
say “You climb up the drainpipe until you are on the roof.”;
move player to Rooftop;
move drainpipe to Rooftop.[/code]
The error message suggests that there might be something wrong with the room definitions. Can you see them in the index? In the index page’s World tab there should be an “A to Z” list. In the list there should be “Garden … room” and “Rooftop … room”.

Thanks Juhana

Breaking it in two as your example above is seems to have done the trick for allowing me to move from room to room without errors, though it’s missing the following ‘say’ command and movement of the drainpipe.

The rooms are fully set out in the index; I’m thinking there may have been some annoying (though necessary) changes to the way Inform works from the version I was using last year to the new one; I’ve now got 12,000 words of this project to go though to see what is all broken in this manner :frowning:

If you don’t see the message, it means the rules don’t fire and you’re just moving around normally (you can try removing the rules altogether and I suspect it won’t affect the game.) Hopefully you get the project working.

For this example, would it be more natural to treat the drainpipe as a door?

"Drainpipe"

The Garden is a room. The Roof is a room.

The drainpipe is an open door. The drainpipe is up from the garden and down from the roof.

Instead of climbing the drainpipe:
	say "You climb [if the player is in the garden]up[otherwise]down[end if] the drainpipe.";
	try entering the noun.

Instead of going up when the player is in the garden, try climbing the drainpipe.
Instead of going down when the player is in the roof, try climbing the drainpipe.