I’m working on an puzzle where, if it is somewhat dark, an attempt to move around instead hints to you about an object (a desk containing a flashlight).
In Inform, it looks like:
Staging Area is either dim or bright. Staging Area is dim.
Instead of going to a room regionally in Office Interior from dim Staging Area: say “You take a step and crack your shin against what feels like a metal desk. Ouch.” Instead of going nowhere from dim Staging Area: try going north.
My version of this is:
(instead of [leave * $Direction])
<leave * $Direction> (line)
(lit by headlights *)
{ (from * go $Direction to $TargetRoom)
(or)
($TargetRoom = *)
staying put (line)
}
target = $TargetRoom (line)
(office interior $TargetRoom)
You take a step and crack your shin against what feels like a metal desk.
My intention is: if there’s a valid room connection, then $TargetRoom gets set to that room, otherwise, set $TargetRoom to *
(#staging-area).
But this isn’t working for an important case: you should be able to go #out because (from * go #out to #crumbling-concrete)
exists, and does not have the (office interior $)
trait.
Output:
Staging Area
Faint shafts of light from your dimming headlights seep through a boarded-up pane of cracked glass, but you can barely make out anything of the interior.
> out
<leave #staging-area #out>
target = #crumbling-concrete
staying put
target = #staging-area
You take a step and crack your shin against what feels like a metal desk.
>
So there’s some kind of multi-query that is kicking in when (office interior $TargetRoom)
fails I believe, but I’m not sure where that is or what to do about it. Any ideas on this, or how to narrow it down a bit?
Ah, I love having debug and tracing and all that; I got more info, but still am in the dark:
> (instead of [leave #staging-area #out])
| | | | QUERY (instead of [leave #staging-area #out])
| | | | | ENTER (instead of [leave #staging-area #out]) src/staging-area.dg:43
| | | | | QUERY (lit by headlights #staging-area) src/staging-area.dg:44
| | | | | | ENTER (lit by headlights #staging-area) src/light.dg:30
| | | | | | QUERY (in range of headlights #staging-area) src/light.dg:32
| | | | | | FOUND (in range of headlights #staging-area) src/light.dg:32
| | | | | | QUERY (brightly lit #staging-area) src/light.dg:33
| | | | | | | ENTER (brightly lit #staging-area) src/light.dg:26
| | | | | FOUND (lit by headlights #staging-area) src/staging-area.dg:44
| | | | | QUERY (from #staging-area go #out to $) src/staging-area.dg:45
| | | | | | ENTER (from #staging-area go #out to #crumbling-concrete) src/crumbling-concrete.dg:24
| | | | | FOUND (from #staging-area go #out to #crumbling-concrete) src/staging-area.dg:45
| | | | | QUERY (office interior #crumbling-concrete) src/staging-area.dg:49
| | | | | QUERY ($ = #staging-area) src/staging-area.dg:47
| | | | | FOUND (#staging-area = #staging-area) src/staging-area.dg:47
| | | | | QUERY (office interior #staging-area) src/staging-area.dg:49
| | | | | FOUND (office interior #staging-area) src/staging-area.dg:49
You take a step and crack your shin against what feels like a metal desk.
| | | | FOUND (instead of [leave #staging-area #out])
Query succeeded: (instead of [leave #staging-area #out])
>
These two lines:
| | | | | QUERY (office interior #crumbling-concrete) src/staging-area.dg:49
| | | | | QUERY ($ = #staging-area) src/staging-area.dg:47
seem to be a the heart of the issue; still don’t see the solution though.