Note: these files have been tweaked slightly by Ron Hale-Evans
<evans@binah.cc.brandeis.edu>. See bottom of this document for a
list of changes.

*****************************************************************


      Directed Dialog v1.0
        by Trevor Powell

Well, because of popular interest, I've created this source code
to allow Directed Dialog in TADS adventures!  Right about now,
you're probably wondering what Directed Dialog is.  To answer
your questions, compile the DirectExample.T  file.  (Note -- this
code was created for use with TADS v2.1)  Run the
DirectExample.GAM file in the TADS Run-Time...  You'll play a
short (can we say, "4 room", boys and girls?) adventure with one
(count them, ONE) puzzle of ultra-easy difficulty.  Once you've
won the game, (plan to spend about 5 minutes) come back here.

=======================================

Welcome back!  Okay, by now you're wondering about how to do this
sort of thing in YOUR next adventure.  It's easy!  Just follow
these steps:

First, you need to #include the DirectDialog.T code in your main Game.T file.
Second, if you've defined a 'Talk' verb, YOU MUST REMOVE IT!
Third, create your TalkingActors!  Here's the format for a TalkingActor:

Actorname:  TalkingActor
  sdesc = "Actorname"     // adesc and thedesc are auto-set
  ldesc = "This is Actorname!"
  noun = 'Actor'
  adjective = 'name'
  openremark = &greet      //the first thing Actorname will say, prefaced by a &
;

Now, in addition to the above, you need to define one 'list' for
each branch of the conversation.  Here's the format:

method name = ['<what the actor says/does.. you need to put in
quotes manually>', <function to execute, prefaced by a &.  If no
function, type nil.>,

<<<  Note, at this point, you can put up to 10 different options
on what to say here.  Each consists of three elements in the
list, as follows. >>>

'\" <<option 1>> \"', <<true/nil or expression that evaluates to
true/nil.  This determines whether or not the option is
displayed.>>, <<name of the next branch to evaluate if this
option is chosen, prefaced by a &>>,

SO, an example from the DialogExample code is:

greet = ['\"Ah, hello..\" mumbles the old man, peering closely at
you.    \"How may I help you?\"', &nada, '\"Who are you?\"', true,
&notimp,  '\"How can I stop the reactor from exploding?\"', 
(cork.location = nil), &reactor, '\"What am I supposed to do with
this cork?\"', (cork.location = Me), &whatdo, '\"Say, did I ever
tell you about how I killed LeChuck?\"',        (cork.location =
nil),   &notimp, '\"Excuse me.. I thought I wanted to talk to you,
but I don\'t.\"', true, &bye]

Let's step through it.

'\"Ah, hello..\" mumbles the old man... may I help you?\"'  This
is what the old man says.

&nada is the function to be executed.  (the Directed Dialog code
can be tempramental sometimes..  usually if you don't want
anything to happen, you can type 'NIL', but occaisionally that
will give the compiler hairballs for reasons I haven't figured
out as of yet..  For now, when this happens, just type &nada
instead.  That will have the same effect.)

'\"Who are you?\"' is the first option.  'true' says that it will
always be given as an option, '&notimp' gives the name of the
next list to execute if this option is chosen.

If you look forward, you'll see that later on (in the option
'\"How can I stop the reactor...\"'), the 'will the option be
displayed?' is (cork.location= nil) which means that the option
will only be displayed if the cork's location is nil.  (ie: if
the old man hasn't given it to you yet).  Similarly, if you only
want a player to be able to select an option once, you can set a
variable to true, use the variable to determine whether or not
the option will be displayed, and have the function called by the
next conversation branch change the setting of the variable.

I hope that this made sense!

==========================================

Okay, I know what you're all asking.  You're all saying, "This
stuff is too cool for him to just give it away for free."  And
you're right, I'm not giving it away for nothing.. However, I do
want you to write in 'Directed Dialog by Trevor Powell' somewhere
in any adventure you create using the Directed Dialog code.  (And
the more obscure the place, the better)  For example, in the
sample code, (as you probably noticed while looking through the
code) if you try to go north or south in the hallway a total of 6
times, you'll get a message saying 'Directed Dialog by Trevor
Powell'

That's it!  Just stick the note on a faded scroll of paper that's
hidden behind a loose brick in a large brick wall or wherever you
like..  The only requirement is that no points be attached to
finding the message, and that there be no requirement in the game
to have found the message.  Have fun!  :)

==========================================

If you have any questions, I can be reached at:

AOL:  LeGarre
BMUG BBS:  Trevor Powell
High NRG BBS: Trevor Powell
Internet:  LeGarre@AOL.COM

And I read the Mac Gamers forum on AOL daily, so leave a message
for me there and you should get a response within 24 hours!  :)

**************************************************************

Tweaks to these files by Ron Hale-Evans:

"DirectDialog Read Me!" filename changed to README.TXT.

"DirectExample.T" filename changed to DEXAMPLE.T.

"DirectDialog.T" filename changed to DIALOG.T; #include in DEXAMPLE.T
changed accordingly.

Lines wrapped in README.TXT and file format changed from CR to
CR/LF on all files.

Directory name changed to DDIALOG.

All three files tarred and compressed.

Great package, Trevor!

--RWHE, 2 Feb 94
