 |
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Fri Dec 07, 2007 7:59 pm
returning the "from" room for a one way link |
I've been playin around with %roomlink and a couple other functions to try to come up with a way to have the "from" room in a one way link returned to some variable. i.e. I have rooms 1 and 2. The south exit from room 1 is a one way exit going to the north of room 2. If I'm looking at room 2, is there any way to: A. have a function tell me that room 2 links in a one way fashion to the north of room 2? B. Get a list of all of the rooms that link to this room? and mabye their link type (one way, normal, locked door, portal. etc?). I realize there are other priorities right now, but this might be something to include with the rewrite of the mapper...
|
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Fri Dec 07, 2007 8:35 pm |
There actually is a way to do it, but it is very round about. There is actually nothing in the map database that that correlates a reverse on a oneway link. If you can bring yourself to setup an SQL search on the exit table then you can directly search for the ToID field to get what you want.
Not doing that search requires that you have to set the %roomcost of known rooms connected into the target room to a high number then attempt to path in using either %walk or %pathfrom. Generally picking a starting room that can be determined to be somewhat close, but not directly linked, is helpful. You can then deduce the oneway link by tracing the rooms travelled in the path, if the path goes through any of the rooms you adjust the cost on then there is likely no other link.
It is not very easy to code, and I suggest looking at various posts on the forum for how to handle doing a search of a database in a general fashion before attempting to write such a script unless you already know how to do it. You will also have to devlop an intimate understanding of how the map database is arranged. Even knowing how to make such a script I would put the search, that will be invalid after a future mapper update, into my scripts. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|