Unblinking
Suppose we're simulating a situation where the player needs to travel through lit areas only, but we want to give him some hints about which way might be safe. Here we'll find our best route through light-filled rooms.
The slightly tricky part is that it's not necessarily easy to tell whether a room has a lamp in it. We may say "if the Crypt is lighted", but that only tells us whether it has been declared to be inherently lighted or dark, not whether it happens to contain a light source that the player would be able to see if he went in.
The easiest way to get around this is to create an object -- the light-meter; place it in the target location; and check whether it "can see" a lit object. This preserves all the usual rules about open and closed containers, transparency, etc.
That done, we're free to use our best-route phrases to choose a particular route.
Test me with "up / drop candle / down / up / take the candle / open sarcophagus / put candle in sarcophagus / down / up / close sarcophagus / d".
This ancient underground tomb is lightless but for a few shafts from the surface. Everywhere in the shadows are carved angels, their faces worn away by water and pollution, their wings little more than nubs.
It looks like there is no fully lit path from here to the Crash Site.
>(Testing.)
>[1] up
Upward Path
The staircase switches back on itself many times as it ascends towards the Crash Site.
A sarcophagus rests in the niche here, the lid firmly in place.
It looks like there's a safe, lit path straight up.
>[2] drop candle
Dropped.
>[3] down
Tomb of Angels
This ancient underground tomb is lightless but for a few shafts from the surface. Everywhere in the shadows are carved angels, their faces worn away by water and pollution, their wings little more than nubs.
It looks like there's a safe, lit path if you go up.
>[4] up
Upward Path
The staircase switches back on itself many times as it ascends towards the Crash Site.
A sarcophagus rests in the niche here, the lid firmly in place.
You can also see a candle (providing light) here.
It looks like there's a safe, lit path straight up.
>[5] take the candle
Taken.
>[6] open sarcophagus
You open the sarcophagus.
>[7] put candle in sarcophagus
You put the candle into the sarcophagus.
>[8] down
Tomb of Angels
This ancient underground tomb is lightless but for a few shafts from the surface. Everywhere in the shadows are carved angels, their faces worn away by water and pollution, their wings little more than nubs.
It looks like there's a safe, lit path if you go up.
>[9] up
Upward Path
The staircase switches back on itself many times as it ascends towards the Crash Site.
A sarcophagus rests in the niche here, the lid pushed aside.
It looks like there's a safe, lit path straight up.
>[10] close sarcophagus
You close the sarcophagus.
>[11] d
Tomb of Angels
This ancient underground tomb is lightless but for a few shafts from the surface. Everywhere in the shadows are carved angels, their faces worn away by water and pollution, their wings little more than nubs.
It looks like there is no fully lit path from here to the Crash Site.
An important word of caution: this method would give false negatives if there were a backdrop lightsource, such as the moon, providing light to the Upward Path. This is because backdrops are actually moved around the map by Inform during play, following the player around. So if the moon backdrop is in the Crash Site with the player, it will not be in the Upward Path as well -- even if it's scheduled to move there as soon as the player does.