James Purcells never ending question list.

I have a few question and need some help please.

Q1: I would like to have the player start in a carriage that stops outside a house. I would like the player to exit the carriage to start, but I can’t quite grasp writing this bit.

Q2: Scenes? - If a scene is placed, can it be used to take the player from one room to the next?

Q3: How does one write stairs as I can’t get them to work. How do I set it so that the player types “Climb Stairs” instead of “UP”?

Well that’s it for now. I am reading through the guides and books but still confused.

I’m new at this and quite possibly know less than you do about how to manage Inform 7.

That being said, I’ve managed to get something working for Q-2 and Q-3 without much trouble. Tip - get the hang of how rulebooks function as soon as possible. ifwiki.org/index.php/Inform_ … ust_Action It would have made my life a lot easier if I’d grasped some of these more quickly. In the case of the stairs, the idea is to block the usual rule of going to a room that’s connected to the room you’re in with an “instead” comment - which gives the player text rather than movement - and then defining a totally new action whose result is to put the player in the room you want them to be in. Although someone more sophisticated than me will have to figure out how you define climbing down the stairs in such a way that your code can parse “climb stairs” in either direction.

The recurring scenes stuff is handled in the textbook pretty clearly though.

The Big Room is a room. The Small Room is a room. The Round Room is a room. The Round Room is above the Big Room. The description of the Big Room is “There is an inviting staircase here that beckons you upwards.” The staircase is scenery. There is a staircase in the Big Room. The description of the staircase is “Just climb the stairs already.”

There is a MacGuffin in the Big Room.

CD flashback is a recurring scene.

CD flashback begins when the player carries the MacGuffin.

When CD flashback begins:
say “This is where you chat about what’s happened to the player”;
move the player to the Small Room.

CD flashback ends when the time since CD flashback began is 20 minutes.

When CD flashback ends:
say “Some more text for your player.”;
now MacGuffin is in the Big Room;
move the player to the Big Room.

Instead of going up from the Big Room:
say “Would you like to climb the stairs?”

Randoming is an action applying to nothing.

Understand “climb stairs” or “climb the stairs” or “go up the stairs” or “slowly drag one’s weary self up the staircase” as randoming.

After randoming:
now the player is in the Round Room.

Instead of randoming when the player is in the Small Room:
say “There are no stairs in this room.”

This is bad practice. You’re bypassing the parser’s synonym machinery and trying to think of every possible noun-verb phrasing yourself. You will fail.

“Climbing” is already a standard action in the library, so you just need a rule for climbing stairs. (Also, you should probably continue to allow “up” – players expect it to work.)

It may be sufficient to define the stairs object as a door.

This is the code I have now

A staircase is a kind of door. A staircase is usually open. A staircase is seldom openable. Understand "stairs" or "stair" or "staircase" as a staircase. Understand "upstairs" or "downstairs" as a staircase. The description of a staircase is usually "staircase leads up from the Lobby to the Landing." 

But the game ignores it (it compiles without issue) and I have to use up or down to get from Lobby to the Landing.

This is the full blocks.

Lobby is north of the Entrance. The description is "The Doorman showed you into the lobby of Professor Grey's Mansion. To the east is the professors study, to the west is the dining room, to the northwest is the entrance to the kitchen and infront of you is a  staircase leading to the landing."

A staircase is a kind of door. A staircase is usually open. A staircase is seldom openable. Understand "stairs" or "stair" or "staircase" as a staircase. Understand "upstairs" or "downstairs" as a staircase. The description of a staircase is usually "staircase leads up from the Lobby to the Landing." 

Landing is up from Lobby. "Corridors lead east and west from the staircase to various rooms. Professor Greys Doorman leads you down a corridor to the west and stops outside a room to unlock it."

I think your problem is that you’ve defined what a staircase is – a specialized kind of door, but you haven’t actually instantiated one anywhere.

Try something like this:

Lobby is north of the Entrance. The description is "The Doorman showed you into the lobby of Professor Grey's Mansion. To the east is the professors study, to the west is the dining room, to the northwest is the entrance to the kitchen and infront of you is a staircase leading to the landing."

A staircase is a kind of door. A staircase is usually open. A staircase is seldom openable. A staircase is usually scenery. Understand "stairs" or "stair" or "staircase" as a staircase. Understand "upstairs" or "downstairs" as a staircase.

Before climbing a staircase:
	try entering the noun instead.

The lobby staircase is a staircase. The lobby staircase is up from the Lobby and down from the Landing. The description of the lobby staircase is "The lobby staircase leads up from the Lobby to the Landing."

Landing is a room. "Corridors lead east and west from the staircase to various rooms. Professor Greys Doorman leads you down a corridor to the west and stops outside a room to unlock it."

Test all with "x stairs / u / d / climb stairs / g / go upstairs / go downstairs".

(I’m more of an I6 than an I7 person at the moment, so maybe one of the more experienced I7 people can jump in with corrections if needed.)

Note that there is still an issue where “go downstairs” will take you up the stairs if you’re in the lobby because it’s understood simply as “go staircase”. A more robust staircase implementation would perhaps define upstairs_to and downstairs_to properties and use them to handle “go upstairs” and “go downstairs” properly and to customize the description based on the location.

Some improvement on the above staircase code:

Using is an action applying to one visible thing. Understand "use [something]" as using. Instead of using anything (called the target), say "You can't use [the target]" instead.

A staircase is a kind of door. A staircase is scenery. A staircase is usually open. A staircase is seldom openable.
Instead of taking, using or climbing a staircase (called the stairs): try entering the stairs instead.
Understand "stairs/stair/staircase/steps/upstairs/downstairs/staircase" or "stair case" as a staircase.

I have to question the upstairs/downstairs thing though because what if the player is upstairs and types the command “go upstairs” and the staircase takes them downstairs instead? That would seem to introduce two bugs in the game code. It could be worked around with the “Does the player mean…” method/rule. Also, maybe the “Instead of taking…” line shouldn’t use “taking” (which I’ve added) but some players will likely use the “take the stairs” to mean go up or down the stairs. Since “get stairs”, in this case, would cause an unexpected result, maybe it’s worth excluding it as an option. Then again how logical is it for a player to want to “get stairs”?

… as for the coach gradually arriving somewhere (and by the way try exiting the coach while it’s still moving in the following example), how about this turn based method?

Stage Arriving is a scene. Stage Arrived is a scene.

The Desolate Desert is a room. "A vast empty desert stretching on for miles and miles."

The stage coach is a vehicle in the Desolate Desert. Understand "stage coach/wagon/vehicle/cabin" as the Stage Coach.

Outside Post Office is a room. "A few weathered support beams hold up the awning in front of the post office with horses tied up to them beside some old wooden troughs. The street is bustling with the traffic of wagons and men on horseback. The post office door is to the west. Across the street to the east you see a general store."

Instead of exiting when the player is in a vehicle and the location is not Outside Post Office:
	say "You should wait until the coach comes to a stop." instead.

Stage Arriving begins when the player is in the stage coach for the first turn.
Stage Arrived begins when the location of the stage coach is Outside Post Office.

When play begins:
	now the player is in the Stage Coach;
	now the Stage Coach is locked.

Every turn:
	If the scene is Stage Arriving:
		If turn count  is two:
			say "The coach rumbles along towards a town off in the distance.";
		else if turn count is three:
			say "The coach is nearly to the edge of town.";
		else if turn count is four:
			say "The coach wheels rumble along as it enters the town of Dry Gulch. You see a shootout off in the distance.";
		else if turn count is five:
			now the stage coach is in Outside Post Office;
			say "The coach pulls up outside the local post office.";
                        silently try the player looking.

Note that you could probably create different rooms to move the coach to along the way using the “else if turn count is five” snippets and modifying them for other turn count checks. I just opted not to do that in this example as it seemed like a waste of room objects just for scenery (and I know Inform seems to have a limit unlike certain other IF programming languages, at least for the Z-code compiled stuff). Also, I try to avoid using real world timers and opt for counters or turn checks instead as in the past my beta testers for my games have told me they hate actual timers (especially if they played through the game more than once and know what’s ahead already). With the above code you can just keep hitting the enter key (or Z, then enter) over and over again to progress to the next scene (stage coach arriving). This puts the game world somewhat back in the player’s hands rather than forcing them to wait on a timer.

I’ve only just started learning Inform 7 myself but I’m catching on fast. So far I’ve mainly coded games in Tads 3 (my area of expertise) but under a non-real user name (unlike here) on the TF-Games website for years. Been a computer programmer practically all my life so going from one language to another’s not really too much of a problem. If you have any more questions or help on how to do things in Inform 7 (or even Tads 3, Quest, Adrift, Twine, Java, C++, DarkBasic, etc.), let me know.

  • Bill Chelonis

Thanks, stairs now working.

Oh, didn’t think about that. the carriage will be referenced 3/4 times.

You can finesse this with code like (untested):

Understand "upstairs" as the lobby staircase when the player is in the Lobby.
Understand "downstairs" as the lobby staircase when the player is in the Landing.

I wouldn’t worry about this. It’s not worth the effort of dividing the verb “take” from “get”.

That works but… beta testers especially will find fault with it eventually with such things as “look upstairs” or “feel upstairs”, etc. testing actions on nouns they discover and then reporting it to the author as a bug.

Yeah, I agree. Keep it out of the game even though we use it in our language. i.e. “The elevator’s broke. Let’s take the stairs.”

No, I don’t expect they will.

Then if you want to use the coach again to get somewhere else you’d need to create a new scene and define when that scene starts to get the coach moving somewhere else again. I’d use a counter object in that case to track and report it every turn. For example, you could begin a new scene from my above stage coach example once the player enters the coach with a ticket to another town (perhaps a “ticket to Deadwood” for instance). Then have the “Every turn:” method check for the scene “Travelling to Deadwood” and report and increment a counter. If you’d like an example of this let me know but it should be easy enough to implement.

“Instead of taking, using or climbing”

Doh! I absolutely did not know you could use this syntax. I have been splitting this out over multiple Insteads. Slaps self.
Now I know. My code will be shorter.

Thanks.

Ade.

Thanks all, I’m still learning how to translate my book into the game.

How is speech printed if “” is used for defining something?
Sorry can’t quite understand the instructions.

The quote marks here are being used to set the code apart from the post around them. In your source code, text in quotes is strings.

There is an example of printing speech in the Inform 7 documentation §5.2. How Inform reads quoted text:

Doh, it really is as simple as using single marks.
No wonder I couldn’t understand.

Another 2 Questions, but this time concerning the source.

Is there a way to add comments into source that will be ignored by the compiler?

How would one add a guide book to the game i.e.

Of which it contains commands needed to play and a brief explanation of the game.

The answer is in chapter 2 of the documentation (available from the documentation tab in Inform 7), §2.3. Punctuation:

A guidebook is a bit more involved. You could simply write all the necessary directions in the description of the object. For example:

The player carries a guide book. The description of the guide book is "The entrance to the dungeon can be found outside the town. Adventurers can apply for a quest at the town hall. The general store provides for all your equipment needs. Be sure to visit the temple for a blessing."

Players can read the guide by examining it. By default, the action ‘read’ is aliased to ‘examine’ - so “read guide book” will work too.

Thanks, I’m struggling to read the manual as I loose concentration after a few minutes

Rather than a guidebook if it’s guiding the progress of the player, rather than mechanical rules, I always prefer interaction with a character or something…

The Grizzled Veteran is a person in Outside Post Office. "A grizzled old veteran sits in a rocking chair on the porch.[first time] 'Arr 'tis good to see a new face in these parts. Find ye the entrance to the dungeon outside.....etc....[only]".

Or along those lines.