Moving the player.

Hi everyone,
Complete newbie here. This is my first attempt to do anything with inform 7. All I’m trying to do is move the player to a Given location. But every time I type “Move the player to location.” it will not complie and gives me the error that it can’t understand the verb? Example follows :-

JumpA is a room. The description is “Room A”.
JumpB is a room. The description is " Room B". Move the player to JumpC.
JumpC is a room. The description is “Room C”.

error message :-

Problem. You wrote ‘Move the player to JumpC’ : but I can’t find a verb here that I know how to deal with, so I am ignoring this sentence altogether. Can anyone tell me what I’m doing wrong?

See the manual: 2.17 > Review of Chapter 2: The Source Text

I know the example isn’t very practical, but I was trying to keep it simple. I’ve also tried “Now the player is in location.”. This compiles but doesn’t do anything(i.e the player doesn’t move)

When do you want to move the player to JumpC? The “move the player” command only works within a rule that tells you under what circumstances the player is supposed to be moved. For instance, you could have the player move when he tries to perform a certain action:

Instead of singing: Move the player to JumpC.

or you could have the player move when certain conditions are fulfilled:

Every turn when the player is in JumpB: move the player to JumpC.

You could even move them at the very start of play:

When play begins: move the player to JumpC.

Although if you’re going to do that, you probably just want to use a special kind of assertion that says where things are at the beginning:

The player is in JumpC. [This puts the player in JumpC at the beginning of play; it doesn't do anything in the course of play.]

Finally, may I suggest that you might find things easier to learn if you use Jim Aikin’s Inform handbook? I think some details are probably out of date, because it was written for a slightly older build, and the stuff about programming doesn’t really start till chapter 2, but it’s a much easier way to get started than by reading the Inform manuals. (You could also try Aaron Reed’s Creating Interactive Fiction with Inform 7; I’ve never tried that, myself.)

Or simply change the order of your room declarations around so that JumpC is the first room mentioned. By default, the player starts the game in the first room declared.


Thanks very much that’s solved it. What I needed was “Every turn the player is in …”. Thanks for your advice about where to learn. I’ve worked my way through “Aaron Reeds Creating Interactive fiction with Inform 7” but it didn’t cover what I was trying to do. I looked in the manual and the example they gave didn’t have “Move the Player” as part of another command but was stand alone (Chapter 8.7). But I missed the fact it has to be a thing not the player.

A point of caution… This rule was just an example and was probably intended to be used in conjuction with something else. Using this rule completely negates the need for JumpB to exist at all if not combined with some other condition.

The examples from Chapter 8.7 aren’t really standalone (they work the same way for things and for the player, in fact). They still have to be embedded in rules as in the examples I gave. If you search the documentation for “move the player” and look at all the examples it brings up, you’ll see lots of different ways that it can be embedded in different kinds of rules – some very complicated!

Also, I4L is right about the every turn rule – if you put that exact rule in the player will never get to spend any time in JumpB.

Perhaps this will show better what I’m trying to do :-

Section -[275]Giaks Fly Over

Giaks Fly Over is a room. The description is “You have followed this twisting track for about twenty minutes when you hear the beating of wings high above the trees. Looking up you see a large Kraan approaching from the north, its huge black wings casting a gigantic shadow on the trees below.
[Paragraph Break]On its back are two creatures armed with long spears. They are Mountain Giaks—small ugly creatures full of hatred and malice. Many centuries ago, their ancestors were used by the Darklords to build the infernal city of Helgedad, which lies in the volcanic wastelands beyond the Durncrag mountain range. The construction of the city was long and torturous, and only the strongest of the creatures survived the heat and poisonous atmosphere of Helgedad.
[Paragraph Break]Quickly you dive for the shelter of a large fern tree as the Kraan passes overhead. With heart pounding, you pray that your quick reactions have saved you from being spotted.”

If a random chance of 5 in 10 succeeds
Every turn when the player is in Giaks Fly Over:
Move the player to Escape The Giaks
Every turn when the player is in Giaks Fly Over:
Move the player to The Giaks Land.

Section - [099]Deeper In The Forest

South Fork is south of Deeper In The Forest.
East Fork is east of Deeper In The Forest.
Deeper In The Forest is a room. The description is “You dive into the undergrowth just as the beast screams past your head. You quickly look back to see the Kraan turning in the air in preparation for another dive. You scramble to your feet and run deeper into the safety of the forest.[Paragraph Break] As you go on you discover a forest path that divides at the point you join it. You can take the south fork or the east fork.”

												[Discipline of Tracking[067]]

Section - [345]Escape The Giaks

Escape The Giaks is a room. The description is “You pull up the hood of your green Kai cloak and hold your breath as the Kraan circles above. After a few minutes, you hear the frantic curses of the Giaks. The beating of Kraan wings fades, as they disappear towards the west. Your quick reactions have saved you from capture and likely death.From here you can return to the southward track or push through the undergrowth to the east”

Section - [074]The Giaks Land

The Giaks Land is a room. The description is “The Kraan and its riders land on the track barely ten feet from where you are hidden. The Giaks leap from the scaly backs of the Kraan and move towards you, their spears raised to strike. You have been seen. From here you can run eastward further into the forest.”

But I think your right I need to do more learning before I attempt to do this.

It looks like you’re using rooms as a sort of method to run scenes – I suppose it will work to some degree but there are much more suitable options available, most importantly the aptly named “scenes” mechanism (chapter 10 in the manual). Now if the player types LOOK in the “Escape The Giaks” room they’ll see the same action description again.

Also, you need to switch the “if a random chance of 5 in 10 succeeds” block the other way around. The conditional must be inside a rule.

Every turn when the player is in Giaks Fly Over: If a random chance of 5 in 10 succeeds: Move the player to Escape The Giaks Otherwise: Move the player to The Giaks Land.

Thanks that’s exactly what I needed. I think I’ll work through Jim Aitken’s Inform Handbook before I try any more. Thanks everyone for your help!

This has my attention.

As someone with utterly zero programming experience (past a whirlwind introduction to BASIC in fifth-grade G&T), I found the I7 docs super-accessible and easy. I had a working game (still my best one, IMO) finished in the same afternoon I installed it. It’s difficult to wrap my brain around the idea of something being even easier.

The reason it has my attention, though, is that there comes a point in the I7 docs when it drops all that “natural language” pretense and starts talking about stuff in dry-as-a-bone terms that presumably make sense to programmers but which I can’t wrap my brain around at all (my assumption is that natural-language syntax will be added to these sections later on, as the language matures). If Jim’s book might offer some assistance in those areas, that would be of serious interest.

Sounds like we’re back to the old tutorial-vs-reference conflict.

There seems to be no “conflict” of any kind in this thread.

Jim’s book is excellent for beginners. I think the problem with the documentation is that it’s a weird mash-up of a technical manual and an exploratory essay, which makes it somewhat difficult to follow along with at times. Additionally, the examples (while functional) don’t exactly break down how things are happening and why. You get an explanation of the material (in some cases brief) and are then smacked with a fully functioning example.

The nice things about both Jim’s and Aaron’s books are they they break down the examples they provide, explaining how and why things work the way they do. They also point out possible “gotcha” points and things to keep an eye out for while you’re working the material into other material.

Take the documentation for tables, for example. My head gets all sideways like Stewie Griffin when I start trying to read that stuff. That’s part of the reason I still have yet to try to tackle them with any degree of confidence.

Different people just learn differently, I guess.

That’s my experience with the Tables material, too, precisely. That’s one of the parts where the I7 docs start losing me, which (to me) is astonishing because up until then, I found them incredibly clear and informative.

Did Jim’s book clear up Tables for you? If so, I’m there. I’m sold.

Oh yeah? You wanna make something of it? :smiling_imp:

He doesn’t devote a whole lot of time to them. He does give a pretty good explanation of them and the basics of how to use them, but nothing advanced. He says, which has pretty much become my mantra:

“I’m pretty sure you can write a complete and satisfying game without ever using tables.”

This is pretty much what prompted my question on tables versus variables.

So no, he isn’t going to blow your mind on tables and their use. I haven’t got to that part in Aaron’s book yet.

Interesting. I mostly learned from the docs too (I started with an early version of Jim’s handbook), but I did it the opposite way; over a long period of having little bits of time, I read through every section and ran pretty much every example. And I certainly didn’t finish anything the afternoon I installed it; in fact, I still haven’t finished anything that has more than one room in it. [This is partly because I’m not in a big hurry and don’t work and write that fast.] Which I figure is not a great approach for most people.

Which were the dry-as-a-bone parts? If it’s the Backus-Naur form business, I don’t think you’re actually supposed to follow that. [On previewing, I see that it’s Tables. Four legs and a top, I say.]

Not just Tables. Tables are just where things start to slip and I start to skim. I’ve tried learning Lists several times too, for example (sound of deep existential screaming).

And then there are nonsense phrases like all that “repeat while running naked past upside-down in reverse” type stuff, which isn’t any sort of language, natural or otherwise. I can only use those things by aping donated code and swapping out strings.

Oh, I don’t doubt that for a moment :slight_smile: But I am, to the core of my soul, a tabletop RPG player, so tabular data is second-nature to me, and I often think in terms of tables … so it kind of bothers me that I7, an environment where I’m generally very happy and content, is an environment in which I can’t translate my tabular thinking into tabular information for a texty game. Building a table is easy-peasy (you can paste them directly from a spreadsheet into the IDE and they compile; how sweet is that?) it’s the syntax for referring to them and using them where I get utterly lost, pretty much at square one.

(Some time ago, this topic should have been split and made a new thread. :slight_smile: )

I’m working this into a game somewhere, as a salute. I swear it.

Also things I avoid. I guess this is the I6 holdover stuff for which there is no real natural transation. Reverse relations and whatnot. I guess they might make sense if explained in a “for dummies” (which I certainly feel like at times) kind of syntax, but as it is, they go so far over my head I can’t even feel the breeze.

I also cut my teeth on tabletop. (Not including gems such as Dragon Warrior, Final Fantasy and Phantasy Star.) I regularly spend my spare time staring at MySQL databases. I love tables. Maybe I’m just perceiving data access through them in I7 to be more difficult than it is. But where tables are concerned, I’m accusing to specifying the piece of data that I want and having software go get it for me. I don’t know about all this “loop through the so and so until N becomes purple” stuff.


I don’t even go near Lists. Not only do they use dynamic memory, their syntax (and even their typing) is even more bizarre and arcane than Tables. And they require punctuation!

The thing about Tables is that the syntax is almost like other I7 syntax, but not quite (repeat through the Table of Running Screaming). You can do something with “a random foozable itinerant cephalopod that fondles a humshaw,” but you can only choose a table row by comparing a single object with a single column. Plus, it’s buggy. Mantis is full of bug reports on tables that often stop authors short. I predict they will one day be a thing of beauty, though. You can’t sort “the list of cephalopods,” or “repeat with item running through every cephalopod in number of tentacles order” but you can put all cephalopods in a table and then sort it. Maybe one day you’ll be able to declare a table of cephalopods that automatically has the right number of rows.

It seems like pasteability is improving, but I don’t think it’s quite there yet, either.