Okay, here’s a more functional version that demonstrates the challenge I’m having:
Part - Room_Navigating
A person can be discouraged_from_compass_navigating or not discouraged_from_compass_navigating.
Room_navigating is an action applying to one thing.
Understand
"go back/- to/around/near/by/-- [any room]",
"return to [any room]",
"walk to/-- [any room]",
"run to/-- [any room]",
"follow [any room]"
as room_navigating.
Check room_navigating:
if the noun is the location, say "Well, happily you're already here." instead;
Carry out room_navigating:
let initial location be the location;
let the destination be the noun;
if the initial location is the destination,
say "." instead;
let heading be the best route from the initial location to the destination;
say "(DEBUG room_navigating: heading toward [noun] is [heading])[line break]";
if heading is nothing:
say cant_find_that instead;
else:
now player is not discouraged_from_compass_navigating;
try going heading.
Part - Elusive_Landmarks and Landmark_navigating
An elusive_landmark is a kind of thing.
The_distance is a container.
The_distance is in Limbo.
[ Definition: an elusive_landmark is distant if it is in the_distance. ]
landmark_navigating is an action applying to one visible thing.
Understand
"go to/near/by/-- [any elusive_landmark]",
"walk to/near/by/-- [any elusive_landmark]",
"run to/near/by/-- [any elusive_landmark]",
"landmark_navigate [any elusive_landmark]"
as landmark_navigating.
Check landmark_navigating:
if the noun is touchable:
say "Well, that's right here." instead;
if the noun is not in the_distance:
say cant_find_that instead;
To say cant_find_that:
say "You're no longer sure how to get there.";
Carry out landmark_navigating:
say "You head toward the [noun].";
move_within_dark_woods;
try looking.
To move_within_dark_woods:
let distant_thing be a random elusive_landmark in the_distance;
let next_thing be a random elusive_landmark in Limbo;
let past_thing be a random elusive_landmark in location;
now distant_thing is in location;
now next_thing is in the_distance;
now past_thing is in Limbo;
The can't reach inside rooms rule does nothing if landmark_navigating.
The can't reach inside rooms rule response (A) is "You can't get there from here."
Part - Rooms & Stuff
Dark Woods is a room.
"[dark_woods_desc].".
To say dark_woods_desc:
let distant_thing be a random elusive_landmark in the_distance;
say "It's dark and woody. You see [the distant_thing] in the distance";
The white tree is an elusive_landmark in The_distance.
Understand "tree" as white tree.
The madrone tree is an elusive_landmark in Dark Woods.
The tree stump is an elusive_landmark in Limbo.
Top of the Tree is a room [west of Dark Woods].
Understand "tree" as Top of the Tree.
And running it:
>look
[looking]
Dark Woods
It’s dark and woody. You see the white tree in the distance.
You can see a madrone tree here.
[looking - succeeded]>go to white tree
[landmark_navigating the white tree]
You head toward the white tree.
[(1) looking]
Dark Woods
It’s dark and woody. You see the tree stump in the distance.
You can see a white tree here.
[(1) looking - succeeded]
[landmark_navigating the white tree - succeeded]>go to white tree
[landmark_navigating the white tree]
Well, that’s right here.
[landmark_navigating the white tree - succeeded]>go to tree
[room_navigating Top of the Tree]
(DEBUG room_navigating: heading toward Top of the Tree is nothing)
You’re no longer sure how to get there.
[room_navigating Top of the Tree - succeeded]
You can see that rather than landmark_navigating, it is prioritizing room_navigating with the ambiguous target “tree”.
And as Peter queried, does the order in the source determine which it privileges: I reversed the position within the source of “Part - Room_Navigating” and “Part - Landmark_Navigating,” and voila! It privileges Landmark_Navigating.
Though frustratingly, “go tree” still privileges “room_navigating Top of the Sentinel Tree” rather than “white tree”.
>go to tree
[Rule “Response Assistant reset responses list rule” applies.]
[Rule “ignore beta-comments rule” applies.]
[Rule “new_blank_line_replacement rule” applies.]
[Rule “declare everything initially unmentioned rule” applies.]
[room_navigating Top of the Sentinel Tree]