How to add Left/Right/Up/Down navigation relative to world?

I’d like to replace the compass navigation as follows:

  1. North with up
  2. South with down
  3. East with right
  4. West with left

I’ve seen someone add left/right navigation but relative to the player. I need the navigation to remain absolute, ie. relative to the world.

Is there a way to do this?

Many thanks,
ps. apologies is this is (1) a fundamentally dumb question and/or (2) answered elsewhere

One (rather heavy handed) way to do this would be to replace the Directions of the Standard Rules. You could try this, but it may well lead to problems.

Section 1 - Directions  (in place of Section SR1/4 - Directions in Standard Rules by Graham Nelson) 

The specification of direction is "Represents a direction of movement, such
as northeast or down. They always occur in opposite, matched pairs: northeast
and southwest, for instance; down and up."

A direction can be privately-named or publicly-named. A direction is usually
A direction can be marked for listing or unmarked for listing. A direction is
usually unmarked for listing.

A direction has a direction called an opposite.

Include (-
	has scenery, ! class CompassDirection,
-) when defining a direction.

The north is a direction.
The south is a direction.
The east is a direction.
The west is a direction.
The up is a direction.
The down is a direction.
The inside is a direction. The inside is publicly-named.
The outside is a direction. The outside is publicly-named.

North has opposite south. Understand "up" and "u" as north.
South has opposite north. Understand "down" and "d" as south.
East has opposite west.  Understand "left" as east.
West has opposite east. Understand "right" as west.
Inside has opposite outside. Understand "in" as inside.
Outside has opposite inside. Understand "out" as outside.
Up has opposite down.
Down has opposite up.
The inside object translates into I6 as "in_obj".
The outside object translates into I6 as "out_obj".

Note that this will work beautifully, but you still need to use the names “north”, “south”, etc in your code, and they’ll be printed as “north”, “south”, etc if you ever print their names directly (e.g. in describing NPC movements).

You probably don’t need to do something that heavy-handed, though. You can just define left and right as new directions (up and down are already defined):

Left is a direction. Right is a direction. Left has opposite right.

and then it might be as simple as using these directions instead of n/s/e/w:

[code]Left is a direction. Right is a direction. Left has opposite right. Right has opposite left.

Attic is a room. Garret is above Attic. Upper Hall is below Attic. Bedroom is left of Upper Hall. Bathroom is right of Upper Hall. Lower Hall is below Upper Hall. Kitchen is left of Lower Hall. Living Room is right of Lower Hall.[/code]

If you want, you can intercept an attempt to go in a compass direction:

Before going when the noun [in this case, the direction] is not navigable: say "You can only go up, down, left, or right." instead.

or redirect an attempt to go in one of these directions:

Instead of going north: try going up. Instead of going south: try going down. Instead of going east: try going right. Instead of going west: try going left.

You may want to let players use one-letter commands to navigate left and right. If you do, you’ll have to redefine “l”, which is already mapped to “look.” (Players might get annoyed by this, fair warning.)

Understand "r" as right. Understand the command "l" as something new. Understand "l" as left.

These solutions won’t take care of it if you need to do anything other than go in a direction (“examine left wall” or something like that), but they might be less drastic than jrb’s.

jrb, Draconis and matt w,
Thank you so much for your suggestions. I’ll try them this weekend.

The reason I want this (peculiar?) system of navigation is to model 2D knowledge maps, such as the Periodic Table, where left/right/up/down makes more sense than compass directions.


Did you try the “Directional Facing” extension by Poster?