|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sun Nov 03, 2013 3:11 pm
Distance between rooms on map. |
Hi again everyone,
Trying to work out a way for the map to return the distance between two different rooms (or from my current location to a list of rooms), returned as a number of steps. |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sun Nov 03, 2013 3:14 pm |
The reason for this is so I can workout where the closest healer is to me from wherever I am on the map. The quick get around would be to give all healers on the MUD the same room nickname/shortcut and let the mapper work out what is closest, however this would cause certain problems for various unrelated reasons.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Nov 03, 2013 6:15 pm |
Check out %pathfrom().
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Tue Nov 05, 2013 7:23 pm |
Yeah, trying out a few methods.
With that method I would need to get the pathfrom, expand it, and then count the ";" to see how many steps.
I just made an alias that changes all the room IDs of the healers to "healer" and hoped that a simple #WALK would go to closest one, aparently it doesnt... just picks a random one to travel to... odd! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Tue Nov 05, 2013 9:39 pm |
%numitems(%pathexpand(%pathfrom(, there)))
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Nov 08, 2013 7:46 am |
Keep in mind that any extra commands (open door, unlock door, etc) will be counted as a "step", too, so you may find:
Nearest healer:
unw2nwnd
2nd nearest:
open d;d;open w;w;open n;n;open n;2n
In reality, the second is actually shorter (dw3n), but because of the open doors, it'll count them as steps and seem longer. |
|
|
|
clk4suport Newbie
Joined: 21 Nov 2013 Posts: 8 Location: NOida
|
Posted: Tue Dec 17, 2013 12:49 pm |
Hi there,
okay :) |
|
|
|
teion Wanderer
Joined: 03 May 2005 Posts: 72
|
Posted: Wed Jan 08, 2014 7:47 pm |
Anyone have an idea on this? I play on the same mud as Scarn and I have a list of rooms in a string variable called healers
healers - 22754,34454 etc etc
I want to cmud calculate the distance to all the rooms in the variable and save the lowest three to 3 aliases - heal1, heal2, heal3
I'm not exactly sure how to make cmud do the math for this. Somone mentioned using the pathfrom command. so maybe i could use that in a loop to calculate steps and then save the lowest ones. |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Mon Feb 03, 2014 3:21 pm |
I figured it out Teion, I'll give you a shout on the MUD to help you.
|
|
|
|
|
|