Misunderstanding a choice point

I’m missing something about failure and choice points.

(on every tick in $Room)
    *($Obj has ancestor $Room)
    ($Obj suggests $Memory)
    ($Memory is nowhere)
    (par)
    Something about (the $Obj) makes you want to brood about (the $Memory).
    (now) ($Memory is #in #emotional-baggage)

As I understand it, this should search for the first object that suggests a memory, print its message, and succeed, terminating the ($Obj has ancestor $Room) loop.

But what I see is:

Something about the receipt from Big Jimmy's makes you want to brood about your your shit job.

Something about the piece of jade makes you want to brood about your grandma's stories.

So already it’s doing too much; then if I add (just), it kills the (on every tick in $Room) query.

I tried switching to (on every tick) but got the same behavior. I’m missing something, something a little bit fundamental.

1 Like

My theory is that the (exhaust) (stdlib.dg, line 3411) is triggering the over-eager behavior. Is there a way to “unexhaust” a portion of query execution?

1 Like

Found my solution:

(on every tick)
    (identify recalled memories)

(identify recalled memories)
    *(memory $Memory)
    ($Memory is nowhere)
    %% For now, object <-> memory is 1:1
    ($Obj suggests $Memory)
    (player can see $Obj)
    (par)
    Something about (the $Obj) makes you want to brood about (the $Memory).
    (now) ($Memory is #in #emotional-baggage)

Adding the extra query and predicate is my “unexhuast”.

1 Like

Very good question, and very good answer!