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
Zwartje
Novice


Joined: 08 Feb 2007
Posts: 45

PostPosted: Fri Mar 02, 2007 8:13 am   

checking on direction in path
 
Is there a way to know in which direction a path is being executed?

Here is what I want to do:

I have a path:
mypath
5ej4n(#4 swim e);.5n

To make this also work in reverse (..mypath), I wanted to make it like this:
mypath
5ej4n(#IF <reversing> {#4 swim w} {#4 swim e});.5n

So, is there a way to check on the <reversing> part?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Mar 02, 2007 12:33 pm   
 
The easiest way to do this that I know of, besides using the mapper and having it do it for you, is to create directions for swimming. What you do is you give each direction you're going to swim a character (any, as long as it's not nesw or ud or hjkl, because they're already used) and set the command to swim in whatever direction, and set its reverse to swimming in the other direction. Then in the path, where you'd normally use nesw you use the characters you defined for swimming. If "swim e" was p, you'd set the path to "5ej4np5n" and then when you reversed the path, it would know what the opposite of "swim e" is and be able to do it for you.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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