So... before I plunge down the slippery slope of tracking this down...
is is even possible?
Can I include REPLAY in the non-debug version of my game?
Thanks!
Kathleen
--
-- The Cove - Best of Landscape, Interactive Fiction Art Show 2000
-- ftp://ftp.gmd.de/if-archive/games/zcode/Cove.z5
--
-- Excuse me while I dance a little jig of despair
Sent via Deja.com http://www.deja.com/
Before you buy.
> I would like to be able to keep the REPLAY command in my game, but it
> seems to be a "debug only" feature. I even tried copying the
> CommandsReadSub() routine and appropriate meta grammar into my game and
> using IFNDEF's to make them show up right, which worked fine, except the
> variable they were setting wasn't there then (xcommsdir)
>
> So... before I plunge down the slippery slope of tracking this down...
> is is even possible?
>
> Can I include REPLAY in the non-debug version of my game?
Funny you should ask; that's just what I wanted to do as well. And tried
the same things. And decided that xcommsdir probably didn't matter...
So I've been using:
#Ifndef DEBUG;
[ myCommandsReadSub; @input_stream 1; "[Replaying commands.]"; ];
Verb 'replay' * -> myCommandsRead;
#Endif;
and (so far, touch wood) it hasn't bitten me. So I guess we'll sink or swim
together.
Cheers, Roger
--
========================================================================
Roger Firth
Well, I tried it, and it worked. :) I wonder why that particular
command is considered a debug only one?
Kathleen <looking around anxiously then jumping in the water. Brrrrr>
: Can I include REPLAY in the non-debug version of my game?
Here's code from Edifice (to include after grammar):
#ifndef DEBUG;
Verb meta 'recording'
* -> CommandsOn
* 'on' -> CommandsOn
* 'off' -> CommandsOff;
Verb meta 'replay'
* -> CommandsRead;
Verb meta 'random'
* -> Predictable;
Global xcommsdir;
[ CommandsOnSub;
@output_stream 4; xcommsdir=1; "[Command recording on.]"; ];
[ CommandsOffSub;
if (xcommsdir==1) @output_stream -4;
xcommsdir=0;
"[Command recording off.]"; ];
[ CommandsReadSub;
@input_stream 1; xcommsdir=2; "[Replaying commands.]"; ];
[ PredictableSub i; i=random(-100);
"[Random number generator now predictable.]"; ];
#endif;
The 'random' is important if your game has random events; 'recording' so
players can make their own walkthroughs and the like.
[Note: The above code was copied from the relevant sections of an earlier
version of the library (6/7) so it might be worth checking to make sure
nothing's changed.]
-Lucian