|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
|
|
|
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
|
|