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
Snedge
Newbie


Joined: 29 Jan 2003
Posts: 1
Location: United Kingdom

PostPosted: Wed Jan 29, 2003 8:21 pm   

%numrooms() doesn't work as advertised?
 
Just a quick question: According to the help files the numrooms function is supposed to return the number of the rooms in the current zone. However, it returns the total number of room in the map when I use it.

What am I missing? Someone save me from my own ignorance please. Oh, I'm using v6.40
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 29, 2003 9:27 pm   
 
The help file is incorrect. Since zMUD now uses a "zoneless" database system to store the map, there really is no way for %numrooms to return the amount of rooms in the current zone unless you put a filter on the map.

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jan 29, 2003 11:07 pm   
 
Filtering of the map can be done using the %mapfilter function. It never got into the help. When it does get in there this will be sort of what the text of the help page says.

mapfilter
Syntax: %mapfilter([SQLstring])
Sets or returns filter string for all map functions.
Example:
#CALL %mapfilter(%concat("ZoneID = ",%zonenum()))
#LOOP %numrooms {#SHOW %roomname(%mapvnum(%i))}
#CALL %mapfilter("")
The firstline sets the filter. Any database field can be filtered, and simple AND and OR combinations can be added (although AND and OR cannot be mixed in the same filter). Here, the current zone is fetched via the %zonenum function and appended to the "Zone ID = " string. Now, the second statement only performs the loop with the rooms that match the filter. The last line clears the filter so that all rooms are accessible again.

#ECHO %mapfilter
Displays the currently set filter string.
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