Inform 7 game dev making an interactive horror fiction.Posting helpful walkthroughs for Inform 7 to help others learn where I struggled. Starting from the beginning with How to Build A Room, and moving on from there. Let me know if there's a topic you'd like to see covered!
Don't wanna be here? Send us removal request.
Text
˙⋆✮ Ask About [Something] ✮⋆˙
You may have seen in an older post I talked about using "ask about [something]" as a command. Turns out, it's not as simple as it seems. But I've found a workaround in the documentation and I'm going to show you how it works.
This is a really interesting command to get working, I think. You see, it requires a bit of a different way of writing its definition for usage.
Inquiring about is an action applying to one visible thing.
Understand "ask about [any subject]", and "ask about [any room]" as inquiring about.
A subject is a kind of thing.
The note 1, the blue potion, the fur cloak, the lantern, and the cell phone are a subject.
See how we've worded things? It's a bit different than we're used to
This is directly out of my IF «A Snowy Night», in which I wanted the player to be able to ask NPCs about the items they carry, and perhaps things mentioned in the NPC's dialogue. Notice how the verb we use is To Inquire, but the examples we give Inform 7 are To Ask. Inform doesn't care that they are two different verbs, because you're telling it not to care.
You'll also recall how I once told you to keep your custom commands fairly simple, yet here we've incorporated "about" into the verb definition. I'm not 100% sure on this part, but in my experience to this point with Inform 7, it seems that any definition ending in about or with is recognized properly by Inform 7 and can be printed successfully. I'm uncertain if there are further qualifiers you could use beyond these, but if you find some, let me know! I'd love to learn more.
Continuing our breakdown of that series of statements, let's look at the statement A subject is a kind of thing. A Thing is meant to be any noun, it seems. Let's say you have a room called Bedroom which contains a mug of coffee. The mug of coffee is a thing. In fact, that's a proper statement.
Let's talk about why that's important and how that works for dialogue later with NPCs. What we're doing is designating things so that Inform 7 knows that they are meant to be talked about by the player in this context. Remember we wrote "ask about [any subject]". Now we've said A subject is a kind of thing so that Inform 7 understands what you mean by [any subject]. Now, you have to designate what objects you wish to allow your player to use with the action >ask about [the noun/the subject]. In my case, I needed the player to be able to ask about any item they are carrying on them, so I have said The note 1, the blue potion, the fur cloak, the lantern, and the cell phone are a subject. The note 1, the blue potion, the fur cloak, the lantern, and the cell phone are all items carried by my player at some point during the game. This list will grow as I create more items for the player to carry.
Now, it is VERY IMPORTANT to designate something specific for this command, like a location where the command may be used. What I mean is this:
Instead of inquiring about the note 1 in the Wider Path: say "long journal entry."
What we've done is limited the action to being used only within the room called the Wider Path. You can do this with any room you've created.
You could also make it conditional on an item being carried by the player:
Instead of inquiring about the note 1 while the player is carrying the journal: say "'Where did you find that?' asked the man."
The reason you want to ensure you limit where or when these items can be asked about is because you want to prevent the player from being able to >ask about the note while in a room without an NPC and return an answer meant to be said by one specific person.
This method of >ask about [the noun] does not allow for >ask Jeff about the note, you cannot specify who you're asking.
So, to summarize, define your ask about it statement (Inquiring about is ...), state the definition of the subject, then define your subjects. Remember, anything you don't define as a subject cannot be asked about! The only thing you don't have to identify as subjects are Rooms, as those are already their own thing and also, we accounted for that by stating "ask about [any room]". That said, if you don't provide a response for Inform 7 to print about the noun or the room, it will return nothing when the player asks about it.
#gamedev#indie#indiegame#inform 7#inform7#solodev#tutorial#walkthrough#dialogue#ask#ask about#ask about something#ask about it
5 notes
·
View notes
Text
˙⋆✮ Keeping Your Code Clean ✮⋆˙
So you've probably noticed by now that your code can start to get really, really messy, quite fast. It's important to keep your commands organized and neat for both your own sanity when trying to read it, and for the sake of the program when trying to print it. Let's talk about some ways to keep your code clean and organized.
Make use of headers
There are a few different types of headers you can deploy in your code to help you navigate your code as it lengthens. Let's break them down:
Volume Book Part Chapter Section Any sentence that starts with one of these words becomes a heading by default, and as far as I know there is no way around this, should that be what you're looking for for some reason.
Headers run in order of importance from the top to the bottom of that list, with Sections being the least important (though still important. I work almost exclusively in Sections for my IF «A Snowy Night».)
To use them effectively, start thinking about how you could divide and organize your code. Perhaps your novella is broken down into three parts, with multiple chapters. You could write this by titling your sections as follows:
Part 1 - The Beginning
Chapter 1 - A Small Village
[ Tiny Hut]
There is a room called Tiny Hut.
Chapter 2 - The Path
[ The Path 1 ]
There is a room called the Path 1.
Part 2 - The Adventure Begins
Chapter 3 - Bathurst City
[ City Entrance ]
There is a room called City Entrance.
Now, when you have those headings in your story, you can use the Contents button (to the left of the Source button above your editor. If you cannot see it, press the left arrow to the right of the Source button) to navigate the headings and display only content within those headings, like so:
Notice how in the second screenshot, we have the bottom slider dragged all the way to the right. This will reveal all heading types listed above. If you want to exclude any of them from the bottom of the list up, drag the slider left by one interval at a time.
And in the third screenshot, I have selected the header Part 1 - The Beginning from the Contents menu, and it is now showing me only the code within the Part 1 header (pressing Go or Replay will sill print the whole game.)
2. Keep everything on a single line
That doesn't mean press Enter mid-sentence to put the overflow onto a new line. That means whenever you have a new sentence to write, put it on its own line.
Instead of:
There is a room called the Bedroom. The Bedroom is north of the Hallway. The description of the Bedroom is "Your small, yet cozy bedroom."
Write this instead:
There is a room called the Bedroom.
The Bedroom is north of the Hallway.
The description of the Bedroom is "Your small, yet cozy bedroom."
The reason being is that it keeps everything clean and easy to read. Imagine how messy that would get if your room contained three backdrops, five sceneries, and a container full of items! (I'm guilty of this when I was getting started ^-^' ) And if it's hard for you to read, imagine how Inform 7 must feel trying to sort all that out.
3. Make use of [ ] headers
Anywhere in your code, outside of quotes, you can use square brackets to create a heading that the game will not print in any way. You can put whatever information you want to within those brackets. It's a great way to label your rooms, or sections of code at the start of your story that apply to the whole game, for example.
Here's an example of how I make use of square brackets in my story «A Snowy Night»:
I use them both for labelling sections of code that are related to each other but do not apply to specific rooms (screenshot 1,) and as headers for my rooms (screenshot 2.)
These cannot be sorted in the Contents menu, but do show up as a lovely green in the editor, which makes them stand out when you're scrolling. You can also use CTRL + F to search within your code for your header names, if necessary.
The reason you cannot use these headers within quotes is because any square brackets within quotes are treated as text substitutes. You could write:
Instead of taking in the Bedroom: say "You put [the noun] in your pocket."; now the noun is on the player.
Notice how [the noun] becomes purple when within quotes. Notice also how we didn't write now [the noun] is on the player., because this would have turned [the noun] into a header, not an object. Outside of quotes, Inform 7 recognizes the noun as a substitute on its own.
Next up, I think we'll look into implementing a basic combat system into your Inform 7 game!
#gamedev#indie#indiegame#inform 7#inform7#tutorial#solodev#walkthrough#organization#organized#code#coding#headers
1 note
·
View note
Text
˙⋆✮ Some Helpful Statements ✮⋆˙
Let's take a look at some helpful statements or commands that you can use to enhance your story further.
At a certain time
First of all, let's examine the statements below. This comes directly out of my novel WIP «Off Limits»:
At 5 PM: if the player is in the Office Main: say "You glance down at your taskbar and notice the time. Wow, it's already after 5! The day went by so fast. Time to go homeward."
At 5 PM: if the player is in the Break Room: say "You glance down at your taskbar and notice the time. Wow, it's already after 5! The day went by so fast. Time to go homeward."
At 5:30 PM: if the player is in the Office Main: say "You glance down at your taskbar and notice the time. Wow, it's late, you should really go homeward!"
At 5:30 PM: if the player is in the Break Room: say "You glance down at your taskbar and notice the time. Wow, it's late, you should really go homeward!"
At 5 PM tells Inform 7 that when the game time at the top right of the play window by default reads 5:00 PM, it is to tell the player that message. If the player is busy doing something, like >work for an hour starting at 4:30 PM, the command will go off at the next available turn.
But for me, if it was after 5:30 for the player, the message just wasn't going off. So I made the next statement, At 5:30 PM: to accommodate this. It hasn't failed me yet in gameplay.
You may be wondering why I say you should really go homeward! in my description. The reason being is I gave my game a custom direction, which I will address here:
2: Custom Directions
Let's say you need to have a command like >go home in your game. After extensive attempts, I couldn't get Inform 7 to recognize >go home as a command properly, it would always say "You can't see any such thing." No big deal. I couldn't use "home" as a direction, because I have The Home as a room, which confused the game. So, I created the direction "homeward". Here's how it works:
Homeward is a direction. The opposite of homeward is workplace.
Workplace is a direction. The opposite of workplace is homeward.
Instead of going homeward when the player is in the Office Main: if the time of day is after 9:00 AM and the time of day is before 5:00 PM: say "You can't go home yet, you have to work until 5 PM!"; stop the action; otherwise: say "You hurry home."; now the player is in the Home.
First of all, directions must always have an opposite, which is why I had to create the direction "workplace" as well. Now, when the player is anywhere in the office building (so long as I continue to specify rooms,) they can use the command >go homeward to expeditiously leave the building and arrive at home, so long as the time is after 5 PM or before 9 AM. Let's look at the command now the player is in the Home in the next section:
3. Moving the player, moving a person, moving an object
It's quite straightforward, actually.
To move the player: now the player is in the [room].
To move [person's name]: now [person's name] is in the [room].
To move the mug: now the mug is in the [room].
You could use it like so:
Instead of taking the mug: say "You pick up your mug and admire the cat painted on the front for a moment."; now the mug is on the player.
now the mug is on the player is another way you can move objects, as opposed to moving them from room to room. This puts the mug in the player's inventory. Here's another example:
There is a room called Kitchen.
There is a room called Dining Room.
The Dining Room is north of the Kitchen.
Megan is a woman in the Kitchen.
Talking is an action applying to one visible thing. Understand "talk", and "talk to [someone]" as talking.
Instead of talking Megan: say "I'm sorry, I don't have time to chat, I have to get the table ready for dinner."; now Megan is in the Dining Room.
It also works for moving the player, as displayed in my example in section 2.
I'll think up some more helpful statements soon for you!
1 note
·
View note
Text
˙⋆✮ Common Issues In Inform 7 ✮⋆˙
Here's a brief list of common issues I've run into and how I've gotten around them or made them work:
1: You can't get doors to work
Doors are a bit of a pain if you don't understand that they are basically treated like a room between two rooms. Also, you cannot link a door to another door. Those are the two main causes of issues here in my experience.
To describe a door, it would be done as follows:
[Hallway]
There is a room called Hallway.
The Hallway contains the wooden door.
The wooden door is a door.
The wooden door is closed and openable.
The wooden door is west of the Hallway and east of the Bedroom.
[Bedroom]
There is a room called Bedroom.
Notice how we didn't tell Inform 7 that the Bedroom is west of the Hallway, and vice versa. We said the door was between the two, without connecting the two rooms together otherwise. This code would print the following:
If you stick to that formula above, you'll get a working door every time. Just remember, it would look like the following:
[Bedroom] | [Door] | [Hallway]
The only difference is the player doesn't remain in the door like they would a room.
2. You're having trouble declaring a new action
Keep it simple when writing new actions, in other words defining new verbs. Let's say we want to use the command >reply to [someone], we must write the command as follows:
Replying is an action applying to one visible thing. Understand "reply", and "reply to [something]", and "reply to [someone]" as replying.
Notice how we didn't write Replying to is an action ...
The same thing goes for writing instructions regarding commands for words like this that you've defined.
Let's keep looking at to reply. Let's say that you want the message "'I told you so!'" to show up when the player types >reply to Aaron.
Instead of replying Aaron: say "'I told you so!'"
We didn't include the to here, either. But still, when the player types >reply to Aaron, they get the following response:
So remember, keep your commands simple. Define the verb itself, specify the rest of the statement in the quotes. Ask about would become Asking: "ask", "ask about [something]", and "ask about [someone]", in the format provided above.
3. You want to have one item in multiple rooms
Let's say you want to have an identical bed in every room, like you would see in a hotel. To do this, you would utilize the Backdrop feature. It's quite simple, but a little tedious.
There is a room called Room 101.
The Room 101 contains the bed.
The bed is a backdrop.
The bed is in the Room 101.
The description of the Room 101 is "An average hotel room."
Now, if you wanted to have that in every single hotel room you create, then you would have to list it as such. Where it says The bed is in the Room 101. you would change that to The bed is in the Room 101, Room 102, Room 103 ... and so on, until every applicable room has been listed. Keep in mind that you cannot list rooms you have not yet created, so if I were to run the code without creating Room 102 & 103, it would produce an error.
Where the issue comes into play is in the way we write multiple backdrop items/objects. Unlike with scenery, where you CAN write:
The dog, the cat, and the tree are scenery.
With Backdrops, you could NOT write:
The dog, the cat, and the tree are backdrops.
To correctly declare multiple items as backdrops, it must be done individually. I recommend being sparing with backdrops as they get lengthy and confusing after a point, but it's up to you.
This is the correct way to format that statement:
The dog is a backdrop.
The dog is in the Room 101, and the Room 102.
The cat is a backdrop.
The cat is in the Room 101, and the Room 102.
The tree is a backdrop.
The tree is in the Room 101, and the Room 102.
4. You want actions to take a certain amount of time
This one is less of an issue and more of a handy feature I found that I think is worth sharing here. Let's say you want your character to advance time a bit more when they examine objects, perhaps they take 5 minutes to examine each item instead of the default 1 minute.
Every turn: if the current action is examining: now the time of day is 5 minutes after the time of day.
It's that simple! Don't overthink it, stick to basic verbs here.
5. Player's are struggling with knowing what's in my room(s)
If you're using the command is undescribed then the reason you are facing this issue is because you are not adequately describing your rooms yourself when you declare items as being essentially invisible. That's how I think of it. When an item is undescribed, to me, it means it is invisible, and I must make sure I describe it by its proper name in my room description for the player's sake.
For example, if I didn't use is undescribed, and created a room as follows, it would print as the following:
There is a room called Bedroom.
The bedroom contains the bed.
The description of the room is "My lovely bedroom."
The game takes care of announcing it for you. If you were to use The bed is undescribed. then Inform 7 would only print "My lovely bedroom." But then, how would the player know the bed was in the room? Sure, they can guess, but what if you called the bed the cozy bed for the sake of having more than one bed in the game? The player would be stuck having to guess what you identified your bed as.
A better description for this specific room would be "My lovely bedroom. The cozy bed by the window is my favourite place to be."
I'll do another info dump post like this soon!
#gamedev#indie#indiegame#solodev#inform7#inform 7#tutorial#walkthrough#backdrop#backdrops#descriptions#room descriptions#declare action#declaring actions#doors#make doors#make a door
0 notes
Text
˙⋆✮ Dialogue - Continued ✮⋆˙
I have done some exploring into dialogue commands, and I have a pretty good handle on them now. Let's look into them further.
Recall that to create a functional >talk command, you must first write:
Talking is an action applying to one visible thing. Understand “talk”, and “talk to [something]”, and “talk to [someone]” as talking.
Once you've done that, you can now use >talk and >talk to [the noun] as a command. To create basic dialogue now, you would write:
Instead of talking Mary: say "'I hate how messy it is in here.'"
Now, how could we create a more interesting dialogue? If we wanted Mary to simply make a few statements at us before defaulting to a certain statement, we could do the following:
Instead of talking Mary for the first time: say "Every New Year I tell myself I'm going to clean out the garage in the spring."
That way, the first time the player speaks with Mary, they will get the message "Every New Year I tell myself I'm going to clean out the garage in the spring." Every time after that will produce the second result.
If we wanted to have her continue to talk at us, simply do the following:
Instead of talking Mary for the second time: say "It's just such a big job, you know?"
Instead of talking Mary for the third time: say "I just don't have the energy, and then I forget about it until the next New Year."
And so on, and so on. That way, we simulate a simple conversation with the player only needing to enter >talk to Mary.
With that in mind, play around with it! See what commands you can come up with. Remember, if it ends in -ing, you can probably make it happen.
0 notes
Text
˙⋆✮ How to Start Your Story ✮⋆˙
Take a look at the beginning of our sample story. You'll see I've added a bunch of new information before the first room description. Let's break it down:
The story title is The story author is The story headline is The story genre is The release number is The story description is The story creation year is
These are attributes given to your story that help define it so it can be identified by genre, for example. It is very important to include this information with your story if you intend to release it anywhere.
Release along with cover art ("") Release along with a file of "" called ""
Tells Inform 7 that, when you press the Release button, it is to compile your game with a description of your cover art, and an attached file, which is given first a brief description, followed by the exact file name and extension.
It is important to note that every entry is ended with a period. When you are done with a command, it must end with a full stop. If you are adding onto a command but are done with that portion of the command, use a semi-colon (;). Any quote that ends with a full stop also works, so say "'I'll show you.'" would count. I'll show you examples soon.
Use American dialect and the serial comma and undo prevention.
Let's break this down. Use American dialect tells Inform 7 that the document is written in American English. (I'm Canadian and haven't run into an issue involving U yet, but it may come up.) and the serial comma tells Inform 7 you intend to use a comma after every entry. For example, you would NOT write:
the apple, the orange and the pear.
You WOULD write:
the apple, the orange, and the pear.
It is up to you whether or not to use this feature, but I will be using it in all of my examples. And finally, and undo prevention prevents the player from using >undo to go back a turn. Again, optional, but I recommend it.
˙⋆✮ How to Enhance Your Rooms ✮⋆˙
First of all, describe every item you mention in your room description. For example, if I wrote:
"My bedroom is cozy. My bed looks so inviting, and my desk is nice and tidy by the window. My dog is asleep on her bed at the foot of my bed."
Then I would write:
The Bedroom contains the bed, the desk, the window, and the dog.
Then I would describe each one of those things individually. That way, if the player >examine [the noun] them, they'll be rewarded with a unique description. If you choose to do this, be aware that you have to be specific when you describe your items if you intend to have multiple beds in multiple rooms, for example. If you want to describe the bed in YOUR bedroom as "My bed, I love it dearly." but your parents' bed as "My parents' bed is huge.", you couldn't call both of them the bed. You would have to call them cozy bed and parents' bed, for example. If you were to call them both the bed, the game would produce an error telling you you have used the item in two rooms improperly. It is possible, but we'll cover that in the next post. This would be useful for describing, say, a rainstorm, so the player could examine the rain in every applicable room and get the same description.
Be aware that calling an item your bed can confuse the game when giving commands, as it does not tend to recognize "your" as part of the item name, even if you declare it as such in your room contents.
the your jacket, when you try to >take your jacket, produces the message "You can't see any such thing."
Even if the item or object is of no use to the player, it's nice to examine a bookshelf and get "A lovely bookshelf teeming with books." instead of the default "You see nothing special about the bookshelf."
Remember: Items you intend to describe differently in multiple rooms must have unique names!
˙⋆✮ Creating Commands/Actions and How To Create Dialogue ✮⋆˙
You can't have one without the other, for the most part! It would be very dull and frustrating dialogue, that's for sure. You see, Inform 7 has a relatively brief list of commands built into it, such as >look, >examine [the noun], and >take [the noun]. But you might have noticed that ">talk to [the noun] tells you "That's not a verb I recognize."
To create new actions, you must start with the verb you wish to use. Let's start with To Start. You must format your command in a very specific way:
Starting is an action applying to one visible thing. Understand "start", and "start [something]" as starting.
This tells Inform 7 that the player can now >start and >start [the noun]. You could then turn this into a custom message when the player tries to >start car
Instead of starting car: say "You turn the key in the ignition, and the engine sputters to life."
When the player types >start car, they would be met by the message you just entered.
The same goes for dialogue. Let's say you want to enable >talk to [the noun] as a command.
Talking is an action applying to one visible thing. Understand "talk", and "talk to [something]", and "talk to [someone]" as talking.
The Garage is a room.
Mary is a woman in The Garage.
Instead of talking Mary: say "'I am so tired of how messy it is in here.'"
talking Mary may sound funny, but if you try entering >talk to Mary into the game, it will produce her response. Now, that said, that only allows for a one-time response. Anytime the player types >talk to Mary that would be the result they would get. Again, you'll need to get specific with your commands so the player can have a richer experience.
I don't have much experience yet with dialogue, so I'm limited here, but as I learn more I will teach you more!
In the next post, we'll look at Backdrops and Scenery: what they are, why they're useful, and when and how to use them.
#gamedev#indie#indiegame#solodev#inform7#inform 7#tutorial#walkthrough#dialogue#descriptions#introduction
0 notes
Text
˙⋆✮ Getting Started With Inform 7 ✮⋆˙
Inform 7 can seem confusing at first, but is quite logical and straightforward once you understand its limitations.
To start, let's build a functional room with basic items for the player to examine.
˙⋆✮ Make a Room ✮⋆˙
Let's break down what we're seeing in the screenshot.:
There is a room called Bedroom. [this statement tells Inform 7 to make a room called Bedroom. You can call it mostly whatever you want.]
The Bedroom contains [tells Inform 7 what items and objects are in the room. By default, items are able to be picked up unless you declare them specifically, but we'll return to that in the next post. For now, just list a few items you want in the room, starting with "the".]
The description of the Bedroom is [tells Inform 7 how to describe the room to the player when the player enters the room. It is important to use "the" before the room name, even if the room name contains "the", such as "the The Hallway".]
The description of [the noun] is [this tells Inform 7 how to describe the object when the player examines it.]
You now have a functional bedroom! If you print this, you'll notice the game tells you what objects are in the room, as you listed them in "The Bedroom contains ..."
To avoid this, there is a very simple solution that Inform 7 actually advises against using, but I use religiously:
The desk, the bed, and the window are undescribed.
Now, when you enter the room, the room no longer declares its contents, but they are still there and interactive.
˙⋆✮ Make a Second Room ✮⋆˙
To build a world the player can navigate, you must build rooms in a logical grid order using the standard cardinal directions (without the -): North, Northeast, East, Southeast, South, Southwest, and West. You can also use Above and Below for upper and lower floors.
Make yourself a second room called Hallway the way you did with the first (see screenshot below for proper formatting!)
Now, go back to your first room. Add the following statement:
The Bedroom is south of the Hallway.
To your second room, add the following:
The Hallway is north of the Bedroom.
Now, when you press Go, or Replay, you can use "go north" to enter the Hallway.
It's as simple as that! Now you know the foundations of building a functional room for the player to interact with. In the next post, I'll look at how to beef up your rooms to make them more interesting for the player, how to create dialogue, and how to create custom actions/commands!
Final note: If you want to include "" (quotes) in your descriptions, do the following:
The description of the room is "You look around the room and say, 'Oh no, we're back here again.'"
3 notes
·
View notes