[Inform] how to force player to sleep.

8 views
Skip to first unread message

Bruce Loving

unread,
Aug 15, 2001, 6:40:15 PM8/15/01
to
I want to force a player to sleep for x turns if they
enter a bed. I have a timer created and know how
to check the time_left value.

do I have to create a Before event for
every possible action the player could take?
I would like the program to return 1 message
ala "You slumber peacefully" no matter what
the player types.
Thankx


Roger Firth

unread,
Aug 16, 2001, 3:03:19 AM8/16/01
to
"Bruce Loving" <blo...@triad.rr.com> wrote in message
news:jTCe7.122137$J37.30...@typhoon.southeast.rr.com...

One easy way might be to put a Before action like
this on the Bedroom containing the bed:

before [; if (bed.time_left > 0) "You slumber peacefully."; ],

The Inform FAQ has a bit more on similar topics:
http://homepages.tesco.net/~roger.firth/informfaq/vv.html

Cheers, Roger
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
You'll find my Cloak of Darkness, Parsifal, Informary
and more at http://homepages.tesco.net/~roger.firth

Bruce Loving

unread,
Aug 16, 2001, 9:16:15 AM8/16/01
to
Thanks Roger, didnt know I could do that.
Thought Before required an Action.


John Colagioia

unread,
Aug 16, 2001, 10:21:56 AM8/16/01
to
Bruce Loving wrote:

Well, you could just have an orders() method on the player, which
simply tests time_left and does something, without trapping any
explicit actions.

However, if I understand the question correctly, that will cause the
player to be stuck with nothing to do until the sleep timer runs out.
That might be a bit...I dunno...boring(?) in a game. Would it be
better, perhaps, to just mess with the number of turns elapsed and
describe the experience to the player?


Alex Watson

unread,
Aug 16, 2001, 2:05:36 PM8/16/01
to
Bruce Loving scripsit in rec.arts.int-fiction. Caecilius est pater.

I have to say that personally, I'd be bored by a game in which I had to
sleep for a certain number of turns; I'd suggest that it would be better to
simply increase the turns counter (turns=turns+5;, for example) and say
"You sleep for 5 turns (or whatever)."

--
Alex Watson
http://www.watson1999-69.freeserve.co.uk/froup/
Replies to me[AT]watson1999-69.freeserve.co.uk
"Error: Keyboard not attached. Press F1 to continue."

Bruce Loving

unread,
Aug 17, 2001, 12:11:18 PM8/17/01
to
You know that makes sense, thank you.


Jaap van der Velde

unread,
Aug 21, 2001, 4:12:00 AM8/21/01
to
On Thu, 16 Aug 2001 19:05:36 +0100, Alex Watson
<alexw...@deadspam.com> wrote:

> I have to say that personally, I'd be bored by a game in which I had to
> sleep for a certain number of turns; I'd suggest that it would be better to
> simply increase the turns counter (turns=turns+5;, for example) and say
> "You sleep for 5 turns (or whatever)."

I was rather liking the idea of required sleep in a game.
Although I agree on the method of incrementing turns
(-can- it be done? what about turns=turns-5 then, that
should create interesting problems, so i suspect you
have to actually pass those turns one way or another),
the idea of required sleep is fun. For instance, your
character could be very susceptible to daydreaming and
need to sleep regularly to stay clear, notice more when
bright awake, have strange dreams during the nighttime
(now -there-'s a way to while away those turns :) or be
too tired to finish some puzzles but also under time-
pressure from the structure of the story.

Grtz,
JAAP.

L. Ross Raszewski

unread,
Aug 21, 2001, 4:52:14 AM8/21/01
to
On Tue, 21 Aug 2001 08:12:00 GMT, Jaap van der Velde <ve...@bigfoot.com> wrote:
>
>I was rather liking the idea of required sleep in a game.
>Although I agree on the method of incrementing turns
>(-can- it be done? what about turns=turns-5 then, that
>should create interesting problems, so i suspect you
>have to actually pass those turns one way or another),
>the idea of required sleep is fun. For instance, your
>character could be very susceptible to daydreaming and
>need to sleep regularly to stay clear, notice more when
>bright awake, have strange dreams during the nighttime
>(now -there-'s a way to while away those turns :) or be
>too tired to finish some puzzles but also under time-
>pressure from the structure of the story.

The trickiest thing is keeping the daemons and timers
working. Essentially, you need to call InformLibrary.EndTurnSequence()
once for every turn you want to spend "in passivity". See waittime.h
or timewait.h for a thorrough implementation.

*If there are scheduled events which can radically change the game
world, you might want to implement a "You are awakened from your sleep
by the occurance of something important" feature. This is fairly easy;
you just need to set a "waiting interrupted" flag whenever an
"important event" occurs, and check it before you call EndTurnSequence
each time.

James Wyatt

unread,
Oct 7, 2001, 1:01:28 PM10/7/01
to
> I'd suggest that it would be better to
> simply increase the turns counter (turns=turns+5;, for example) and say
> "You sleep for 5 turns (or whatever)."
>
Wouldn't that throw out any timers and/or daemons running at the time?


L. Ross Raszewski

unread,
Oct 7, 2001, 1:56:56 PM10/7/01
to


Easiest way to do this:

for(i=0:i<5:i++) InformLibrary.EndTurnSequence();

More complex versions can be found in, say waittime.h and timewait.h.

Reply all
Reply to author
Forward
0 new messages