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
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Apr 14, 2004 3:05 am   

Pathfinder map Project
 
Fed up with countless people asking me how do I get to xxxx from yyyy I wrote this thing
As it is it can be tweaked to work with any just about any mud if anyone has ideas on things I did wrong things they want to see etc just post here. also feel free to attempt to guide me in the right direction with my problem below.

------------Begin------------
#CLASS {Pathfinder}
#ALIAS AncMapfilter {#CALL %mapfilter([Zoneid]=2 OR [Zoneid]=4 OR [Zoneid]=5 OR [Zoneid]=8)}
#ALIAS pathfinder {#IF (%numitems( @pathfind.from)=1 AND %numitems( @pathfind.to)=0) {reply Please pick a more specific destination room. No Destination room found. ERROR 1x0};#IF (%numitems( @pathfind.from)=0 AND %numitems( @pathfind.to)=1) {reply Please pick a more specific starting room. No starting room found. ERROR 0x1};#IF (%numitems( @pathfind.from)=0 AND %numitems( @pathfind.to)=0) {reply Please pick a more specific destination and starting room. No Starting or Destination room found. ERROR 0x0};#IF (%numitems( @pathfind.from)=1 AND %numitems( @pathfind.to)>1) {reply Please pick a more specific destination room. Multiple Destination rooms found. ERROR 1xg1};#IF (%numitems( @pathfind.from)>1 AND %numitems( @pathfind.to)=1) {reply Please pick a more specific starting room. Multiple starting rooms found. ERROR g1x1};#IF (%numitems( @pathfind.from)>1 AND %numitems( @pathfind.to)=0) {reply Please pick a more specific starting and Destination room. Multiple starting rooms found. No destination room found. ERROR g1x0};#IF (%numitems( @pathfind.from)=0 AND %numitems( @pathfind.to)>1) {reply Please pick a more specific starting and destination room. No starting room found. Multiple Destinations found. ERROR 0xg1};#IF (%numitems( @pathfind.from)=1 AND %numitems( @pathfind.to)=1) {reply Your Directions are %pathfrom( @pathfind.From, @pathfind.To)}}
#VAR Pathfind {}
#VAR pathideas {}
#TRIGGER {^(%w) tells you, 'Era ({Anc|Med|Ind}) From (*) Dest (*)'} {Pathfind="";Pathfind.For=%1;Pathfind.Filter=%mapfilter;Pathfind.From=%mapquery( {[NAME] LIKE '%%replace( %3, "'", "''")%'});Pathfind.To=%mapquery( {[NAME] LIKE '%%replace( %4, "'", "''")%'});#CALL %mapfilter("");Pathfinder}
#TRIGGER {^(%w) tells you, 'path'} {Tell %1 Welcome to my PATH beta testing please be as SPECIFIC as possible with room names. Format is ERA Anc|Med|Ind FROM room name DEST room name;Tell %1 Example usage folows bear in mind this is BETA ideas are welcome in the form of "Tell me idea path my idea";Tell %1 tell me ERA Anc FROM The Silver Branch Inn DEST Mount Apesas}
#TRIGGER {^(*) tells you, 'idea path (*)'} {#ADDITEM Pathideas {%1}}
#CLASS 0
-----------------END---------------


Problems on my end (modified to what I NEED it to do) I for the LIFE of me cannot get %mapquery to use %mapfilter. (is there a setting somewhere for this I might have bumped)

In a new char with new settings and a new map I created 3 zones three rooms each "room one" in zone one "room two" in zone to Etc then did
#CALL %mapfilter(zoneid=1 OR zoneid=3)
#SAY %mapquery {[NAME] like '%road%'}
and it correctly uses the filter outputting 1|3

but if I try the same thing on my char/map it completly ignores the filter when using %mapquery (using #say %numrooms correctly returns the number of rooms for the filter)
so I exported my settings deleted my *.mud opened up my char made a reimported my settings opened a blank map and used zonecopy to copy my map in yet still no go here is what I am trying to do I am beginning to think my whole mapper format is corrupt

#ALIAS AncMapfilter {#CALL %mapfilter(Zoneid=2 OR Zoneid=4 OR Zoneid=5 OR Zoneid=8)}
(formated for readability)
TRIGGER: ^(%w) tells you, 'Era ({Anc|Med|Ind}) From (*) Dest (*)'
Pathfind=""
Pathfind.For=%1
#exec %2mapfilter //correctly sets filter verified using #says throughout trigger
Pathfind.Filter=%mapfilter
Pathfind.From=%mapquery( {[NAME] LIKE '%%replace( %3, "'", "''")%'}) //will capture roomkeys of rooms NOT in filter also for some reason I am noticing it treating LIKE as = and stripping the % or something '%yadda%'
Pathfind.To=%mapquery( {[NAME] LIKE '%%replace( %4, "'", "''")%'}) //Will capture room keys NOT in filter
#CALL %mapfilter("")
Pathfinder}

I wonder if I would have better luck using ADO/SQL etc for the most part
*MDAC 2.8/Jet 4.0/Zmud 7.05/Win 2ksp4*

Edit:Fixed a few typos I noticed added sys specs
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