Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
BenevolentCow
Newbie


Joined: 27 Jan 2005
Posts: 2

PostPosted: Tue Oct 04, 2005 9:02 am   

Exits in map database
 
So I am trying to set up a system that finds the room I am in more effectively than the find command in the mapper does.

I currently have it that it will sort through the names of rooms, and if it is a unique room name it moves there, then it goes onto description and if it is unique description it moves to there. But sometimes there are rooms without a unique room name or description, but have unique exits. Such as room 'On the Savannah' might have exits north and south, while another might have ones south and east.

I am trying to find the exits in the database so I can call them in a %mapquery, but I cannot seem to find where they are located in it. Could anyone help please?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 04, 2005 6:07 pm   
 
This will be very difficult. Exits are not stored with the rooms. Exits are stored in their own table (LinkTbl) with From and To fields that point to the room records that the link connects. So, to find the exits from a room, you basically need to do a query of the LinkTbl for records where the From field matches the current room id. The %mapquery function won't do this. You'd have to perform your own low-level query of the database using COM objects, which will be difficult.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 05, 2005 12:12 am   
 
As Zugg stated, %mapquery will not help you directly. There is no possible string you could enter into it that will produce the results you want. What you will have to do is take the returned list from your results of name and description both matching and manually check the exits in those rooms. I would suggest you do this with something like:
ProbableRooms=""
#FORALL @QueryResults {#IF (%sort(%roomexit(%i))=%sort(@RoomIAmInExits)) {#ADDITEM ProbableRooms {%i}}

You can then look at a count of the results. In some rare instances you may have to look at surrounding rooms and see if they match your previously recorded room. For this I would suggest actually recording it through the onroomenter special alias.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Oct 05, 2005 12:16 am   
 
i always wondered this as well, when using #find why does it not check to see if the exits present are the ones the mapper relocates you to?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net