Removing the built-in compass directions?

Hi there!

I’m making an IF story based on a starship, and I’d like to use port, starboard, fore, and aft instead of north, south, east, and west. Is there a way to remove the existing directions, or just stop understanding n, s, e, or w as shortcuts to go that way? This is what I have so far:

[ Create starship style directions]
Starboard is a direction. The opposite of starboard is port. Understand “s” as starboard. Understand “starbord” as starboard.
Port is a direction. The opposite of port is starboard. Understand “p” as port.
Fore is a direction. The opposite of fore is aft. Understand “f” as fore.
Aft is a direction. The opposite of aft is fore. Understand “a” as aft.
Index map with fore mapped as north.
Index map with starboard mapped as east.
Index map with aft mapped as south.
Index map with port mapped as west.

Instead of going north, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going east, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going south, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going west, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”

This works, but typing s prints this:

>s
Which do you mean, the south or Starboard

I’ve tried Understand nothing as going south, for example, but it doesn’t parse.

To get rid of the grammar, try:

Understand the command "north" as something new.
Understand "north" as a mistake ("Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.").

That would preclude and obviate this code which you’d want to remove:

Index map with fore mapped as north.
Index map with starboard mapped as east.
Index map with aft mapped as south.
Index map with port mapped as west.
Instead of going north, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going east, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going south, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”
Instead of going west, say “Compass directions make no sense on a starship, but you can use starboard, port, fore, and aft instead.”

You might want to also for completionism knock out northeast, southwest, etc, though up and down likely would work aboard a starship unless you’re doing something funky with directions like “gravitywise” and “antigravitywise”.

That won’t work – “north” is not a command. The actual command that triggers here is “[direction]”, a verbless command. I don’t think there’s actually any way to remove it… but you can do this:

North is privately-named.
South is privately-named.
West is privately-named.
East is privately-named.
Northeast is privately-named.
Northwest is privately-named.
Southeast is privately-named.
Southwest is privately-named.

Then typing “north” will yield “That’s not a verb I recognize”.

That won’t remove the abbreviations though. Not sure if there’s a way to remove those… you can understand them as a mistake, at least.

EDIT:

No, that code is all related to the map index, so you’ll want it even if you’re not using compass directions.

2 Likes

The example called “Fore” in the Recipe Book section of the docs describes this. It blocks the standard directions rather than removing them entirely, but you can probably adapt.

1 Like

You can also replace the section of the Standard Rules:

Section - Shipboard Directions (in place of Section 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 marked for listing or unmarked for listing. A direction is
usually unmarked for listing.
A direction can be scenery. A direction is always scenery.

A direction has a direction called an opposite.

[Define all your shipboard directions here]
The up is a direction.
The down is a direction.
The inside is a direction.
The outside is a direction.

[Define all your opposites and synonyms here]
Up has opposite down. Understand "u" as up.
Down has opposite up. Understand "d" as down.
Inside has opposite outside. Understand "in" as inside.
Outside has opposite inside. Understand "out" as outside.

The inside object is accessible to Inter as "in_obj".
The outside object is accessible to Inter as "out_obj".

The verb to be above means the mapping up relation.
The verb to be mapped above means the mapping up relation.
The verb to be below means the mapping down relation.
The verb to be mapped below means the mapping down relation.

This is the only way I know of to actually remove “north”, “south”, etc from the world model.

Of course, the simplest answer—and the one I used in both Death on the Stormrider and Endymion—is to always have your ships moving east, and allow both compass and shipboard directions. Then there’s no problem with S mapping to both STARBOARD and SOUTH.

4 Likes

Replacing a section would mean you need to redefine up, down, inside, and outside, but I guess that’s as simple as copy-pasting from the Standard Rules. Still a touch iffy though.

It’s not really iffy, Daniel did it in his code sample that replaces the section already, and it should work completely fine.

1 Like

Thanks all! I ended using @Draconis’s solution. I had to consult my local copy of the Standard Rules since the language was slightly different than what was linked. This is what I ended up with:

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

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

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

A direction has a direction called an opposite.

The fore is a direction.
The aft is a direction.
The port is a direction.
The starboard is a direction.
The up is a direction.
The down is a direction.
The inside is a direction.
The outside is a direction.

The fore has opposite aft. Understand "f" as fore.
The aft has opposite fore. Understand "a" as aft.
The port has opposite starboard. Understand "p" as port.
The starboard has opposite port. Understand "s" as starboard.
Up has opposite down. Understand "u" as up.
Down has opposite up. Understand "d" as down.
Inside has opposite outside. Understand "in" as inside.
Outside has opposite inside. Understand "out" as outside.

The inside object translates into Inter as "in_obj".
The outside object translates into Inter as "out_obj".

The verb to be above means the mapping up relation.
The verb to be mapped above means the mapping up relation.
The verb to be below means the mapping down relation.
The verb to be mapped below means the mapping down relation.

I can’t figure out how to get the Index map with code to work now that I’ve erased the compass directions, but that’s OK. Open to any suggestions if y’all have them.

As an aside, this was an incredibly quick response to my question - I haven’t spent much times on these forums but I am very grateful to see how active and helpful they are! I’ll be back for sure :slight_smile:

2 Likes

As a side note, I have no idea why I6 specifically needs access to in_obj and out_obj. I should figure that out at some point.

1 Like

It would not surprise me at all if this is just broken. In version 6H86 (not the latest, but I just so happen to have the syntax file for it), the grammar specifies that the Y in “Index map with X mapped as Y” must be the name of a direction, but that’s actually incorrect – the Y should be one of a fixed set which coincidentially corresponds to the default list of directions. I don’t think that has changed since version 6H86, so it’s probably still like that.

(This same argument applies to the Y in “Index map with X mapped Y of Z”.)

The grammar can be changed on the fly via Include (- ... -) in the Preform grammar syntax, but I don’t know if that would actually work – if the code parsing that piece of grammar still needs to look up a location by that name, then it would fail. I did give it a shot, but couldn’t get it to work.

In case someone else knows more about it, this is what I tried (together with the code in the previous post):

Include (-
	<map-direction> ::=
		north |
		south |
		east |
		west
	<index-map-sentence-subject> ::=
		eps-file |
		<direction-name> mapped as <map-direction> |
		... mapped as ... |
		<instance-of-object> mapped <map-positioning> |
		... mapped ... |
		<map-setting> set to <map-setting-value> |
		<map-setting> set to ... |
		... set to ... |
		rubric {<quoted-text-without-subs>} *** |
		...
-) in the Preform grammar.

Index map with fore mapped as north.
Index map with aft mapped as south.
Index map with starboard mapped as east.
Index map with port mapped as west.

It gives the following error:

You can only say ‘Index map with D mapped as E.’ when D and E are directions.

Which seems to indicate that either my grammar override is wrong, or the internal code is trying to look up a direction name even though the grammar doesn’t call for one.

If I could get it to work, I would’ve also overridden the grammar for <map-positioning>, but no point when the first part doesn’t even work.

SortTogether works by temporarily moving objects into in_obj or out_obj, depending on whether or not they pass the filter.

1 Like

Ha! That’s a very funny reuse of the objects.