Thread: [PI] Cannot End NPC Dialogue

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [PI] Cannot End NPC Dialogue 
    Registered Member
    Join Date
    Mar 2016
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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?

    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;
    	}
    }
    Here's what it's based off of.

    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);
    	}
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Mar 2015
    Posts
    244
    Thanks given
    72
    Thanks received
    47
    Rep Power
    32
    Add c.nextChat = 0;
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2016
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Teoz View Post
    Add c.nextChat = 0;
    I'm assuming this is how it should be. Let me know if I'm wrong.

    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;
    Edit: Okay, so now it just hangs on "Click here to continue" instead of looping.
    Reply With Quote  
     

  4. #4  
    Donator

    Join Date
    Mar 2015
    Posts
    244
    Thanks given
    72
    Thanks received
    47
    Rep Power
    32
    Quote Originally Posted by loloksure View Post
    I'm assuming this is how it should be. Let me know if I'm wrong.

    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;
    Correct sir, did it work?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2016
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Teoz View Post
    Correct sir, did it work?
    That solved the first part, thanks, but now it just hangs on "Click here to continue" instead of looping.
    Reply With Quote  
     

  6. #6  
    Donator

    Join Date
    Mar 2015
    Posts
    244
    Thanks given
    72
    Thanks received
    47
    Rep Power
    32
    Quote Originally Posted by loloksure View Post
    That solved the first part, thanks, but now it just hangs on "Click here to continue" instead of looping.
    Add my skype, king.teoz
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2016
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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.
    Reply With Quote  
     

  8. #8  
    Im an albatraoz

    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    31
    Posts
    948
    Thanks given
    233
    Thanks received
    128
    Rep Power
    241
    default case? else System.out.println(things u need to know here) and find that in your source code



    Looking for blazing fast and affordable vps or web hosting?
    AllGeniusHost



    Reply With Quote  
     

  9. #9  
    Developer


    Join Date
    Oct 2013
    Age
    29
    Posts
    1,038
    Thanks given
    689
    Thanks received
    321
    Rep Power
    260
    pretty sure it might be something like this:
    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;
    	}
    }
    you need a case for ending it as well.

    hope this helped
    Reply With Quote  
     

  10. Thankful user:


  11. #10  
    Registered Member
    Join Date
    Mar 2016
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by iDez View Post
    pretty sure it might be something like this:
    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;
    	}
    }
    you need a case for ending it as well.

    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;
    	}
    }
    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. [PI] Fixing 602 npc dialogue head size
    By BullETH in forum Snippets
    Replies: 17
    Last Post: 04-26-2014, 03:38 PM
  2. [PI] Help with npc dialogue
    By Conferva in forum Help
    Replies: 5
    Last Post: 11-16-2012, 07:54 AM
  3. [PI] Cannot attack npc!
    By Owner godlys in forum Help
    Replies: 11
    Last Post: 09-06-2011, 11:38 PM
  4. [Pi] NPC Dialogue Help
    By Mayday Parade in forum Help
    Replies: 5
    Last Post: 08-20-2011, 10:55 PM
  5. [PI] NPC Dialogue - Small Problem $10 [PI]
    By NathanCoder in forum Help
    Replies: 10
    Last Post: 10-16-2010, 12:36 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •