Dealing with the status line

I’m having yet another problem, I’m trying to create a in-game calendar. I’m using the example 183 the hang of thursdays but so far nothing is quite working. I’m also using the extension Basic Screen Effects by Emily Short. If I can get the days to work I should be able to work out the months. Here’s the code I’m using:

[code]A month is a kind of value. The months are Mistleaf, Plumleaf, Azureleaf, Ambersun, Hazelsun, Embersun, Rimefall, Deepfall, Winterfall, Brightfrost, Shadowfrost, Blackfrost. The current month is a month that varies. The current month is mistleaf.

A day is a kind of value. The days are the First, Second, Third, Fourth, Fifth, Sixth, Seventh , Eigth, Ninth, Tenth, Eleventh, Last day. The current day is a day that varies. The current day is the First.

Table of Fancy Status
left central right
" [current day] day of [current month]" “” “”

Rule for constructing the status line:
fill status bar with Table of Fancy Status;
rule succeeds.

When play begins:
now the time of day is 11:59 PM.

Every turn:
if the time of day is 12:01 AM:
now the current day is the day after the current day.
[/code]

Quick question does Inform use 12:01 AM or 00:01 AM? Either way the status line does not seem to change with this code, any other ideas. I know I should probably be using a new rule instead of a every turn maybe you could tell me how to get the rule to work? I’ve got a feeling I’m missing something important or did something silly but I’ve been frustrated for over an hour now so all help appreciated.

The status line does change for me when I run that excerpt on its own. There must be some other code besides what you’ve posted that’s interfering.

Edit: My first suspicion would be the every-turn rule not running because of an earlier rule. Perhaps have it say something so that you can see when it’s triggered.

Also beware if you write any code to advance the current time more than one minute per turn. That would cause it to skip 12:01.

Ok I finally found the code, this is not the first time I’ve had this problem due to my excessively long code, so I’m now dividing it into smaller projects.

Now that I’ve got it working, is there away to calculate the days if there is a time skip. For example I want the player to be able to sleep to pass the night, how would I write this to work?

My I’m sure I’ll now have to use something other than a every turn rule, which I was only using while I worked on getting it to work, what kind of rule or other such code would be needed for this?

Probably your best bet is not to check for the time of day hitting a particular value, but for the time of day decreasing, which means it must have wrapped past midnight. In your previous code, that would look like this:[code]Include Basic Screen Effects by Emily Short.

A month is a kind of value. The months are Mistleaf, Plumleaf, Azureleaf, Ambersun, Hazelsun, Embersun, Rimefall, Deepfall, Winterfall, Brightfrost, Shadowfrost, Blackfrost. The current month is a month that varies. The current month is mistleaf.

A day is a kind of value. The days are the First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eigth, Ninth, Tenth, Eleventh, Last day. The current day is a day that varies. The current day is the First.

Table of Fancy Status
left central right
" [current day] day of [current month]" “” “[the time of day]”

Rule for constructing the status line:
fill status bar with Table of Fancy Status;
rule succeeds.

The last turn’s time of day is a time that varies.

When play begins:
now the last turn’s time of day is 11:58 PM;
now the time of day is 11:59 PM.

Every turn:
if the time of day is less than the last turn’s time of day:
now the current day is the day after the current day;
now the last turn’s time of day is the time of day.

There is a room.

Instead of waiting (this is the sleep for two days and eight hours and five minutes rule):
now the current day is the day after the day after the current day;
now the time of day is eight hours plus four minutes after the time of day [``four’’ because one minute is used up by taking the action].

Test me with “sing / jump / z / z / z”.[/code]
The same sort of trick with the days will let you decide when to advance the month.

That seems to work thank you!