Thread: [718] Dialogue works, but only once.

Results 1 to 5 of 5
  1. #1 [718] Dialogue works, but only once. 
    Registered Member
    Join Date
    Jul 2014
    Posts
    376
    Thanks given
    41
    Thanks received
    5
    Rep Power
    11
    I have a dialogue for teleports, but for some reason when I press the back button on the second page, it goes back but then ALL the buttons stop working.
    So what I mean is it works until you press the back button. It's almost like the dialogue is breaking when the back button is chosen.

    Any ideas? This is my Dialogue:

    Code:
    package core.framework.game.player.dialogues;
    
    import core.framework.game.WorldTile;
    import core.framework.game.player.content.Magic;
    
    public class Dungeons extends Dialogue {
    
    	@Override
    	public void start() {
    		stage = 1;
    		if (stage == 1) {
    			sendOptionsDialogue("Teleports",
    					"<col=ff0000>Polypore Dungeon</col>",
    					"<col=ff0000>Brimhaven Dungeon</col>",
    					"<col=ff0000>Feldip Hills</col>",
    					"<col=ff0000>Barrows</col>",
    					"<col=ff0000>More</col>");
    			stage = 2;
    		}
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		if (stage == 2) {
    			if (componentId == OPTION_1) {
    				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4625,
    						5463, 0));
    			}
    			if (componentId == OPTION_2) {
    				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2709,
    						9464, 0));
    			}
    			if (componentId == OPTION_3) {
    				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2570,
    						2916, 0));
    			}
    			if (componentId == OPTION_4) {
    				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3565,
    						3307, 0));
    			}
    			if (componentId == OPTION_5) {
    				sendOptionsDialogue("Teleports",
    						"<col=ff0000>Frost Dragons</col>",
    						"<col=ff0000>Fire Giants</col>",
    						"<col=ff0000>Lesser Demons</col>",
    						"<col=ff0000>Back</col>");
    				stage = 3;
    				}
    			} 
    			if (stage == 3) {
    					if (componentId == OPTION_1) {
    						Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1297,
    								4510, 0));
    					} if (componentId == OPTION_2) {
    						Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2928,
    								9803, 0));
    					} if (componentId == OPTION_3) {
    						Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2657,
    								9490, 0));
    					} if (componentId == OPTION_4) {
    					sendOptionsDialogue("Teleports",
    						"<col=ff0000>Polypore Dungeon</col>",
    						"<col=ff0000>Brimhaven Dungeon</col>",
    						"<col=ff0000>Feldip Hills</col>",
    						"<col=ff0000>Barrows</col>",
    						"<col=ff0000>More</col>");
    					stage = 1;
    					}
    				}
    		}
    
    	/*
    	 * private void teleportPlayer(int x, int y, int z) {
    	 * player.setNextWorldTile(new WorldTile(x, y, z)); player.stopAll();
    	 * player.getControlerManager().startControler("GodWars"); }
    	 */
    
    	@Override
    	public void finish() {
    		// TODO Auto-generated method stub
    
    	}
    
    }
    Reply With Quote  
     

  2. #2  
    💰💰💰💰💰💰

    Con Artist's Avatar
    Join Date
    Jan 2012
    Posts
    1,313
    Thanks given
    666
    Thanks received
    268
    Rep Power
    89
    Code:
    } if (componentId == OPTION_4) {
                        sendOptionsDialogue("Teleports",
                            "<col=ff0000>Polypore Dungeon</col>",
                            "<col=ff0000>Brimhaven Dungeon</col>",
                            "<col=ff0000>Feldip Hills</col>",
                            "<col=ff0000>Barrows</col>",
                            "<col=ff0000>More</col>");
                        stage = 1;
                        }
    why are you sending the options again? can't you just set the stage to 1? That would send the options properly and the buttons should work
    widdy widdy

    /|\
    / \
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Jul 2014
    Posts
    376
    Thanks given
    41
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Con Artist View Post
    Code:
    } if (componentId == OPTION_4) {
                        sendOptionsDialogue("Teleports",
                            "<col=ff0000>Polypore Dungeon</col>",
                            "<col=ff0000>Brimhaven Dungeon</col>",
                            "<col=ff0000>Feldip Hills</col>",
                            "<col=ff0000>Barrows</col>",
                            "<col=ff0000>More</col>");
                        stage = 1;
                        }
    why are you sending the options again? can't you just set the stage to 1? That would send the options properly and the buttons should work
    Tried that but then the back button doesn't work at all.
    Reply With Quote  
     

  5. #4  
    💰💰💰💰💰💰

    Con Artist's Avatar
    Join Date
    Jan 2012
    Posts
    1,313
    Thanks given
    666
    Thanks received
    268
    Rep Power
    89
    Code:
    stage = 2;
    sendOptionsDialogue("Teleports",
                        "<col=ff0000>Polypore Dungeon</col>",
                        "<col=ff0000>Brimhaven Dungeon</col>",
                        "<col=ff0000>Feldip Hills</col>",
                        "<col=ff0000>Barrows</col>",
                        "<col=ff0000>More</col>");
    Try this
    widdy widdy

    /|\
    / \
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Jul 2014
    Posts
    376
    Thanks given
    41
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Con Artist View Post
    Code:
    stage = 2;
    sendOptionsDialogue("Teleports",
                        "<col=ff0000>Polypore Dungeon</col>",
                        "<col=ff0000>Brimhaven Dungeon</col>",
                        "<col=ff0000>Feldip Hills</col>",
                        "<col=ff0000>Barrows</col>",
                        "<col=ff0000>More</col>");
    Try this
    Fixed thanks to the user 'Banners' .
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 05-21-2013, 07:51 PM
  2. 718 Dialogues arent working...
    By epicn in forum Help
    Replies: 7
    Last Post: 12-30-2012, 07:39 AM
  3. [718] Shops, added but not working.
    By sir chad in forum Help
    Replies: 2
    Last Post: 08-06-2012, 06:09 PM
  4. Replies: 1
    Last Post: 03-19-2012, 05:14 PM
  5. Replies: 11
    Last Post: 09-04-2011, 10:56 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
  •