Adventure Book

version 1/110101 by Edward Griffiths

  • Home page
  • Beginning
  • Previous
  • Next



  • Example: ** Conversation Trees - How to create dialogue menus with story characters.

    The menu-based interface makes it very easy to set up a multi-tiered conversation tree where the player can select a subject to talk about, which leads to more available topics, resulting in a more or less natural conversational exchange. This sample game shows how to set up a very simple conversation tree where some choices will simply print a response and return to the same general subject, while others may lead to new subjects altogether.

    Notice, in particular, the use of pages with no description to hold the choices for the player's end of the conversation. This is so we can return to the same set of choices without interrupting the flow of the conversation by reprinting the statement that initiated them. In this case, we don't want to reprint the introductory text about sitting next to Keith every time we want to change the subject.

    Notice also how flags can be used to expand the options available on a subject based on what's already been discussed - the question about kissing a sting ray only appears when Keith has mentioned it in the conversation.

    Finally, we use the flag CARTELDISMISSED to keep track of whether or not Keith has admitted to the player that the story about his drug cartel is a lie. If he's already admitted to deception, it's not likely that he's going to try the same line again or that the player will fall for it, so we provide a different option in the list of subject that takes us right to the part of the conversation about sting rays.

        "A Chat With Keith" by Edward Griffiths
        
        Include Adventure Book by Edward Griffiths
        
        The First Page is a page.
        "The dinner seating on the cruise ship has placed you next to a rather charming young man in his late 20s who introduces himself as Keith Owens. As you wait for dinner to be served, you find yourself curious about him."
        It is followed by KeithTopics.
        
        KeithSubjects is a page.
        "What would you like to ask about?"
        It is followed by KeithTopics.
        
        KeithTopics is a page.
        A choice called keithtopa is for KeithTopics. "'What do you do for a living?'". It triggers SubjectChocolate.
        A choice called keithtopb is for KeithTopics. "'Do you have any hobbies?'". It triggers SubjectHobbies.
        A choice called keithtopc is for KeithTopics. "'What brings you to the Caribbean?'". It triggers SubjectCaribbean. It is cancelled by CARTELDISMISSED.
        A choice called keithtopd is for KeithTopics. "'When are you going to be swimming with the sting rays?'". It triggers SubjectStingRay. It requires CARTELDISMISSED.
        A choice called keithtope is for KeithTopics. "That's enough conversation for now." It triggers EndConversation.
        
        SubjectChocolate is a page.
        "'I run a chocolate shop, actually,' he notes. 'We specialize in hand-made confections. Just about everything is made on-site.'"
        It is followed by ChocolateTopics.
        
        ChocolateTopics is a page.
        A choice called choctopa is for ChocolateTopics. "'Is that difficult?'". It triggers SubjectDifficulty.
        A choice called choctopb is for ChocolateTopics. "'How did you get into the chocolate business?'". It triggers SubjectBusiness.
        A choice called choctopc is for ChocolateTopics. "Ask about something else." It triggers KeithSubjects.
        
        SubjectDifficulty is a page.
        "'Not when you've been doing it for as long as I have,' he notes."
        It is a dead end.
        
        SubjectBusiness is a page.
        "'Chocolate has been the family business going back almost a hundred and thirty years,' he notes. 'My father taught me everything I know about it. He still works there, keeping the books and everything.'"
        It is a dead end.
        
        SubjectHobbies is a page.
        "'Well, I like to go hiking whenever I can,' he says. 'I try to find some time every summer to go up to Wisconsin and explore the Kettle Moraine.'"
        It is followed by HobbyTopics.
        
        HobbyTopics is a page.
        A choice called hobtopa is for HobbyTopics. "'Are you an outdoorsman?'". It triggers SubjectOutdoors.
        A choice called hobtopb is for HobbyTopics. "'What's the Kettle Moraine?'". It triggers SubjectKettle.
        A choice called hobtopc is for HobbyTopics. "Ask about something else." It triggers KeithSubjects.
        
        SubjectOutdoors is a page.
        "'As much as possible,' he grins. 'Ever since I was a kid. They couldn't keep me indoors for anything.'"
        It is a dead end.
        
        SubjectKettle is a page.
        "'It's a region in Wisconsin that marks the furthest progress of the glaciers into North America during the last Ice Age,' he explains. 'There's a long trail that stretches for miles and miles through woods and fields. I like to put aside a few days and hike from one end of it to the other.'"
        It is a dead end.
        
        SubjectCaribbean is a page.
        "'I'm running heroin for my cartel,' he remarks casually, taking a sip of his wine."
        It is followed by CaribbeanTopics.
        
        CaribbeanTopics is a page.
        A choice called caribtopa is for CaribbeanTopics. "'... Really?'". It triggers SubjectReally.
        A choice called caribtopb is for CaribbeanTopics. "Politely change the subject." It triggers KeithSubjects.
        
        SubjectReally is a page.
        "Keith laughs. 'No, I've just always wanted to see the sting rays. I'm signed up for the shore excursion to Sting Ray City. They take you out to a sand bar in the middle of the ocean and let you swim with the sting rays.'"
        It gives CARTELDISMISSED. It is followed by StingRayTopics.
        
        SubjectStingRay is a page.
        "'That's scheduled for the third day, I believe,' he says."
        It is followed by StingRayTopics.
        
        StingRayTopics is a page.
        A choice called stingrtopa is for StingRayTopics. "'That sounds awfully dangerous.'". It triggers SubjectDangerous.
        A choice called stingrtopb is for StingRayTopics. "'Why sting rays?'". It triggers SubjectWhy.
        A choice called stingrtopc is for StingRayTopics. "'A kiss?'". It triggers SubjectKiss. It requires STINGRAYKISS.
        A choice called stingrtopd is for StingRayTopics. "Ask about something else." It triggers KeithSubjects.
        
        SubjectDangerous is a page.
        "He grins. 'Well, you only live once. Actually, sting rays tend to be very gentle animals; they hardly attack unless provoked.'"
        It is a dead end.
        
        SubjectWhy is a page.
        "He grins. 'I'm hoping to get a kiss.'"
        It gives STINGRAYKISS. It is a dead end.
        
        SubjectKiss is a page.
        "Keith nods. 'It's supposed to bring good luck.'"
        It is a dead end.
        
        EndConversation is a page.
        "Just as well, it looks like the waiter is coming."
        It is followed by The Last Page.