Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Time...?

11 views
Skip to first unread message

Chad Anderson

unread,
Jul 3, 1995, 3:00:00 AM7/3/95
to
Well now that I have helped someone I think I can ask a question. :)
I can't figure out how to have the game keep track of the time. I want it
to start at 8PM and keep counting. (because I have some events I want to
happen at certain times)

I am using Inform 5.4

Thanx
chad

--
Chad Anderson ch...@winternet.com http://www.winternet.com/~chada/
GCS/GCM d? H s+ g+ !a w++ C++@ SU P+>++ L E---- N++ W--- M++$ Y+ t+++
5- G? tv b+ u--- h! f++ ÒI donÕt like stuff that sucks.Ó -Butt-Head

Tim Middleton

unread,
Jul 6, 1995, 3:00:00 AM7/6/95
to
CC= I can't figure out how to have the game keep track of the time. I
CC= want it to start at 8PM and keep counting. (because I have some
CC= events I want to happen at certain times)

Your answer is found in Chapter 14.3 of the Designer's manual... You might
be interested to know that this chapter section is completely incoherantly
entitled "Routines that Run when an Object is in Scope"... nevertheless, it
holds the info about using "clock" style time keeping. Excerpt follows:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

If you're writing a game with the time instead of the score and turns on
the status line, you can set the time by

SetTime( 60 * HOURS + MINUTES, RATE );

The current time is held in the variable `the_time' and runs on a
24-hour clock. The RATE controls how rapidly time is moving: a RATE of
0 means it is standing still (that is, that the library doesn't change
it: your routines still can). A positive RATE means that that many
minutes pass between each turn; and negative RATE means that many turns
pass between each minute.

The time still won't appear on the game's status line unless you set

Statusline time;

as a directive somewhere in your code. And remember to start off the
clock by calling `SetTime' in your `Initialise' routine, if you're
going to use it.


---
.....with love and squalor. <as...@torfree.net>

Gareth Rees

unread,
Jul 14, 1995, 3:00:00 AM7/14/95
to
Chad Anderson <ch...@winternet.com> wrote:
> I can't figure out how to have the game keep track of the time. I want
> it to start at 8PM and keep counting. (because I have some events I
> want to happen at certain times). I am using Inform 5.4.

See chapter 14 of the Inform manual: use `Statusline Time' near the
start of your code, and put a `SetTime(60*h+m,r)', where h:m is the time
of day (on a 24-hour clock), and r is positive if each turn is r minutes
long, and negative if there are -r turns in each minute. The time is
stored in the variable `the_time', and you can fetch the hour using
`the_time / 60' and the minute using `the_time % 60'. Events that
happen at certain times of day are best done by writing a `TimePasses'
routine that watches `the_time', rather than by fiddling with daemons
and timers.

Having said that, as a player I have trouble with games in which events
are set off at particular times and places. I play very slowly (lots of
examines, lots of wrong guesses before I solve a puzzle), so typically
it is already too late by the time I find the clue telling me where I
should be. So I have to go back to a saved game and play through the
puzzle as quickly as I can so as to be in the right place at the right
time. This is annoying, to say the least.

There are various solutions to this. One is to say "tough: keep playing
until you get it right" (this is the solution used by Infocom's
mysteries). Another is for events to be particular times, but to happen
at the same time every day, or at regular intervals, so that if you miss
the event one day you can catch it the next (Legend's "Gateway" uses
this, and gets away with it because of the nature of the timed events -
people visiting their local bar, an orientation meeting, a seminar - is
such that it's plausible they should be recurrent).

A third solution is to have time passing, and timed events, but to
abandon the idea that there should be a strict relationship between
number of turns and time of day. The game should just wait until the
player is in the right place and has solved all the necessary puzzles,
and then it should automatically be the right time. I haven't seen this
in any existing game, but my own game-in-progress "Christminster" does
this. Obviously it greatly restricts the kind of timed events that you
can have, but it frees the player from the necessity of counting turns
and always worrying that something interesting is happening elsewhere.

--
Gareth Rees

0 new messages