Routes through kinds of doors

I have a custom kind of door, which doesn’t seem to get used when routefinding. I’m guessing that in:

	objectloop (oy ofclass K4_door) {
		ds = false;
		if ((use_doors & 2) ||
			(oy has open) || ((oy has openable) && (oy hasnt locked))) ds = true;
		if (DoorRoutingViable->oyi ~= ds) map_has_changed = true;
		DoorRoutingViable->oyi = ds;
		oyi++;
	}

the keyword ofclass doesn’t pick up on kinds, only exact matches? If that’s the case, is there a related keyword that will detect kinds? I know “kind” is an I7 rather than an I6 concept; I was wondering if there was any way in which it mapped down.

I was pretty sure ofclass did work for subkinds, but I just did this in borogove in 6M62 to verify:

lab is a room.

to decide if (t - thing) isdoor: (- {t} ofclass K4_door -).

flap is a kind of door.
doggie-door is a flap.
doggie-door is west of lab. Parlor is west of doggie-door.

oak-door is a door.
oak-door is east of lab. conservatory is east of oak-door.

when play begins:
  if doggie-door isdoor, say "Doggie!";
  if oak-door isdoor, say "Oak!"

Output:

Doggie!
Oak!
3 Likes

Sigh. I should have tried that before posting. Apparently I have something else going on which I don’t understand. Thanks :crazy_face:

Oh I get it. I’m trying to find routes that go through open doors but not closed doors. That is not a thing.

Not currently, but I have an extension somewhere for that! Let’s see…

Looks like I posted the dev version two years ago and never did anything further with it because I started using Dijkstra pathing instead. But maybe this’ll work for you!

3 Likes

Thanks. I’m using 6M62, though. But I managed to hack something to make it work.

I do have a 6M62 version, but I don’t have Inform installed here to test it unfortunately. But see if this works:

Enhanced Route Finding 6M62.i7x (11.1 KB)

1 Like