Thread: 718 Dialogue Issue

Results 1 to 5 of 5
  1. #1 718 Dialogue Issue 
    Registered Member
    Join Date
    May 2015
    Posts
    44
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Hello,

    Tried having a dialog for an object, but the dialog will not continue after the first sendDialog in the start method. Apparently, the last dialogue is null, but I tried setting other dialogs before it and could not get it to work. (By other dialogs, I am referring to using the "sendDialog" method in the Dialogue class.

    Code:
    package com.rs.game.player.dialogues;
    
    import com.rs.Settings;
    import com.rs.StaticIds;
    import com.rs.game.WorldTile;
    
    public class MarketPortal extends Dialogue {
    
    	@Override
    	public void start() {
    		sendDialogue("This portal is used to teleport players to the market.");
                    stage = 1;
    	}
    
    	public void run(int interfaceId, int componentId) {
    		if(stage == -1) {
    			sendOptionsDialogue("Would you like to visit the market?",
    					"Yes", "No");
    			stage = 1;
    		} else if (stage == 1) {
    			if (componentId == OPTION_1) {
    				player.teleportPlayer(Settings.MARKET_LOCATION.getX(), Settings.MARKET_LOCATION.getY(), 0);
    				player.send_message("Welcome to the market!");
    			} else {
    				player.getInterfaceManager().closeChatBoxInterface();
    				end();
    			}
    			
    		} else if(stage == 2) {
    			player.getInterfaceManager().closeChatBoxInterface();
    			end();
    		}
    	}
    
    	@Override
    	public void finish() {
    
    	}
    
    }
    Any help is appreciated, thank you.
    Reply With Quote  
     

  2. #2  
    ZzzzZzzzzZzzzzZzzz
    Shoutout's Avatar
    Join Date
    Sep 2014
    Posts
    259
    Thanks given
    19
    Thanks received
    7
    Rep Power
    11
    Code:
    public void start() {
    		sendDialogue("This portal is used to teleport players to the market.");
                    stage = 1;
    	}
    try removing
    Code:
    stage = 1;
    there
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2015
    Posts
    44
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by brie View Post
    Code:
    public void start() {
    		sendDialogue("This portal is used to teleport players to the market.");
                    stage = 1;
    	}
    try removing
    Code:
    stage = 1;
    there
    Attempted removing before and had no success.
    Reply With Quote  
     

  4. #4  
    Registered Member Soul Hunter's Avatar
    Join Date
    May 2013
    Posts
    232
    Thanks given
    1
    Thanks received
    14
    Rep Power
    0
    you have two options yes and no.
    Code:
    if (componentId == OPTION_1) {
    }
    else if (componentId == OPTION_2) {
    }
    that will do


    Code:
    else if (componentId == OPTION_2) {
    
    player.getInterfaceManager().closeChatBoxInterface();
    			end();
    
    }

    and delete stage == -1 and change it into 1.

    Code:
     if stage ==-1
    finally
    Code:
    package com.rs.game.player.dialogues;
    
    import com.rs.Settings;
    import com.rs.StaticIds;
    import com.rs.game.WorldTile;
    
    public class MarketPortal extends Dialogue {
    
    	@Override
    	public void start() {
    		sendDialogue("This portal is used to teleport players to the market.");
                    stage = 1;
    	}
    
    	public void run(int interfaceId, int componentId) {
    		if(stage == 1) {
    			sendOptionsDialogue("Would you like to visit the market?",
    					"Yes", "No");
    			stage = 2;
    		} else if (stage == 2) {
    			if (componentId == OPTION_1) {
    				player.teleportPlayer(Settings.MARKET_LOCATION.getX(), Settings.MARKET_LOCATION.getY(), 0);
    				player.send_message("Welcome to the market!");
    			} 
                      else if (componentId == OPTION_2) {
    
                    player.getInterfaceManager().closeChatBoxInterface();
    			end();
    
                    }
                    }
    			
    		
    	}
    
    	@Override
    	public void finish() {
    
    	}
    
    }
    Reply With Quote  
     

  5. #5  
    Registered Member
    Zach's Avatar
    Join Date
    Aug 2013
    Posts
    1,120
    Thanks given
    24
    Thanks received
    513
    Rep Power
    5000
    Code:
    package com.rs.game.player.dialogues;
    
    import com.rs.Settings;
    import com.rs.StaticIds;
    import com.rs.game.WorldTile;
    
    
    public class MarketPortal extends Dialogue {
    	
    	/**
    	* Starts the dialogue
    	*/
    	
    	public MarketPortal() {
    		
    	}
    	
    	@Override
    	public void start() {
    		sendDialogue("This portal is used to teleport players to the market.");
    	}
    	
    	/**
    	* Runs the dialogue
    	*/
    	
    	@Override
    	public void run(int interfaceId, int componentId) {
    		if (stage == -1) {
    			stage = 0;
    			sendOptionsDialogue("Would you like to visit the market?",
    			"Yes",
    			"No");
    		} else if (stage == 0) {
    			if (componentId == OPTION_1) {
    				player.teleportPlayer(Settings.MARKET_LOCATION.getX(), Settings.MARKET_LOCATION.getY(), 0);
    				player.send_message("Welcome to the market!");
    				end();
    			} else {
    				player.getInterfaceManager().closeChatBoxInterface();
    				end();
    			}
                    }
    	}
    	
    	@Override
    	public void finish() {
    		
    	}
    }
    also make sure you have it in the dialogue handler.
    ZachTX's RSPS Video Services (10,000+ Loyal RSPS Subscribers)
    CLICK HERE!

    Attached image
    Reply With Quote  
     


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. 718 Dialogue
    By blayke in forum Requests
    Replies: 5
    Last Post: 08-11-2012, 07:27 AM
  2. NPC Dialogue Issue :-(
    By dead fury in forum Help
    Replies: 5
    Last Post: 07-26-2012, 07:59 AM
  3. PI Dialogue issues
    By Most Dope in forum Help
    Replies: 3
    Last Post: 06-13-2012, 05:27 AM
  4. NPC Dialogue Issue :-(
    By dead fury in forum Help
    Replies: 2
    Last Post: 06-03-2012, 05:28 PM
  5. Player Head Dialogue Issue.
    By Onlyme in forum Help
    Replies: 8
    Last Post: 06-06-2011, 10:08 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
  •