Inserting journal entries in IF

Hi everyone,

First off, I’m a newbie, new to Inform, new to IF. I’ve been playing around with a project on my own for a few months, feeling my way through problems as I cross them. I love it and this is my first foray into public forums-- so, how do you do.

I’m working on a fictionalized version of my real world travels, which is captured in actual paper journals. I want to use my real life journal entries as a starting point, then edit/fictionalize them as needed. I have many, many pages to transcribe from paper into IF. Then, I want to insert these journal entries as text in certain parts of the story. I’ve mapped out the world roughly (rooms and regions) and I’d like to trigger spontaneous journal entries from time to time throughout the story. That is, at certain times, the player is told that they stop what they are doing to write in their journal (my choice, not theirs) and that the journal entry says such-and-such (my text, not theirs).

Here is my approach so far:

Because I am converting a bunch of real world text that I want to edit later, I don’t want to sprinkle the journal entries throughout the story, within rooms or scenes. Therefore, I created Table of Journal Entries (which I can create by inserting row/column tags into my transcribed journals), from which I can grab entries as needed.
Right now, it looks like this:

Table of Journal Entries
Entry ID	Journal Entry
"AOM1"	"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dui dolor, lacinia ut tempor sit amet, euismod eu sem. [line break]Praesent volutpat commodo iaculis. Sed fermentum, purus eleifend posuere interdum, est eros maximus nibh, pulvinar aliquet magna erat a arcu.[paragraph break]"
"YH1"	"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dui dolor, lacinia ut tempor sit amet, euismod eu sem. [line break]Praesent volutpat commodo iaculis. Sed fermentum, purus eleifend posuere interdum, est eros maximus nibh, pulvinar aliquet magna erat a arcu.[paragraph break]"

The Entry ID is just an internal ID that I’ll recognize as referring to a room (YH1 is the first entry in room YH). I’m not using date/time because I don’t think flow of time will be that strict and it’s the location that counts.
The table is hard to read in Inform7 when entries are long, but I don’t know another way to centralize the content transcribed from Word.

For triggering journal entries, my current approach it to:

  1. Define “journaling” as an activity that involves saying the “[Journal Entry corresponding to an Entry ID of Entry ID in the Table of Journal Entries]”.
  2. Use rules in the appropriate rooms to set the Entry ID and determine when to trigger Journaling (after so many turns, etc).
    I’m not including exact code here because first I wonder if this is a good approach at all.

So I’m looking for feedback/ideas about:

  1. How to transcribe from journals in Word (etc) into Inform7 and then edit/maintain content centrally. Is a table the best/only way?
  2. How to insert journal entries throughout my story. Is there a better way than my “every turn in room check to trigger activity” approach?

Thanks so much!
Jason

I don’t know how qualified I am to answer your question, but I will give some suggestions.

Plain text can be just copied and pasted directly into Inform. You may want to arrange the journal entries as you want them in Word, then export that to a plain text file. Realize that formatting such as italics and bold and underline won’t transfer over. You need to tag them in Inform such as [italic type]This is in italic type.[roman type]. I make shortcuts to do this.

I rarely use tables in Inform, but that’s my style. I wouldn’t mind using a table if necessary, but I’ve always found ways around it. They can be awkward with especially long texts. If I were writing a game where I wanted a sort of “narration” to happen at various points, I would write it into the actual game text. You can trigger anything you want based on actions the player takes, or at random times. In most cases, authorial control is better, but you may want to have a running narrator voice interjecting from time to time.

You may want to read up on text variances because you can do things like

[code]To say narration:
say “[paragraph break][italic type][one of]I entered the forest with much trepidation.[or]After I had been walking a long time, I found myself hungry.[or]I learned to cook over a campfire using my survival skills.[or]As my time in the forest went by, I began to adjust to my new environment.[or][narration2][stopping][roman type]”.

To say narration2:
say “[one of]My journey continued for weeks, and there were victories and failures.[or]I stubbed my toe under a log and found my distance reduced by a mile per day [or]more stuff…[or][narration3][stopping]”

Carry out looking:
if a random chance of 1 in 3 succeeds:
say “[narration]”. [/code]

What this will do is 1 in 3 times the player looks, or enters a new room, it will trigger a text called “narration”. Each time this triggers, you’ll get a different text in the order specified by the “one of/or/or” sequence. By ending the sequence with “stopping”, that will always repeat the last item in the list. Since your last item is another text substitution “narration2”, narration will keep repeating that last item which will pull the text sequence in “narration2” in order. (The reason to do this is there is a limited amount of text you can cram into one set of quotation marks, and I have hit it before using complicated text variations.

Basically what this does is creates a continuing story that can occur in different places, but will always be in order each time it’s triggered.

You can also do this with some more detail. If your protagonist has a running commentary on plants, you could trigger journal narration specifically.

[code]to say aboutplants:
say “[paragraph break][italic type][one of]My opinions about plants.[or]More opinions about plants.[or]I love plants.[or]That’s all I have to say about plants.[stopping]”

a thing can be plantish. A thing can be read.

After examining a plantish thing (called weed):
if weed is not read:
say “[aboutplants]”;
now weed is read;
continue the action.

A dandelion is in forest clearing. It is plantish.[/code]

What this does, is for everything you mark as “plantish” it will pull an entry from the “about plants” sequence and read it. It will only display once for each plantish thing so you can make sure the text is spread out and not all used on one item by examining it over and over.

You could even make narration pull from various subjects:

[code]To say narration:
say “[one of][subject1][or][subject2][or][subject3][at random]”

To say subject1:
“[one of]Stuff about subject1.[or]More stuff.[or]Even more stuff.[or]Something vague that will repeat each time subject1 is randomly chosen.[stopping]”

To say subject2:
(etc)[/code]

This time, narration will randomly pick a text substitution and show the next from that sequence, never repeating and moving forward, at least until it hits the ending entry of each subject.

You could still use a table for this by selecting random rows and blanking out the rows after they are used, or similar table manipulations, which as I said is not how I usually do things!

This may or may not pertain to what you want, but hopefully should give you some ideas. Someone will probably give you better direction since I am weird and more of a “whatever works” sort of Inform 7 coder. Once you get started and are able to post some sample code displaying what you are trying, people can probably help further.

There are lots of ways to do this! I use tables all the time, and can definitely see why you’d want to keep all the text in one place. On the other hand it is true that tables tend to look terrible in the Inform IDE.

Self-plug: You might be interested in my game Tea and Toast, which has a mechanic that’s not entirely unlike yours–there’s a series of memories that can be triggered by all the things the player is doing, and the mechanics for the memories are basically laid over top of the mechanics for interacting with objects rather than mixed in with them. (You can comment out the chapter on Memories and you only have to comment out two lines of the rest of the source code to get a functional but extremely boring game about making tea and toast.)

Here’s the part with the table for all the memories, and here’s the rather complicated code for triggering the memories. It’s probably a lot more complicated than anything you’ll want, because the memories aren’t associated with specific triggers–rather, which memory gets picked depends on what the player’s been interacting with, and whether the game is about to deliver a hint about something, and which memories have previously been exposed.

That’s Inform 6G60 source code, by the way, so it wouldn’t work exactly as plugged in to the latest version. Also I typed everything directly into the IDE I think, so I can’t give you any insight about transferring it from a word processor.

Anyway! It does sound like, if you want to avoid a table and keep all the journal entries in one place, one way to do that might be with a special rulebook that you trigger every turn. Something like this:

[code]Bedroom is a room. “The hallway is to the north.” Hallway is north of Bedroom. “The bedroom is to the north and the kitchen is downstairs.” Kitchen is down from the hallway. “The hallway is upstairs.”

The journaling rules are a rulebook.

Journaling rule when looking in the bedroom for the first time:
say “[first time]My bedroom! ‘Bedroom’ is an anagram of ‘boredom.’[only]”;
rule succeeds.

Journaling rule when the location has been the bedroom for exactly two turns:
say “[first time]Some days I couldn’t bring myself to leave the bedroom, even though there wasn’t anything to do there.[only]”;
rule succeeds.

Journaling rule when going to the bedroom:
say “[first time]Some days I went back to the bedroom even though I didn’t have anything to do there.[only]”;
rule succeeds.

Journaling rule when the location has been the hallway for exactly one turn:
say “[first time]Some days I stood in the hallway, lost in thought or something.[only]”;
rule succeeds.

Journaling rule when the location is the kitchen for the first time:
say “The kitchen! Home of some of my most delicious memories.”;
rule succeeds.

Every turn: follow the journaling rules.[/code]

However, this involves heavy use of things like “for exactly two turns” and “for the first time,” which I personally have a lot of trouble with. (For instance, the memory for going back to the bedroom doesn’t seem to work. Also apologies for such dour text, but I didn’t implement anything but waiting around, so…) You should look at §9.13-15 of Writing with Inform if you are interested in this kind of approach.

One way in which tables might help here is that, if you’re using a table, you can have Inform blank out the row for a journal entry once you’ve printed it, so you don’t have to worry about keeping it from printing again. Depending on how you’re doing things you might be able to fit a lot of the logic for printing journal entries into the table. For instance, if the only things that matter are which room you’ve been and how long you’ve been in it, then you could make a column for the room and a column for the number of turns you have to be in the room and decrease the number every turn you’re in the room until it’s time to print the journal entry, like this:

[code]Bedroom is a room. “The hallway is to the north.” Hallway is north of Bedroom. “The bedroom is to the north and the kitchen is downstairs.” Kitchen is down from the hallway. “The hallway is upstairs.”

Table of Journal entries
place countdown journal
Bedroom 1 “My bedroom! ‘Bedroom’ is an anagram of ‘boredom.’”
Bedroom 2 “Some days I couldn’t bring myself to leave the bedroom, even though there wasn’t anything to do there.”
Hallway 2 “Some days I stood in the hallway, lost in thought or something.”
Kitchen 1 “The kitchen! Home of some of my most delicious memories.”

Every turn:
if the location is a place listed in the Table of Journal Entries:
decrement the countdown entry;
if the countdown entry is 0:
say the journal entry;
say line break;
blank out the whole row.[/code]

(This doesn’t let you do a thing for going to the bedroom for the first time, but I couldn’t get that to work anyway in my previous approach!)

Or Hanon’s suggestions are good too, I just love me some tables.

Also, I would definitely advise editing down the journals a lot.

(Also also, this seemed like it was a question specifically about Inform 7 so I moved it to the Inform 7 subforum.)

Another thing you could use in combination of all the above:

You can give rooms or any specific thing a text (or many of them) in addition to its normal description.

[rant=example][code]A thing has a text called j-entry. The j-entry of a thing is usually “”.
A room has a text called j-entry. The j-entry of a room is usually “”.

Cabin is a room. “You remember the old cabin.” The j-entry of Cabin is “Ah, the smell of the old cabin. The ancient wood, the aroma of fires long burnt, and the fresh woodsy air.”

A deer head is in cabin. It is fixed in place. The j-entry is “Ah, the deer head. You didn’t kill it, of course, but it’s been with the cabin long before you came in possession of it.”

A fidget spinner is in cabin. The j-entry is “Ah, my trusty fidget spinner. This has nothing to do with the cabin, but I picked it up in the gas station on the way here.”

Carry out waiting:
if the j-entry of the location is not “”:
say “You write in your journal: [italic type][j-entry of the location][roman type][line break]”;
now the j-entry of the location is “”. [/code]
(The italics do show in Inform, but don’t transfer to the forum with copy/paste)

[/rant]

Now, if you want to get fancy, what you can do is give the player a “journal” object, and whenever the player sees a journal text, you can poke that text into a table entry and have it so that the journal displays all the non-empty lines in that table and it will “read back” in the order the player encountered the journal entries and wrote them. I’m not the table guy, but Matt can probably explain. It involves something like “find the first non blank row in table X; now the row is j-entry of the noun.” Something like that, but hopefully an expert (MATT??) will rescue me on this.