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


Joined: 09 Jul 2005
Posts: 9
Location: Oklahoma

PostPosted: Sat Aug 20, 2005 11:04 am   

Walking to rooms with the same name
 
Hello,

On the MUD that I play, there are shrines in different rooms and zones in which to offer corpses to a God. However, if you give each the same name, the automapper will only walk to a specific room in the MUD, not the closest room with that name. Is there a way to get around this without having to name the differerent rooms different things?

Thanks,
Saigne
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Aug 20, 2005 3:55 pm   
 
You could use the vnums, but I don't do a lot of mapper work so I couldn't tell you how to set that up and get it working.
_________________
EDIT: I didn't like my old signature
Reply with quote
Saigne
Newbie


Joined: 09 Jul 2005
Posts: 9
Location: Oklahoma

PostPosted: Sun Aug 21, 2005 6:37 am   
 
Then, however, I would have to know the VNUM for the closest shrine... That would be a little tricky.
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sun Aug 21, 2005 2:38 pm   
 
You could just assign your own vnums (numbers of your choosing)? Doesn't really matter if it's the real vnum... Or, if all you are interested in is the Shrines, simply append the room names with -1 -2 -3 etc? You'd keep the room names essentially intact, while distinguishing betweeen them easily... (alternatively could put -(godname) or whatever, for even better distinction)?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Aug 21, 2005 4:46 pm   
 
::whoopsie, clicked the wrong button::
_________________
EDIT: I didn't like my old signature
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sun Aug 21, 2005 8:06 pm   
 
It looks more like what he wants is a script with an alias like 'goshrine' and this script will calculate the closest shrine and use it.

Is there a way in a script to calculate # of steps to x from y in zmud? I'm sure there is, researching to see if i can write this, prolly some guru will beat me to it :P
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 21, 2005 8:42 pm   
 
Use %len %pathexpand and %walk. You will likely have to scan the %roomid of rooms before hand (this can be done with %mapquery) and use vNums in your %walk. It would be a walk in the park for me, but it has actually been done many times before and searching the forums is a better answer.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sun Aug 21, 2005 8:45 pm   
 
Here's a script that works from what I've tested:

Code:

#CLASS {Walk Shrine}
#ALIAS walkshrine {
  #VARIABLE walkroom {%item( @shrinelist, 1)}
  #VARIABLE walklength {%numitems( %pathexpand( %walk( %item( @shrinelist, 1))))}
  #FORALL @shrinelist {
    #IF (%numitems( %pathexpand( %walk( %i))))<@walklength) {
      #VARIABLE walklength {%numitems( %pathexpand( %walk( %i)))}
      #VARIABLE walkroom {%i}
      }
    }
  #WALK @walkroom
  }
#VARIABLE walklength {}
#VARIABLE shrinelist {}
#VARIABLE walkroom {}
#CLASS 0



After you put it in, you'll need to populate the @shrinelist variable with all the vnums of all the shrines. After that, just "walkshrine" to automatically go to the closest one.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sun Aug 21, 2005 8:49 pm   
 
heh, Vigilante posted while I was putting up my script.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sun Aug 21, 2005 9:26 pm   
 
I wanna adapt this to a gonext script and auto populate shrinelist(roomlist) from mapper lookup of roomnames via:

Kill at least 2 * A diva (Outside a great crack in the willow's trunk).
Kill at least 1 * Armus, the Oil Slick (A Commonly used Path ).
Kill at least 1 * the desk clerk of Hotel Royale (Entering Hotel 'Royale').
Kill at least 2 * a fisherman (A Castle).
Kill at least 1 * Larry (A Cold Path).
Kill at least 1 * a guard dog (The Midget's Tiny Trailer).
Kill at least 1 * the flowing water (Before a Waterfall ).

That would be spiffy on the mud i play if it will handle special directions, room scripts, doors, etc.
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