How to make a day system in Harlowe?

Twine Version: 2
Story Format: Harlowe 3

Currently, I’ve just been doing something like this:


(set: $curDay to (nth: visit, “Questday”, “Twiceday”, “Seedday”, “Moonday”, “Upday”, “Firstday”))

But it’s very inefficient when I want to add mechanics that are affected by the passage of time. I have no idea how to work an array to fix this and every example I can find is in sugarcube (arggh!).

Does anyone have any suggestions?

Generally you would use a Story Variable to track the number of “days” that have past, incrementing that number each time you want it to be the next day. You would likely initialise this variable within your project’s startup tagged Passage.

The following TWEE Notation based example shows the above number tracking technique in action, it uses a header tagged Passage to automatically keep the value of $curDay up to date.

:: Startup [startup]
(set: $days to 1)

:: Story Header [header]
(set: $curDay to (nth: $days, "Questday", "Twiceday", "Seedday", "Moonday", "Upday", "Firstday"))

:: Start
It has been a long $curDay and you feel tired...
(link-reveal-goto: "Sleep", "Waking")[
	(set: $days to it + 1)

:: Waking
You wake up and realise it's $curDay already.

note: Please use the Preformatted text </> option when supplying code examples, it makes the code easier to read/copy and stops the forum’s software from converting valid standard quotes into invalid Typographical (curvy) quotes.

1 Like

Oh, wow, this is really great! Thanks :grinning: