bumb Someone help I need this badly
|
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.
bumb Someone help I need this badly
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.
If you want to make choice you use a sendOption method.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;
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.Code:case 2: sendOption2("Yes I will help you", "No, I have better shit to be doing"); nextChat = 3; break;
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.
I made a tuturial for this..
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.
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
KK here's a quick tut:
thats the option if you want to change the amount of options changesendOption2("Dismiss my familar", "Nevermind i let it stay!");tosendOption2and add a3after 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.javacase 400:
sendOption2("Dismiss my familar", "Nevermind i let it stay!");
c.dialogueAction = 61;
break;
search foryou should see all dialogueshit into therecase 9157:
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.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.");
}
}
}
}
now to make the second option work go to:
now you should see alot of dialogueactions neither.case 9158:
i wanted to let my familar stay so there wont be a action:
and btw:if(c.dialogueAction == 61) {
c.getDH().sendDialogues(0, 0);
}
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |