bunninegamedev
bunninegamedev
✨ bunnine ✨
3 posts
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.
bunninegamedev · 1 month ago
Text
Tumblr media
Meet the dev!
It's me, I'm the dev. I'm the only dev, actually. I'm making «Why Am I Here» by myself, learning Inform 7 from scratch using only the documentation and online resources.
Feel free to ask me questions about anything!
0 notes
bunninegamedev · 1 month ago
Text
Tumblr media
How To Write In Inform 7
Welcome to my introduction to Inform 7. I'm going to teach you today to format your story properly so Inform doesn't struggle to read it. This is also, effectively, a starter guide to Inform 7.
Building a room
Building a room is the foundation of writing your story. Without rooms, your player has nowhere to go. Your game won't even print without a room.
If you simply write:
The Bedroom is a room;
Exactly like that, then hit Go!, your game will print a room called Bedroom with a single > on screen for the player to interact. We'll come back to rooms later on.
Proper punctuation
Punctuation is vital for your story's flow to be read properly. You can break up your story into parts and sections without issue, but if you end a sentence with the wrong punctuation, Inform will forget about the previous information it read and cause things to break. This was one of the issues I ran into, because I was not clear on how punctuation needed to be.
Let's look at a basic room; pay attention to the punctuation of each sentence. We'll break it down after.
Use the serial comma;
The Bedroom is a room. "Your bedroom. It is small but cozy. Your double bed takes up most of the space, leaving little room for a bookshelf, and your nightstand. An ivy plant thrives on it, not far from the window.";
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are in the Bedroom;
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are scenery;
Okay, let's break it down. Starting with the first statement: Use the serial comma;. This statement tells Inform 7 you intend to put commas after EVERY "and" list. This is optional but makes the code I wrote functional, as I use the serial comma. It ends with a semicolon (;) and not a period. This is important and where many people go wrong. Putting a period breaks up your paragraph flow.
But why, then, did I use one after "The Bedroom is a room."? It is because that sentence is immediately followed, without a line break, by another sentence: the room description. As the room description is where the paragraph ends and continues onto a new topic, it ends with a semicolon.
"The double bed, the nightstand, the bookshelf, the ivy plant, and the window are in the Bedroom;" creates these objects within the room so you may describe them by saying
The description of the double bed is "The description, which you would customize.";
You would repeat this for each item description, so that the player can >examine the double bed to get a description of the item that you choose.
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are scenery;
This tells Inform 7 not to print "You can see a double bed, a nightstand, a bookshelf, an ivy plant, and a window here." The reason I have done this is because I wrote a specific room description which mentions all of these items as being visible within the room. It also tells Inform 7 that these items are fixed in place, so the player cannot >take double bed. If I wanted the items to be portable, I would say:
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are undescribed;
instead of scenery.
Connecting rooms
Use the serial comma;
The Bedroom is a room. It is north of the Hallway. "Your bedroom. It is small but cozy. Your double bed takes up most of the space, leaving little room for a bookshelf, and your nightstand. An ivy plant thrives on it, not far from the window.";
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are in the Bedroom;
The double bed, the nightstand, the bookshelf, the ivy plant, and the window are scenery;
The Hallway is a room. "A simple hallway.";
That's all it takes. You would then describe the Hallway in the same manner you created the Bedroom to establish it, too. When the player is in the Bedroom, they can >go south, or >south to travel to the Hallway.
Upstairs and downstairs are also possible. The direction you would substitute for "north" would either be "above" or "below".
Formatting your story
This is a personal preference. You could simply write your story as a block like we were doing above if that suits you, but it makes navigating very hard. I make use of Parts, Sections, and [ Headers ] to navigate my story and organize it. Here's how it works.
Part 1 - Definitions
Talking to is an action applying to one thing;
Understand "talk to [someone]" as talking to'
Part 2 - Rules
A battery is a type of thing;
The fresh battery is a battery;
Part 3 - Rooms
[ Bedroom ]
The Bedroom is a room. It is north of the Hallway;
The fresh battery is in the Bedroom;
[ Hallway ]
The Hallway is a room;
Part 4 - Objects
[ Bedroom ]
The fresh battery is in the Bedroom;
The most important thing to note is the order of my headings. Rooms must ALWAYS come before Doors, and in this I would put Doors into Objects. In reality, I give Doors their own section between Rooms and Objects, for readability. Either would work fine so long as Rooms are established before Doors.
That about sums it up! You can now write a basic room, you know how to format your story, and you understand the importance of punctuation. Give it a try and let me know how it goes!
0 notes
bunninegamedev · 1 month ago
Text
Tumblr media
☼ Doors In Inform 7 ☼
Doors are tricky things to write, I'll be honest. They're quite basic once you get the hang of them, but they can be quite confusing at first and hard to understand, so I'm going to walk you through it and help you get a better grasp on how doors work in Inform 7.
I'll be honest with you, I'm not an expert on this. I'm learning as I go and teaching as I learn so others can learn from my mistakes. This is as much a journal of my victories as it is a tutorial.
So, let's dive into it.
*Please note that I use the serial comma rule. If you do not, don't put a comma after your final "and" in a list
How to write a door
The basic door is a door. It is north of the Hallway and south of the Bedroom. It is closed, and openable;
That right there is your basic definition of a door. That alone won't work, though. You of course need to define your rooms first. It is vital that you define your rooms before you define your doors. If you define your doors first, Inform will get confused.
Here is how you could write it simply:
The Hallway is a room. "A simple hallway with cheery wallpaper.";
The Bedroom is a room. "Your bedroom. Cozy, though admittedly small.";
The basic door is a door. It is north of the Hallway and south of the Bedroom. It is closed, and openable;
This would create two rooms—one called the Hallway, one called the Bedroom—with a door between them, north of the Hallway and south of the Bedroom. Think of doors as a temporary room between rooms. You don't stay in it, merely pass through. This room between rooms is where you define your map directions, NOT your room declaration.
This would be incorrect:
The Hallway is a room. It is south of the Bedroom. "A simple hallway with cheery wallpaper.";
The Bedroom is a room. "Your bedroom. Cozy, though admittedly small.";
The basic door is a door. It is north of the Hallway and south of the Bedroom. It is closed, and openable;
You've already told Inform where the rooms sit directionally by telling it that the door is north of the Hallway and south of the Bedroom. And by putting a door between the rooms, that makes the Bedroom no longer directly connected to the Hallway. Yes, it is still considered the room north of the Hallway, but functionally, it doesn't really act like that.
You don't want Inform to say "You can see a door here"
This one tripped me up for four whole days, which involved a lot of debugging on my part. I learned a hard lesson: use undescribed for portable objects, and scenery for non-portable objects!
Here's how to do it.
The Hallway is a room. "A simple hallway with cheery wallpaper.";
The Bedroom is a room. "Your bedroom. Cozy, though admittedly small.";
The basic door is a door. It is north of the Hallway and south of the Bedroom. It is closed, and openable;
The basic door is scenery.
This tells Inform that your door should not be printed in the room's description, but is very much real and needs to be there. This way, you can describe your rooms yourself, something like "The hallway is short, with only three doors. The basic door at the end of the hall leads to your bedroom, facing north, overlooking the garden."
The reason this is necessary is because when you tell Inform 7 that the door is undescribed, it has the possibility of removing the door from play, despite it being fully interactable! I did extensive debugging, only to discover that:
My door existed
It was north of one room and south of another, which was correct
It was able to be unlocked, and opened
It was being treated as a destination, not a door
Very strange! I had never run into this before despite doing this very thing many times before without issue. So, I learned the hard way. Doors must be scenery if you want them to be undescribed.
Locked doors
Locked doors are also quite straightforward, and require minimal changes to your code. The most important thing to note is you need to declare a key of some kind that is accessible to the player, like so:
The Hallway is a room. "A simple hallway with cheery wallpaper.";
The Bedroom is a room. "Your bedroom. Cozy, though admittedly small.";
The basic door is a door. It is north of the Hallway and south of the Bedroom. It is closed, locked, and openable;
The basic key is in the Hallway;
The basic key unlocks the basic door;
This would require your player to:
>take basic key >unlock basic door (with basic key, optional) >open basic door >go north/go through basic door
If you've written your source correctly, it should look similar to the image at the top of this post! I format my story differently than this, in terms of how I organize my rules, objects, etc; and I will teach you that soon!
1 note · View note