Thread: PI] Dialogue options?

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 PI] Dialogue options? 
    Registered Member Neruzycra's Avatar
    Join Date
    Nov 2010
    Posts
    185
    Thanks given
    4
    Thanks received
    5
    Rep Power
    1
    So, how can I add options like first someone asks that "how are you?" then the player has two options: "Fine" "I'm feeling down" and if the player picks fine then the npc will say "Me too" if the player picks I'm feeling down then the npc says "Cheer up". I know that sounds confusing but that's what I'm looking for and I know it has something to do with Dialogue Actions.

    Prepare to lose it...
    Reply With Quote  
     

  2. #2  
    Registered Member Neruzycra's Avatar
    Join Date
    Nov 2010
    Posts
    185
    Thanks given
    4
    Thanks received
    5
    Rep Power
    1
    bumb Someone help I need this badly

    Prepare to lose it...
    Reply With Quote  
     

  3. #3  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Alright I haven't done this in a while but;

    You have to use repetitive cases or a switch case when handling dialogue. You'll have to use something similar to this when using a npc/player based dialogue.
    Code:
    case 1:
    sendNpcChat4("Hey how are you,", "My name is blablabla.", "Would you help me with this?", "I can do something for you.", c.talkingNpc, Algorithm");
    nextChat = 2;
    break;
    If you want to make choice you use a sendOption method.

    Code:
    case 2:
    sendOption2("Yes I will help you", "No, I have better shit to be doing");
    nextChat = 3;
    break;
    Note that the "nextChat" integer is actually not constant. The number changes depending on what case you want to trigger after your statement has finished.

    Also, for dialogue it's smart to use if statements because it will help when doing questing and various other very useful aspects of dialogue handlers.

    example;

    if (playerRights >= 2) {
    case 2:
    sendOption2("Yes I will help you", "No, I have better shit to be doing");
    nextChat = 3;
    } else {
    sendNpcChat2("Sorry", "You suck", c.talkingNpc, Algorithm");
    }
    break;

    hope this helped, if you need anymore help just give me a shout.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    I made a tuturial for this..
    Reply With Quote  
     

  5. #5  
    Registered Member Neruzycra's Avatar
    Join Date
    Nov 2010
    Posts
    185
    Thanks given
    4
    Thanks received
    5
    Rep Power
    1
    Quote Originally Posted by theowner123 View Post
    I made a tuturial for this..
    Can't find it, link?

    Quote Originally Posted by Algorithm View Post
    Alright I haven't done this in a while but;

    You have to use repetitive cases or a switch case when handling dialogue. You'll have to use something similar to this when using a npc/player based dialogue.
    Code:
    case 1:
    sendNpcChat4("Hey how are you,", "My name is blablabla.", "Would you help me with this?", "I can do something for you.", c.talkingNpc, Algorithm");
    nextChat = 2;
    break;
    If you want to make choice you use a sendOption method.

    Code:
    case 2:
    sendOption2("Yes I will help you", "No, I have better shit to be doing");
    nextChat = 3;
    break;
    Note that the "nextChat" integer is actually not constant. The number changes depending on what case you want to trigger after your statement has finished.

    Also, for dialogue it's smart to use if statements because it will help when doing questing and various other very useful aspects of dialogue handlers.

    example;

    if (playerRights >= 2) {
    case 2:
    sendOption2("Yes I will help you", "No, I have better shit to be doing");
    nextChat = 3;
    } else {
    sendNpcChat2("Sorry", "You suck", c.talkingNpc, Algorithm");
    }
    break;

    hope this helped, if you need anymore help just give me a shout.
    Thanks for that but I really need to know how to make it show different dialogues for different answers if you know what I mean.

    Prepare to lose it...
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jun 2010
    Age
    29
    Posts
    891
    Thanks given
    22
    Thanks received
    47
    Rep Power
    0
    sendNpcChat2("Sorry", "You suck", c.talkingNpc, Algorithm");

    change the sendNpcChat2 to something diffrent?
    hi
    Reply With Quote  
     

  7. #7  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by Syndicate View Post
    sendNpcChat2("Sorry", "You suck", c.talkingNpc, Algorithm");

    change the sendNpcChat2 to something diffrent?
    Yeah thats basically all you do. At the bottom of the class, if i can remember; There should be about 9-11 constructed voids such cash sendOption, sendOption2 etc. Just use those and apply them how you're suppose to and you'll get what you need. Simple enough?

    If you can't get it, tell me what you want it to say and i'll just do it for you, it's easy.
    Reply With Quote  
     

  8. #8  
    Registered Member Neruzycra's Avatar
    Join Date
    Nov 2010
    Posts
    185
    Thanks given
    4
    Thanks received
    5
    Rep Power
    1
    Quote Originally Posted by Algorithm View Post
    Yeah thats basically all you do. At the bottom of the class, if i can remember; There should be about 9-11 constructed voids such cash sendOption, sendOption2 etc. Just use those and apply them how you're suppose to and you'll get what you need. Simple enough?

    If you can't get it, tell me what you want it to say and i'll just do it for you, it's easy.
    Ok, this was my fault because I didn't explain properly what I was looking for. The thing is I already had the correct cases (including sendoptions...), but I needed to know how to add the correct methods to clicingbuttons so it would send different dialogues for different options. I already had tested your way and it didn't work. Sorry if I'm beeing confusing.

    EDIT: Nvm fixed it by myself. Thanks for the help anyway

    Prepare to lose it...
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    KK here's a quick tut:

    sendOption2("Dismiss my familar", "Nevermind i let it stay!");
    thats the option if you want to change the amount of options change
    sendOption2
    to
    3
    and add a
    "",
    after the
    (
    so we are using 2 options. now to make them activate:
    under your ''case'' (example):
    case 400:
    sendOption2("Dismiss my familar", "Nevermind i let it stay!");
    c.dialogueAction = 61;
    break;
    you got a dialogueactions, this is 61 in my case. okay so now go to clickingbuttons.java
    search for
    case 9157:
    you should see all dialogueshit into there
    this is the action for the FIRST option. so i wanted to dismiss my familar in here:

    if (c.dialogueAction == 61) {
    if (c.hasNpc) {
    for(int i = 0; i < 29; i += 1)
    {
    c.storeditems[i] = -1;
    c.occupied[i] = false;
    c.firstslot();
    c.lastsummon = -1;
    c.totalstored = 0;
    c.summoningnpcid = 0;
    c.getSummon().pickUpClean(c, c.summonId);
    c.summoningslot = 0;
    if (!c.hasNpc) {
    c.sendMessage("You dont have a follower.");
    }
    }
    }
    }
    the dialogueaction = 61 gets back into there. so now its working.

    now to make the second option work go to:

    case 9158:
    now you should see alot of dialogueactions neither.
    i wanted to let my familar stay so there wont be a action:
    if(c.dialogueAction == 61) {
    c.getDH().sendDialogues(0, 0);
    }
    and btw:

    once you using (i thought +3 options not sure) you should use
    case 9190:
    case 9191
    case 9192
    case 9193
    case 9194

    instead of the ones above, but just check your CMD for that.
    Reply With Quote  
     

  10. #10  
    Registered Member Neruzycra's Avatar
    Join Date
    Nov 2010
    Posts
    185
    Thanks given
    4
    Thanks received
    5
    Rep Power
    1
    Quote Originally Posted by theowner123 View Post
    KK here's a quick tut:



    thats the option if you want to change the amount of options change to and add a after the so we are using 2 options. now to make them activate:
    under your ''case'' (example):


    you got a dialogueactions, this is 61 in my case. okay so now go to clickingbuttons.java
    search for you should see all dialogueshit into there
    this is the action for the FIRST option. so i wanted to dismiss my familar in here:



    the dialogueaction = 61 gets back into there. so now its working.

    now to make the second option work go to:


    now you should see alot of dialogueactions neither.
    i wanted to let my familar stay so there wont be a action:


    and btw:

    once you using (i thought +3 options not sure) you should use
    case 9190:
    case 9191
    case 9192
    case 9193
    case 9194

    instead of the ones above, but just check your CMD for that.
    This was exactly what I was looking for and I didn't know how to add more dialogueactions so thanks for that

    Prepare to lose it...
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [508] Bulby Source - NPC Dialogue Options
    By Elit3k1lla in forum Help
    Replies: 3
    Last Post: 12-20-2010, 12:10 AM
  2. [Request]Options dialogue method
    By Jattio in forum Help
    Replies: 2
    Last Post: 03-09-2010, 08:58 AM
  3. Npc dialogue options.
    By SODIO in forum Tutorials
    Replies: 4
    Last Post: 06-22-2008, 12:03 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •