Add c.nextChat = 0;
|
Bare with me, I'm completely new at this. From what I'm aware, break should be ending the conversation, or at least stopping it from looping. I am using Project Insanity as my source.
The first line of dialogue shows up, and clicking continue brings me to the second line of dialogue, but it just hangs there.
Am I missing anything?
Here's what it's based off of.Code:public void sendDialogues(int dialogue, int npcId) { c.talkingNpc = npcId; switch(dialogue) { case 1: sendNpcChat1("Testing!", c.talkingNpc, "testman"); c.nextChat = 2; break; case 2: sendNpcChat1("Get outta here, faggot.", c.talkingNpc, "testman"); break; } }
Code:private void sendNpcChat1(String s, int ChatNpc, String name) { c.getPA().sendFrame200(4883, 591); c.getPA().sendFrame126(name, 4884); c.getPA().sendFrame126(s, 4885); c.getPA().sendFrame75(ChatNpc, 4883); c.getPA().sendFrame164(4882); }
Add c.nextChat = 0;
I'm assuming this is how it should be. Let me know if I'm wrong.
Edit: Okay, so now it just hangs on "Click here to continue" instead of looping.Code:case 1: sendNpcChat1("Testing!", c.talkingNpc, "testman"); c.nextChat = 2; break; case 2: sendNpcChat1("Get outta here, faggot.", c.talkingNpc, "testman"); c.nextChat = 0; break;
I added you am I'm waiting for a response. It's late though, so I'm about to head off to bed.
I can add more dialogue to the NPC, just cannot end it. I have tried closeallwindows as well.
pretty sure it might be something like this:
you need a case for ending it as well.Code:public void sendDialogues(int dialogue, int npcId) { c.talkingNpc = npcId; switch(dialogue) { case 0: //case 0 ends the conversation. c.talkingNpc = -1; c.getPA().removeAllWindows(); c.nextChat = 0; break; case 1: sendNpcChat1("Testing!", c.talkingNpc, "testman"); c.nextChat = 2; //case 2 break; case 2: sendNpcChat1("Get outta here, faggot.", c.talkingNpc, "testman"); c.nextChat = 3; //case 3 break; case 3: sendNpcChat1("next message", c.talkingNpc, "testman"); c.nextChat = 0; // the 0 is the case. break; } }
hope this helped
This worked! Thank you!
The c.nextChat = 0; after removeAllWindows(); wasn't needed in this case.
This is the final result to end dialogues for anyone else interested in the future, since I know how much we all hate "pm me for fix".
Code:public void sendDialogues(int dialogue, int npcId) { c.talkingNpc = npcId; switch(dialogue) { case 0: //case 0 ends the conversation c.talkingNpc = -1; c.getPA().removeAllWindows(); break; case 1: sendNpcChat1("F A G G O T",c.talkingNpc, "testman"); c.nextChat = 0; break; } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |