I have a chase scene where room a is both above and to the south of room b. I also have a “go to” command that lets you jump rooms. Now I don’t want the player to jump over their chaser, so I used the handy “best route” to get something like this…
let X be the best route from the location of the player to the noun;
if X is opposite of last-chase-direction, say “You were caught!” instead;
The only problem is, from room A to B could be down or north, so the player could slip out.
I could hard code in something that says “check going up in room A when being-chased is true” (and have) but that is hacky. I would love to be able to find a simple I6-based solution.
Debugging the “best route” code leads to this, in relations.i6t:
FastRouteTo from to filter use_doors diri i dir oy;
if (from == to) return nothing;
i = (FWMatrix-->(from.room_index*NUM_ROOMS + to.room_index))/No_Directions;
if (i == 0) return nothing;
diri = (FWMatrix-->(from.room_index*NUM_ROOMS + to.room_index))%No_Directions;
i=0; objectloop (dir ofclass K3_direction) {
if (i == diri) return dir;
i++;
}
return nothing;
;
I was unable to find what K3_direction did, or how I would replace it with a different sort of class. I’m not even quite able to swing replacing the objectloop with something like this:
[code]
Array myDirs --> 4 = north, south, east, west;
for (i = 1 : i <= myDirs–>0 : i++) {
if (myDirs–>i == diri) return myDirs–>i;
}
But I can’t see how. Would anyone have an idea how to specify an array of directions? http://www.firthworks.com/roger/informfaq/ gives me ideas such as the below, but I can’t (and probably should) figure it out.
Array xxx --> 4 w_obj, e_obj, n_obj, s_obj;
Any help is appreciated. I have a feeling I’m just missing how directions are defined in I6. Thanks!