Thread: Second Map Region

Results 1 to 4 of 4
  1. #1 Second Map Region 
    Member
    Join Date
    Sep 2012
    Age
    27
    Posts
    172
    Thanks given
    22
    Thanks received
    7
    Rep Power
    0
    So0 earlier this day I added the construct map region packet. I'ts working well, except for one little bug. You have to initialize the code twice to actually see the place, so if I would have this code:
    Code:
    if (command.startsWith("construct")) {
    				Palette palette = new Palette();
    		        Tile tile = new Tile(3222, 3222, 0);
    		 
    		        PaletteTile paletteTile = new PaletteTile(tile.getTileX(), tile.getTileY(), 0);
    		        palette.setTile(6, 6, 0, paletteTile);
    		                
    		        for (int j = -3; j < 3; j++) {
    		            for (int i = -3; i < 3; i++) {
    		                PaletteTile palTile = new PaletteTile(tile.getTileX() + (8 * j), tile.getTileY() + (8 * i), 0);
    		                palette.setTile(6 + j, 6 + i, 0, palTile);
    		            }
    		        }
    		        c.getPA().sendConstructMapRegion(palette);
    		        c.getPA().movePlayer(50, 50, 0);
    			}
    and I type ::construct, it will send me to a black map, and only show the actual map when I type ::construct again. Am I doing something wrong here?
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    move the player to the location first
    Reply With Quote  
     

  3. #3  
    Community Veteran


    Join Date
    Sep 2007
    Posts
    370
    Thanks given
    127
    Thanks received
    170
    Rep Power
    417
    Code:
      public void reload() {
            player.getActionSender().sendConstructionStatus(building_mode
                    ? 1
                    : 5);
    
            Point location = player.getLocation();
    
            player.setMapMode(MapMode.MODE_NORMAL);
            player.teleport(300, 300, 1);
            player.getActionSender().sendMapArea();
            construct_house(player);
            player.teleport(location.getX(), location.getY(), location.getHeight());
            player.getActionSender().sendConstructionStatus(0);
        }
    Send a map area packet (Different to where you are) then send the construction packet, I used 300,300 as theres no map data there so it wont affect the loading time.
    Original founder of this site
    8 Year RSPS Veteran
    Java programmer of 7 years
    Advanced PHP Programmer
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Member
    Join Date
    Sep 2012
    Age
    27
    Posts
    172
    Thanks given
    22
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by Gander View Post
    Code:
      public void reload() {
            player.getActionSender().sendConstructionStatus(building_mode
                    ? 1
                    : 5);
    
            Point location = player.getLocation();
    
            player.setMapMode(MapMode.MODE_NORMAL);
            player.teleport(300, 300, 1);
            player.getActionSender().sendMapArea();
            construct_house(player);
            player.teleport(location.getX(), location.getY(), location.getHeight());
            player.getActionSender().sendConstructionStatus(0);
        }
    Send a map area packet (Different to where you are) then send the construction packet, I used 300,300 as theres no map data there so it wont affect the loading time.
    Thanks for the help, gonna try this.
    Edit: Woked like a charm, thanks bud.
    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. Replies: 7
    Last Post: 06-12-2014, 08:57 AM
  2. Map Region packet structure..
    By popbob in forum Help
    Replies: 4
    Last Post: 06-24-2009, 01:13 PM
  3. 550 Map Region Packet?
    By IDX in forum RS 503+ Client & Server
    Replies: 3
    Last Post: 06-19-2009, 07:56 PM
  4. Map Regions + Walk Queue?
    By r ip in forum Help
    Replies: 2
    Last Post: 03-29-2009, 12:08 PM
  5. Replies: 3
    Last Post: 03-16-2009, 02:57 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •