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
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
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?
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."
> 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.
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.
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.