"number of moves" no longer ignores doors, so now what?

I’m trying to put adjacent rooms in scope if a door is open. I need this to work in every room, not just specific cases. Used to be I could check the distance with “number of moves” because it ignored doors, but it doesn’t anymore. I’d prefer not to have the player have to look in a direction for it to work.

You can do something like this:

let N be the number of moves from the lab to the observatory, using doors

There are some circumstances where this phrase won’t work smoothly; for instance, you can’t do

say "[the number of moves from the lab to the observatory, using doors]"

because text substitutions can’t contain commas. But this should work for your case.

…on the other hand, this won’t check that the door is open. And from what you’re saying you want to do, you might just want to check all the open doors in the location and add their other sides to scope. That way you don’t need any route-finding:

[code]Lab is a room. Observatory is a room. The lab door is a door, east of Lab and west of observatory. A beaker is in Lab. A telescope is in observatory.

After deciding the scope of the player:
repeat with portal running through open doors in the location:
if the other side of the portal from the location is a room:
place the other side of the portal from the location in scope.

test me with “x telescope/open door/x telescope/e/x beaker/close door/x beaker”.[/code]

Huh. I don’t know why I didn’t think to repeat through the open doors. I’ll give that a try.