I am trying to add shipboard directions to my i6 based game.
I have used DM4 Sections 9 and 36 and Example 9 as a reference. I am unable to facilitate port, starboard, fore and aft. DM4 mentions that it is used in Curses but I have been unable to locate the source code.
This is a sample of the code I have tried:
CompassDirection port_obj "port wall" compass
with name 'port' 'wall', door_dir w_to;
w_to works in the object definition but not port_to.
If you want to use port_to as the property name, you need to declare it first—otherwise, Inform has no idea what port_to means (since it could also be the name of an object, or an attribute, or a routine, or…).
I believe (though I’d need to test this) that the library accomplishes this with the Property directive:
Property port_to;
Alternately, if you want to save a few bytes, you can use a rather obscure trick:
Property port_to alias w_to;
This makes port_to an alias of w_to, assuming you’ll never need them to be distinct directions. (You can then block all attempts to Go w_obj by saying you don’t know which way is west, or make them line up based on the direction the ship is moving—if the ship is going north, “west” and “port” are truly equivalent.)
Yeah. Sorry. I don’t know how to post Code on these forums. I’m not sure what the command is, and < code > didn’t work very well for me. The forums likes to change things.
Type three backticks: ``` on a separate line before and after the code.
You can also use square brackets instead of angle brackets: [code]your code here[/code]
(That’s wrapped in two sets of tags, because the first set actually created a code block.)
Angle brackets get turned into HTML if possible, I think, but the code tags are Markdown rather than HTML.