Okey dokey, I edited the example project to look at a 4 x 4 grid labelled AA to DD (included below in the Details). I included the definition of diagonals and the 10/14 edge cost rule. When I run it and type DISTANCE, it shows every edge has a weight of 10. So the cost rule fired, but the cost of 14 was never applied, suggesting it recognised no diagonals.
Summary
"AA to DD"
Include Dijkstra Pathing by Daniel Stelzer.
Distancing is an action applying to nothing. Understand "distance" as distancing.
Carry out distancing:
recalculate Dijkstra routes from the location;
repeat with the place running through rooms:
say "[The place]: [the Dijkstra distance to the place][line break]".
Routing is an action applying to one visible thing. Understand "route [any room]" as routing.
Carry out routing:
recalculate Dijkstra routes from the location;
let L be a list of rooms;
let T be the noun;
while T is not the location:
add T at entry 1 in L;
let T be the Dijkstra predecessor of T;
if T is nothing, break;
add T at entry 1 in L;
let the way be the Dijkstra route to the noun;
say "Route from [the location] to [the noun]: [L]. Start by going [way]."
Definition: a direction is diagonal if it is northeast or it is northwest or it is southeast or it is southwest.
Edge cost rule:
if the edge direction is diagonal:
rule succeeds with result 14;
otherwise:
rule succeeds with result 10;
AA is a Room. AB is east of AA. AC is east of AB. AD is east of AC.
BA is a Room. BB is east of BA. BC is east of BB. BD is east of BC.
BA is north of AA. BB is north of AB. BC is north of AC. BD is north of AD.
CA is a Room. CB is east of CA. CC is east of CB. CD is east of CC.
CA is north of BA. CB is north of BB. CC is north of BC. CD is north of BD.
DA is a Room. DB is east of DA. DC is east of DB. DD is east of DC.
DA is north of CA. DB is north of CB. DC is north of CC. DD is north of CD.
BB is northeast of AA. BB is northwest of AC.
BC is northeast of AB. BC is northwest of AD.
CB is northeast of BA. CB is northwest of BC.
CC is northeast of BB. CC is northwest of BD.
DB is northeast of CA. DB is northwest of CC.
DC is northeast of CB. DC is northwest of CD.
DA is northwest of CB. DD is northeast of CC.
BA is northwest of AB. BD is northeast of AC.
CA is northwest of BB. CD is northeast of BC.
Test me with "distance".
-Wade