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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
TiberSeptim
Beginner


Joined: 20 Jun 2006
Posts: 24

PostPosted: Thu Jan 10, 2008 11:48 pm   

Querying for Stub Exits?
 
So my map is getting fairly large - up to around 15k total rooms on -/+ 7 Z planes.

It's getting harder and harder to track down incomplete portions of the map.

Is there an easy query I can run to return exits which are still stubbed (indicating unexplored areas)?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jan 11, 2008 12:24 am   
 
It'll take a fair old while, but it's possible. Basically, you loop through every room using

#loop %numrooms {}

and use %roomvnum(%i) to convert %i into a valid vnum for a room (because you'll have deleted rooms, whose vnums aren't then reused). Once you've got the room's vnum, you can use %roomexit to query its exits, and %roomlink to query each of those links in turn to see if they aren't linked.

The final script will look something like this:

#alias SearchForStubs {#var StubRooms "";#loop %numrooms {$vnum=%roomvnum(%i);$currentlist="";#forall %roomexit($vnum) {#if (%roomlink($vnum,%j)=-2) {#additem $currentlist %j};#if ($currentlist!="") {#addkey StubRooms $vnum $currentlist}}}}

There're some posts on the forums about this, if you care to have a search.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 11, 2008 3:26 am   
 
I use this SQL query to detect stubs. I have it actually built directly in the database and check it with Access. You should be able to use it with the SpecialMapQuery function in my toolbox.
Code:
SELECT ExitTbl.ExitId, ExitTbl.ToID, ExitTbl.FromID, ObjectTbl.Name, DirTbl.DirName, ZoneTbl.Name
FROM ((ObjectTbl RIGHT JOIN ExitTbl ON ObjectTbl.ObjId=ExitTbl.FromID) LEFT JOIN ZoneTbl ON ObjectTbl.ZoneID=ZoneTbl.ZoneId) LEFT JOIN DirTbl ON ExitTbl.DirType=(DirTbl.DirId-1)
WHERE ((ExitTbl.ToID=ExitTbl.FromID) AND (ExitTbl.DirToType=11) AND (ExitTbl.DirType<>11));
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 11, 2008 4:36 pm   
 
I massaged the query above into something that works nicely with my other existing systems. This will be up in the next version of my toolbox.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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