I want to create a diary-type feature in the stats tab, which keeps a record of important moments within the game, discoveries, etc. What is the best way to go about this? (I have seen such a thing in other games, but not too sure how it is created)
This really depends on how much effort you want to put in it. IIRC, most talks end up addressing the fact that anything beyond simple true/false switches becomes very difficult. The easy way is:
This is the game
You are born
*set is_born true
*choice
#go left
You went left
*set went_left true
*goto next step
# "" right
And then for the stats page you have:
This is your story
*comment The above line means you can start every other line with a *line_break and have them line up nicely. If you don't have it, your text may look a little funny.
*if is_born
*line_break
You were born.
*if went_left
You went left.
ect.
Or, if you want it phrased as a paragraph:
*temp diary_text "This is your diary. "
*if is_born
*set diary_text & "You were born. "
*if went_left
*set diary_text & "You went left. "
${diary_text}
At least, that’s how I think & is used. I never really made much use of it.
You can actually examine other game’s files to see how they do it.
Since Choice of the Robots is the major one that does it I’d suggest looking at the files.
https://www.choiceofgames.com/robots/scenes/startup.txt
https://www.choiceofgames.com/robots/scenes/choicescript_stats.txt
Slammed! also has a tracking feature, but the summary of what you did is at the end as opposed to on the stats screen from what I recall.
How I handle it in my game.
*if (chapters_completed = 0)
You woke up in a hospital, alone and frightened, unable to remember how you got there.
*goto return_to_statscreen
*if (chapters_completed = 1)
You woke up in a hospital, alone and frightened, unable to remember how you got there. After briefly exploring the hospital, you found a flashlight and headed off in search of some way out.
*goto return_to_statscreen
*if (chapters_completed = 2)
You woke up in a hospital, alone and frightened, unable to remember how you got there. After briefly exploring the hospital, you found a flashlight and headed off in search of some way out.However, after an altercation with something that's definitely not human, you realised that something is definitely wrong here.
*goto return_to_statscreen
And so on.