The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 8 of 8

Thread: Speaking to other characters in a "point and click" game

  1. #1

    Speaking to other characters in a "point and click" game

    Okay so i'm creating a Monkey island type point and click adventure system. I've got my character walking, I've got my character picking stuff up and storing them into an inventory, I've got my character saying things, but I can't quite get my head around how I'm going to make him talk to other characters.

    So far the character can say things when he picks up an object, or looks at an object. I can even store an array of things to say, and he can say one after another.
    But talking to another person is different, I want to be able to choose what to say, then the main character say something, then the other character, then the main character again, etc etc... so I am a bit stuck.

    I will attach my full source up here, which might be useful for someone just starting to write their own point and click game. I think it's all fairly sensible and well commented.

    If anyone has any good ideas about methods for creating a talking system please let me know!
    Attached Files Attached Files

  2. #2
    I didn't check your code yet, but, for a starter, you'll probably have to create a whole interface just for dialogues. It's not only what your character talk, but what options he has and how the other character will react to each of them. It's called a dialogue tree and it's quite complex to implement. Also, if you want dialogues to have an impact in the game, like changing the state of an item, inventory, etc, the interface becomes even more complex! I'll take a look at the file you sent and I'll let you now if I come up with anything.
    Bruno Palermo
    When everything is catastrophic, thank the Gods things aren't worse!

  3. #3
    Okay thanks, i anticipate it to be quite complicated, and had been mulling it over for quite a while. I have attached a new file, if you preview the game you can choose to talk to the pink box in the first room, which leads to simple banter. The character says hello, then the other person says something back, and vice versa.

    In the second room you can talk to someone else, and have a choice of three speech options (and a "goodbye"). Selecting an option will lead to some more simple banter, and then back to the list of options again.

    How I've done this is very simple really, I just have two arrays attached to the target that you speak to. The first array is characterSpeech, which has everything the character says. The second is targetSpeech, which the target says. I loop through and display both at the same time, so have to make sure the character's entry in the array is null when the target is speaking, and vice versa.

    This may be a really bad way of doing it, I'm not sure. I don't think I'm a bad programmer, but I have picked up many bad habits over the years!

    I have included my source code which you might want to look at if you are creating your own point and click adventure game.
    Attached Files Attached Files

  4. #4
    207
    posts
    Registered User
    Unless you need the ability to have both characters talking simultaneously, I don't think I would have used the two arrays thing. I would have one array of objects, where each object contains who is talking, and what they say.

    And the conversations they have in these games is kind of like a tree. So you'd also want entries that allow you to branch; arrays within arrays, at least a few levels deep.

  5. #5
    I understand what you're saying, and wanted to do it that way, so that one person speaks, then you move to the next item in the array, and you know that the other person speaks. But even still surely you still need two arrays: one with the speech, and one to say who is talking.

    Creating a conversation tree would also be very complicated. My current script doesnt actually require it, so I'm not going to create one for this game. As long as I have a few options it's okay, and I don't mind that you can ask the same options again. Maybe in the future!

    Just out of interest, how would you set up the tree rrh?
    ----------------------
    Flasher Games

  6. #6
    207
    posts
    Registered User
    Not two arrays. One array, which contains objects, like this: {speaker:"George",speech:"Why hello there."}

    Or I might do it all in XML, which would lend itself well to the Tree structure.

  7. #7
    I have never seen an array in flash done like that tbh, my knowledge of arrays is here: http://www.kirupa.com/developer/actionscript/array.htm

    I can't find any documentation on this type of array. Does it have a particular name?
    ----------------------
    Flasher Games

  8. #8
    207
    posts
    Registered User
    That is not an array. It is an object. This is an array of objects:
    [{speaker:"George",speech:"Why hello there."},{speaker:"Frank",speech:"Hello. How are you?"}]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012