ChrisC wrote:
arithine wrote:
any advice on bow to accomplish that in inform? it seems to be heavily dependent on directions
A quick and dirty replacement of directional movement with room-keywords:
Code:
Book 1 - World
Front of House is a room. "You are at the front of the house. You could go [around the back], or deeper into the [forest]." The accessible rooms are {Around the Back, Forest}.
A mailbox is a fixed in place, openable, closed container, here. "You see a mailbox."
After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn."
Around the Back is a room. "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there." The accessible rooms are {Front}.
Forest is a room. The accessible rooms are {Front}.
Book 2 - Name-going to
Understand the command "go" as something new. Understand "[a direction]" and "go [a direction]" as a mistake ("You forgot your compass, oh dearie me.")
Every room has a list of rooms called the accessible rooms.
Before printing the name of a room, say bold type.
After printing the name of a room, say roman type.
Definition: a room is accessible rather than inaccessible if it is listed in the accessible rooms of the location.
Name-going to is an action applying to one thing. Understand "[any room]" and "go [any room]" and "go to [any room]" as name-going to.
Check name-going to an inaccessible room:
issue miscellaneous library message number 27 instead.
Check name-going to the location:
say "You're already there!" instead.
Carry out name-going to:
move the player to the noun.
While this does work, it would probably be better to keep directional mapping in the source code but block directional commands so the the player isn't aware of the directions otherwise the index map becomes almost useless and "best route from (object) to (object)" won't work at all.
Code:
Carry out name-going to:
move the player to the noun.
This gets the spacing wrong for going.
Code:
Understand the command "go" as something new.
This isn't enough to remove the grammar for the going action. For that, you need to do this.
Code:
Understand the commands "go", "walk" and "run" as something new.
Include (- -) instead of "Parser Letter B" in "Parser.i6t".
However, it's a lot simpler to do add a check going rule that blocks directional movement. Try this.
Code:
"Test"
Going by name to is an action applying to one thing. Understand "Go to [any adjacent room]", "Enter [any adjacent room]" and "[any adjacent room]" as going by name to.
Carry out going by name to (this is the standard carry out going by name to rule):
move the player to the noun, without printing a room description.
Report going by name to (this is the standard report going by name to rule):
produce a room description with going spacing conventions.
A first check going rule (this is the reject directional travel rule):
say "You forgot your compass, oh dearie me." instead.
The Front of the House is A Room. The description of the front of the house is "You are at the front of the house. You could go [around the back], or deeper into the [forest].".
A mailbox is fixed in place, openable, closed and a container in the front of the house. The initial appearance of the mailbox is "You see a mailbox.".
After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn.".
The Around the Back is south of The Front of the House. The description of the around the back is "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there.".
The Forest is north of The Front of the House. The description of the forest is "Here you have a very foresty forest.".
Test me with "mailbox / open mailbox / s / around the back / n / front of the house / n / forest".
Here the player will have no idea what direction to go in and will have to use the room name. A slight variation on this would be to allow compass movement when the player picks up their compass. Try this.
Code:
"Test"
Going by name to is an action applying to one thing. Understand "Go to [any adjacent room]", "Enter [any adjacent room]" and "[any adjacent room]" as going by name to.
Carry out going by name to (this is the standard carry out going by name to rule):
move the player to the noun, without printing a room description.
Report going by name to (this is the standard report going by name to rule):
produce a room description with going spacing conventions.
A first check going rule (this is the reject directional travel when not carrying the compass rule):
if the player is not holding the compass, say "You forgot your compass, oh dearie me." instead.
The Front of the House is A Room. The description of the front of the house is "You are at the front of the house. You could go [around the back], or deeper into the [forest].".
A mailbox is fixed in place, openable, closed and a container in the front of the house. The initial appearance of the mailbox is "You see a mailbox.".
After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn.".
The Around the Back is south of The Front of the House. The description of the around the back is "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there.".
The Forest is north of The Front of the House. The description of the forest is "Here you have a very foresty forest.".
The compass is in the forest. The description of the compass is "Bog standard, very useful.".
Test me with "mailbox / open mailbox / s / around the back / n / front of the house / n / forest / take compass / s / s".
Here the player can only use directional movement when holding the compass.
Hope this helps.