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
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Mar 03, 2005 7:34 pm   

#CALL %mapfilter question
 
In an older version of zmud I had this code and it worked perfectly.
Now in the newer version for some reason it works, but if i change zones, it don't work, and i need to close the mapper which results in an error, and then open it again to run it.

Code:
#CALL %mapfilter(%concat("ZoneID = ",%zonenum()))
#LOOP %numrooms {#echo RoomNum %roomnum( %i) Room: %roomname( %i) SW: %walk( %mapvnum( %i))}


Any ideas?
_________________
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Mar 04, 2005 3:36 pm   
 
The problem is probably %i
In the new version this got set back to it's real meaning (which I don't know)
but just replace all of your %i with %repeatnum
that shouuld do the trick, let me know.
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Fri Mar 04, 2005 5:07 pm   
 
Nope, don't make a diff.

Type:
search

result:
....
RoomNum 14662 Room: The Aardwolf Plaza Hotel SW: .e;.(aard)

change zone and type:
search

result:
RoomNum Room: SW:

Close map & get an error box saying invalid pointer error or the access application error in zmud.exe type of things.
and while the search is running anyother triggers always give invalid pointer errors as well, and at times prevent me from shutting down the mapper and zmud. need to end process in task manager

All i really want is something that shows from where I am standing in an area, the vnum that you can assign under the "Other" setting in the mapper, the room name and the SW.
_________________
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Mar 04, 2005 5:45 pm   
 
It looks like after changing zones the loop fires once even though it doesnt return any valid info, so I thought the %numrooms value is probably off.
I tried this :
Code:
#CALL %mapfilter(%concat("ZoneID = ",%zonenum()))
#ECHO numrooms:%numrooms
#LOOP %numrooms {#echo RoomNum %roomnum( %i) Room: %roomname( %i) SW: %walk( %mapvnum( %i))}


now as you said it works for the first zone but whenever I changed zones I got this:
numrooms:-1
RoomNum Room: SW:


A you can see the numrooms value is all wrong.
Ater fooling around a bit I found that if you called mapfilter with an empty string, before calling with the actual string you want. this doesn't happen.

Code:
#CALL %mapfilter("")
#CALL %mapfilter(%concat("ZoneID = ",%zonenum()))
#ECHO numrooms:%numrooms
#LOOP %numrooms {#echo RoomNum %roomnum( %i) Room: %roomname( %i) SW: %walk( %mapvnum( %i))}


The above code works no problem when I switch back and forth between
the zones in the sample map database.

[edit] as it turns out in the mapfilter help it refers to this:
To clear the current filter and return to using all rooms in scripts, use a null string for the filter.
[/edit]
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Sat Mar 05, 2005 6:31 pm   
 
Works one HECK of a lot better now in that changing zones will give me info. But still having the error when I close the mapper after changing zones:
The #'s and letters change each time. And if i close the mud down my .mud file fails to save, and i get errors in zmud.exe


The other thing is that i'm getting rooms that don't belong in the zone & wrong room names:
Code:
RoomNum 39 Room: Sunrise SW: .9nw          <--- right zone wrong name
RoomNum 40 Room: BLACK SQUARE SW: .9n2w    <--- wrong zone
RoomNum 41 Room: WHITE SQUARE SW: .9n3w    <--- wrong zone
RoomNum 42 Room: Sunrise SW: .9n4w         <--- right zone wrong name

Verification:
.9nw
Wyrm street
Exits: e, w
w
Wyrm street
Exits: e, w
w
Wyrm street
Exits: e, w
w
Wyrm street
Exits: e, w
And some blanks as well:
RoomNum Room: SW: .4n2w
which btw, is labled on the map.
.4n2w
Diamond Street
Exits: e, w

Must be missing something else :(
Be nice if the mapper could just do a nice neat dump into a file, but betting that that would be a zmapper function.

Also, and prolly the best, would be, any way to get this modified so that when standing in one room (like recall) you could get ALL the speedwalks to all the rooms in ALL the zones?
That would be like search2 :)
_________________
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Mar 07, 2005 10:55 am   
 
You need to use the %mapvnum function to convert the %i values into actual mapper values.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Mon Mar 07, 2005 4:20 pm   
 
Holy crap, that works SLOW!
Outputting about 2 rooms a second.
But at least it's working :-)
Thanks! Even tho i still get the same errors when i close the map etc..

Now, any idea about outputting all speedwalks to al rooms in all zones from one starting room?
_________________
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Mar 07, 2005 5:32 pm   
 
Quote:
Now, any idea about outputting all speedwalks to al rooms in all zones from one starting room?


Code:
#ALIAS allpathsfrom {#call %roommode(1)
#CALL %mapfilter("")
#echo starting from roomnum:%1
#LOOP %numrooms {#va rkey %mapvnum(%i);#echo pathto(@rkey): %pathfrom(%1,@rkey)}
}


just pass in the mapvnum of the room you're starting from
I set %roommode to 1 cuz well frankly it doesnt work the other way
even though help roommode to me indicates otherwise
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Mar 07, 2005 6:06 pm   
 
Quote:
Holy crap, that works SLOW!

I'm not sure if you're doing this or not, but you may wish to cache the value returned from %mapvnum
instead of calling %mapvnum repeatedly in the same loop,
%mapvnum probably uses an ADO query to find the vnum, should be faster to just retrieve the value from a variable.
I dont use the mapper so I'm only working with the sample maps
If you have a huge map database it will probably make a big difference.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Mar 07, 2005 6:45 pm   
 
You could try compacting/repairing your database to see if that alleviates some errors and slowness http://www.zuggsoft.com/files/jetcu40.exe
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Mar 10, 2005 4:41 pm   
 
Dharkael wrote:

Code:
#ALIAS allpathsfrom {#call %roommode(1)
#CALL %mapfilter("")
#echo starting from roomnum:%1
#LOOP %numrooms {#va rkey %mapvnum(%i);#echo pathto(@rkey): %pathfrom(%1,@rkey)}
}

Far as I can tell works great :-) thanks!
_________________
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Mar 10, 2005 4:42 pm   
 
Dharkael wrote:
Quote:
Holy crap, that works SLOW!

I'm not sure if you're doing this or not, but you may wish to cache the value returned from %mapvnum
instead of calling %mapvnum repeatedly in the same loop,
%mapvnum probably uses an ADO query to find the vnum, should be faster to just retrieve the value from a variable.
I dont use the mapper so I'm only working with the sample maps
If you have a huge map database it will probably make a big difference.

I'll assume ya meant like u did in the allpathsfrom alias?
I'll give it a shot. thanks!
_________________
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Mar 10, 2005 4:43 pm   
 
nexela wrote:
You could try compacting/repairing your database to see if that alleviates some errors and slowness http://www.zuggsoft.com/files/jetcu40.exe

Actually, i've used the one that is IN the mapper, and used Access' repair and compress feature as well.
_________________
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Mar 10, 2005 9:39 pm   
 
You might want to give the %mapquery function a try. This will require %roommode to be set to 1 to work with the return values, but may yield a slightly faster result.
_________________
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 » 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