What I want to know is if there is a function to detect what exit an
exit is linked to. Can I figure out that Out is linked to In, in other
words?
I know loc() can tell me what -room- an exit is linked to, but I want to
know the reciprocal exit.
I suspect the structure is such that the two exits have nothing in
common, simply being links to room with no actual connection beyond the
semantic.
What I'm -trying- to do is put @dig roomname=exit1,exit2 into a command
write exit1 and exit2 into setq(). I just can't seem to get one of the
exits into setq(), because there's no obvious way to reference it -- in
the other two cases, I'm using lastcreate() (which gets me the exit) and
where([lastcreate()]), which gets me the room that @dig creates.
--->Ben
There's got to be an easier way to do this that I'm missing. :(
--->Ben
&FILTER-RETURNS-HERE <object>=strmatch(loc(%0),%q0)
&U-EXIT-TWIN <object>=[setq(0,home(%0))][first(filter(me/filter-returns-here,lexits(loc(%0))))]
u(<object>/u-exit-twin,<exit dbref>) <-- this'll then return the first matching/returning exit (or an empty result if there is no exit).
Its not a two way pipeline where Room <--- Exit ---> Room. Perhase if
a 'what links here' was created so that one can run a simple command,
it might solve your issue.
I solved it, thanks to the hints given here. I didn't end up using
attributes or strmatch -- the attribute solution seemed inelegant, and
the strmatch concerned me -- it'd match both #125 and #1250 if I tried
to match for #125.
This is what I did, instead:
[iter([lexits([loc([r(1]])])],[if([eq(1,[comp(##,[num([r(0)])])])],[setq(3,##)])])]
...where r(1) is the exit I know about from lastcreate() and r(0) is
equal to [where([lastcreate()])], and thus, the parent room. All of
which is set by preceding code.
Thanks for all your help!
--->Ben
Sounds like instead of using @dig, you need to write a +dig that will do
what you want.
I identify paired exits with an &BACK attribute.
Sandi
Thanks!
--->Ben
--->Ben