1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question NPC chat interaction

Discussion in 'Developer Support' started by callumhutchy, Aug 19, 2018.

  1. callumhutchy

    Joined:
    Dec 6, 2015
    Messages:
    3
    Likes Received:
    0
    I've had a look around and I can't find anything to help with talking to npcs, such as quest givers.

    Are there any basic examples of going through an npc chat dialog? Preferably using a treebot.
     
  2. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,121
    Likes Received:
    1,378
    What you're looking for is the ChatDialog class.

    Eg.
    Code (Text):
    1. ChatDialog.Continue cont = ChatDialog.getContinue();
    2. if(cont!=null){
    3. cont.select();}
    4.  
    5. ChatDialog.Option opt1 = ChatDialog.getOption("yes I'll do the quest 4 u m8");
    6. if(opt1!=null){
    7. opt1.select();}
    Hopefully this code is correct, I just woke up and I'm writing this post from my phone
    --- Double Post Merged, Aug 19, 2018, Original Post Date: Aug 19, 2018 ---
    ChatDialog
     
    The_Crumb likes this.
  3. callumhutchy

    Joined:
    Dec 6, 2015
    Messages:
    3
    Likes Received:
    0
    Thanks, i've just had a go with that and it works. Is there a correct way of waiting for the next chat window to appear, at the moment my bot has ADHD?
     
  4. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,121
    Likes Received:
    1,378
    For that you'll want to read up more on Delays: Tutorial - The Usage of Delays
     
  5. Negrita

    Joined:
    Jan 28, 2017
    Messages:
    491
    Likes Received:
    183
    You can also either check the interface component IDs or the text within the ChatDialog to valid on which step you are.
     
    CuppaJava likes this.

Share This Page

Loading...