Thank you for all the help I received on my previous diary post, especially to Wade.
I have managed to create a diary and for posterity I’ve included it below, credit to @severedhand . Note: I still have to make the entries contextually relevant to my story.
This is exactly what I wanted but, as with these things, once you have what you want you learn it wasn’t exactly what you wanted after all. I loved the exercise of learning this though, which, to me, is the coding equivalent of “The real treasure is the friends you made along the way”.
So let’s say I wanted to make it so that when someone types “read diary” it does a bit of chat about reading diaries and ends with the prompt “which date would you like to read?”.
I’ve tried a few things but this is where my lack of skill and experience shows through. I can’t seem to link ideas together with the correct syntax.
Is it even possible to bring up a command prompt “what page would you like to turn it to?” like entering a name in *415 “Identity Theft” and, even so, can you catch two separate things at the same time without having to collect both separately like “what month would you like?” “what day would you like”?
This would allow me to write significant dates with actual entries, and randomly generate the vast majority.
(This, of course, raises a second issue which is that if you went to a non-significant day more than once it would not read the same. I bet there’s a way to set an entry forever but now I’m really in the tall grass for something that was initially a flight of fancy, so I’ll leave that wrinkle alone).
the Garden is a room.
a table is a fixed in place supporter in the garden.
a diary is on the table.
page of diary is initially 19.
month of diary is initially 1.
mname is a text that varies.
When play begins:
now the mname is "December".
Rule for writing a paragraph about table:
say "An open [diary] sits here on the table.";
Instead of examining diary:
[if the table of fragment one is empty:
say "Riveting! You've read the whole thing!!!";
otherwise:]
print a diary entry;
To print a diary entry:
increment page of diary;[get the next date in the diary]
if page of diary is 20 and month of diary is 1:
say "There are almost a year of entries in this diary. You feel sort of bad reading it but, judging by the carnage outside the door, this person likely needs your help:[paragraph break]";
say "'[mname] [page of diary]: ";
if a random number between 1 and 2 is 1:
choose a random row in the table of intro-fragments;
say "[prose entry]. ";
[blank out the whole row;]
say "[one of]Today[or]This morning[or]This evening[or]This afternoon[or]Tonight[or]In the morning[or]In the evening[or]In the afternoon[at random] ";
[print a sentence beginning]
choose a random row in the table of fragment one;
say "[prose entry] ";
[blank out the whole row;]
[print a plant name]
choose a random row in the table of plants;
say "[prose entry]. ";
[blank out the whole row;]
[print a final comment]
choose a random row in the table of fragment two;
say "[prose entry]";
[blank out the whole row;]
[extra comment made 1 in 3 times:]
if a random number between 1 and 3 is 1:
choose a random row in the table of fragment three;
say ". [prose entry]";
[blank out the whole row;]
say ".'";
if page of diary is 31 and month of diary is 1:
now page of diary is 0;
now month of diary is 2;
now mname is "January";
if page of diary is 31 and month of diary is 2:
now page of diary is 0;
now month of diary is 3;
now mname is "February";
if page of diary is 28 and month of diary is 3:
now page of diary is 0;
now month of diary is 4;
now mname is "March";
if page of diary is 31 and month of diary is 4:
now page of diary is 0;
now month of diary is 5;
now mname is "April";
if page of diary is 30 and month of diary is 5:
now page of diary is 0;
now month of diary is 6;
now mname is "May";
if page of diary is 31 and month of diary is 6:
now page of diary is 0;
now month of diary is 7;
now mname is "June";
if page of diary is 30 and month of diary is 7:
now page of diary is 0;
now month of diary is 8;
now mname is "July";
if page of diary is 31 and month of diary is 8:
now page of diary is 0;
now month of diary is 9;
now mname is "August";
if page of diary is 31 and month of diary is 9:
now page of diary is 0;
now month of diary is 10;
now mname is "September";
if page of diary is 30 and month of diary is 10:
now page of diary is 0;
now month of diary is 11;
now mname is "October";
if page of diary is 31 and month of diary is 10:
now page of diary is 0;
now month of diary is 11;
now mname is "November";
table of intro-fragments
prose
"I've got a headache, but I ignored it"
"Wanted to stay in bed. Didn't"
"I was excited for some reason"
"Time for another diary entry"
"Fog's coming in across the valley"
"Fog lifting"
"It rained again"
table of fragment one
prose
"I walked amongst"
"I tended"
"I cut some of"
"I smelled"
"I admired"
"I gathered some of"
table of plants
prose
"the ginger plants"
"the clivias"
"the orchids"
"the daisies"
"the daffodils"
"the roses"
"the agaves"
"the angel's trumpets"
"the sunflowers"
"the lilies"
"the dahlias"
"the ferns"
"the pansies"
table of fragment two
prose
"They're amazing"
"I hope they'll keep growing"
"It's not the right season for them"
"My work[if a random number between 1 and 2 is 1] on them[end if] [one of]is paying off[or]has paid off[at random]"
"I need to water them [one of]now[or]soon[or]tomorrow[or]in a couple of days[at random]"
"The soil here isn't right for them"
"There's too much clay in the soil, though"
"They're beautiful"
table of fragment three
prose
"I feel tired"
"The weather's getting warmer"
"I need to bring some more supplies over, though.."
"My sister should be here in a few days"
"I found a beehive nearby, too"
"I keep dreaming of that greenhouse"
Test me with "read diary/g/g/g/g/g/g".