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
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Aug 18, 2006 12:18 am   

Direct Route Speedwalks/.
 
Anyway to rather than have zmud show that the quickest route somewhere is:
ws8ws3wsws12w2s5wswsw2sws4w2s3ws6w3sw13s


Have it show
47w30s

What I really mean is somehow get zmud to do the most direct route.
A script to add how many wests, souths, easts, norths is not a viable solution because most of the times the run is thru a zone.

In the case of the above example 47w30s actually will NOT work because it runs into an area, yet 30s47w does work and leads to exactly where I need it. That just happens to be a coincidence, but it just shows what I am really looking for. I dont need se4s when 5se (or only e5s) is the most direct route.
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sat Aug 19, 2006 4:26 pm   
 
No luck?
All i wanna do is get rid of those silly pointless zigzags
_________________
http://www.Aardwolf.com
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Aug 19, 2006 8:01 pm   
 
The simplest (which, just to be clear, is not considered simple) way to derive the most-direct path rather than the shortest is to loop through iterations of %pathexpand(%pathfrom()).

The %pathfrom() function's a real pain the butt due to it needing the room key and only the room key, but outside of writing your own function that operates directly on the map database it's the only way to get a path without walking it first. %pathexpand() should change the path from normal path format to stringlist format, and from there you can use %countlist() or %dups(). %countlist() I think is more helpful since it won't delete anything.

Once %countlist() is done with the data, it becomes a simple matter to count the number of keys (direction changes) via %numkeys(), which can then be stored long with the actual path as the new "most-direct". To ensure you remove this path from consideration by ZMud's path-finder, you will have to then go through the map and set these rooms to Do Not Enter.
_________________
EDIT: I didn't like my old signature
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sun Aug 20, 2006 2:15 am   
 
well, since the zmud help files mentioned Room Key exactly once and that in the %pathfrom help can you tell me exactly what that means?

as it is i don't think any of this is any help then.
I just don't see going about setting rooms do not enter then putting them back for about 300 zones.
I just never really noticed how badly zmud writes those speedwalks before. Yeah, it's does do the best because of quickness. but sheesh, I woulda thought that it would be smart enuf to know that 3s2w3s would be the same as 6s2w and compile all that together.
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sun Aug 20, 2006 2:47 am   
 
never mind, i know what the room key is, and its what i use already anyways:

#show %pathexpand(%pathfrom(13861, 21740))
d|s|s|e|e|e|e|e|e|e|e|e|e|e|e|e|e|e|e|s|s|s|e|s|s|s|s|e|e|e|s|s|e|e|e|s|e|e|s|s|s|e|e|e|e|s|e|e|e|e|e|e|s|e|s|s|s|s
which amounts to:
d2s16e3se4s3e2s3es2e3s4es6ese4s

I took a look and did the "save path" and it came up with
.d2s16e3se4s3e2s3es2e3s4es6ese4s

Same as the whole #show up there.

Now, after checking it slowly, this is the result that I would have rather had:
.d2s10e15sw4s27e

the one west after the 15s is due to a zone being in the way.

The reason that I am looking for a script for this is because recently aardwolf went to a looping flat map. Head far enuf in one direction and barring running into any areas you can wind up back where you were.
But what this means is that where a speedwalk would take you one day, if a new area pops in in the way that speedwalk is no longer valid.
Thanks to loads of help on here from people I have this:
Code:
#VARIABLE rpTempPath {}
#VARIABLE path %walk( %1)
#VARIABLE path {~{@path~}}
#FORALL %exec( @path) {
  #IF ((%len( %i)=1) & %ismember( %i, @Runnable)) {#VARIABLE rpTempPath %additem( %i, @rpTempPath)} {
    #IF (%numitems( @rpTempPath)>0) {run %delete( %pathcompress( @rpTempPath), 1, 1)}
    #VARIABLE rpTempPath {}
    %i
    }
  #MOVE %i
  }
#IF (%numitems( @rpTempPath)>0) {run %delete( %pathcompress( @rpTempPath), 1, 1)}


I type:
sw 21740
and it will walk me to that room. But it winds up doing the exact same thing as the other directions:
run d2s16e3se4s3e2s3es2e3s4es6ese4s

So, I'm not looking for a SET speedwalk because, as long as my map is properly updated, the speedwalk the next day could be invalid.
But something that doesn't zig and zag like a drunk would be nice.
_________________
http://www.Aardwolf.com
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