Conditional relations used in route-finding

I’m working different ways to do route-finding and was trying to use conditional statements in order to find the best route which the actor has access to (taking into account things like what keys they are carrying and whatnot). Here’s a somewhat simplified version of what I’m trying to do:

Laboratory is a room. 

Closet is a room. 

Closet Door is a door. It is west of the laboratory and east of the closet. It is open. 

Traversability relates doors (called the door) to people (called the person) when the door is open. The verb to be traversable by means the traversability relation.

Walking to is an action applying to one visible thing.

Understand "Walk to [any room]" as walking to.

Carry out walking to:
	showme whether or not the closet door is traversable by the player;
	let x be the best route from the location to the noun through doors traversable by the player;
	try going x.

The showme phrase is returning that the closet door is traversable by the player however the best route phrase keeps returning nothing. If I remember correctly the examples of using “through” in the documentation has to do with properties like ‘visited rooms’, is best route simply not meant to be used with conditional relations like this, or is there something else I’m doing wrong?

For whatever reason, you can put whatever conditions you want on the rooms to navigate through, but not on the doors: the only options are “using doors” or “using even locked doors” (or the default, no doors at all).

I’ve made an extension to overcome this, though I think it needs a bit more testing before public release. Are you using 10.1 or an earlier version?

1 Like

Thats interesting it has that restriction. I look forward to checking out your extension once it’s done. Amd yes I am using 10.1.

In that case, here’s the current version. Let me know how it works and if anything breaks unexpectedly.

Enhanced Route Finding 10-v1.i7x (9.9 KB)

It works basically how you’d expect, but be aware: “through” is for rooms, “using” is for doors. (This is a bit unintuitive but it seemed better than relying on the type-checker to distinguish between descriptions of rooms and descriptions of doors.) So you’ll want “the best route from X to Y using doors traversable by the player”.

3 Likes