Thread: Can't follow or attack any players in wilderness from distance

Results 1 to 7 of 7
  1. #1 Can't follow or attack any players in wilderness from distance 
    Registered Member Grandpa's Avatar
    Join Date
    Dec 2015
    Posts
    94
    Thanks given
    12
    Thanks received
    2
    Rep Power
    13
    Remove*
     

  2. #2  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    23
    Posts
    1,497
    Thanks given
    458
    Thanks received
    237
    Rep Power
    244
    Quote Originally Posted by Grandpa View Post
    ...

    java.lang.NullPointerException
    at org.mistex.game.world.clip.region.Region.getClippi ng(Region.java:372)
    at org.mistex.game.world.PathFinder.findRoute(PathFin der.java:58)

    there is your issue.

    maybe your clipping is not initialised? post the code at that point and also on start up check if your server is loading information about clipping of files like worldmap.bin or .gz files


    [Only registered and activated users can see links. ] [Closed]

    [Only registered and activated users can see links. ]
     

  3. #3  
    Registered Member Grandpa's Avatar
    Join Date
    Dec 2015
    Posts
    94
    Thanks given
    12
    Thanks received
    2
    Rep Power
    13
    Quote Originally Posted by Shadowy View Post
    java.lang.NullPointerException
    at org.mistex.game.world.clip.region.Region.getClippi ng(Region.java:372)
    at org.mistex.game.world.PathFinder.findRoute(PathFin der.java:58)

    there is your issue.

    maybe your clipping is not initialised? post the code at that point and also on start up check if your server is loading information about clipping of files like worldmap.bin or .gz files



    This is source startup
    Code:
     Loaded 2749 npcs.
    [Console]: Control Panel disabled.
    [ObjectDef] Configuration has been loaded...
    jul 22, 2016 2:05:45 EM org.mistex.game.world.player.item.Item load
    INFO: Items have been loaded.
    jul 22, 2016 2:05:45 EM org.mistex.game.world.shop.Shops loadShops
    INFO: Initialized shops.
    jul 22, 2016 2:05:45 EM org.mistex.game.world.PunishmentHandler initialize
    INFO: Connections initialized.
    jul 22, 2016 2:05:45 EM org.mistex.system.util.HostBlacklist loadBlacklist
    INFO: Black lists have been have initialized.
    jul 22, 2016 2:05:45 EM org.mistex.game.Mistex <init>
    INFO: TriviaBot initialized.
    jul 22, 2016 2:05:45 EM org.mistex.game.Mistex <init>
    INFO: Global Messages initialized.
    jul 22, 2016 2:05:45 EM org.mistex.game.Mistex setupLoginChannels
    INFO: Login channels initialized.
    jul 22, 2016 2:05:45 EM org.mistex.game.Mistex main
    INFO: Mistex is now online!
    jul 22, 2016 2:05:45 EM org.mistex.game.world.content.SkillLead loadLeaders
    INFO: Skill Leaders have been loaded succesfully.
    Total Used Memory: 29*746/226*816 MB, 13,11%
    Free Memory: 197*069 MB, 86,89%
    Client startup
    Code:
     Loading VPS client.
    Maps Loaded: 1226
    Overlay Floors Loaded: 185
    Items Loaded: 22322
    Npcs Loaded: 11257
    (Region.java372) Eclipse brought me here
    Code:
     	public static int getClipping(int x, int y, int height) {
    		if (height > 3)
    			height = 0;
    		int regionX = x >> 3;
    		int regionY = y >> 3;
    		int regionId = ((regionX / 8) << 8) + (regionY / 8);
    		for (Region r : regions) { //* This was highlighted.
    			if (r != null) {
    				if (r.id() == regionId) {
    					return r.getClip(x, y, height);
    				}
    			}
    		}
    		return 0;
    	}
     

  4. #4  
    Registered Member
    Join Date
    Dec 2013
    Posts
    256
    Thanks given
    90
    Thanks received
    56
    Rep Power
    309
    It thinks your regions array is null. Try extending the bounds. Target might be outside the search radius so the array does not get set. I'm guessing though.
     

  5. #5  
    Registered Member Grandpa's Avatar
    Join Date
    Dec 2015
    Posts
    94
    Thanks given
    12
    Thanks received
    2
    Rep Power
    13
    Quote Originally Posted by Kiissmyswagb View Post
    It thinks your regions array is null. Try extending the bounds. Target might be outside the search radius so the array does not get set. I'm guessing though.
    That was alot of terminology :O Still a beginner but thanks appreciate.

    This is a array right?
    Code:
     public static int getClipping(int x, int y, int height) {
    		if (height > 3)
    			height = 0;
    		int regionX = x >> 3;
    		int regionY = y >> 3;
    		int regionId = ((regionX / 8) << 8) + (regionY / 8);
    		for (Region r : regions) { //* This was highlighted.
    			if (r != null) {
    				if (r.id() == regionId) {
    					return r.getClip(x, y, height);
    				}
    			}
    		}
    		return 0;
    	}
    - Arrays

    An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the "Hello World!" application. This section discusses arrays in greater detail.

    Code:
     public static int getClipping(int x, int y, int height) {
    		if(height > 3)
    			height = 0;
            int regionX = x >> 3;
            int regionY = y >> 3;
            int regionId = ((regionX / 8) << 8) + (regionY / 8);
            for (Region r : regions) {
                if (r.id() == regionId) {
                    return r.getClip(x, y, height);
                }
            }
            return 0;
        }
    will this fix it :O i'll test
    Edit* I could't fix it ):
     

  6. #6  
    Registered Member
    Join Date
    Dec 2013
    Posts
    256
    Thanks given
    90
    Thanks received
    56
    Rep Power
    309
    Well you proved you have no java knowledge. So I'm just going to cheap hax it fixed for you.

    Replace getClipping with this:

    Code:
    public static int getClipping(int x, int y, int height) {
    		if (height > 3)
    			height = 0;
    		int regionX = x >> 3;
    		int regionY = y >> 3;
    		int regionId = ((regionX / 8) << 8) + (regionY / 8);
                    if (regions != null) {
    		for (Region r : regions) { //* This was highlighted.
    			if (r != null) {
    				if (r.id() == regionId) {
    					return r.getClip(x, y, height);
    				}
    			}
    		}
                    }
    		return 0;
    	}
     

  7. Thankful user:


  8. #7  
    Registered Member Grandpa's Avatar
    Join Date
    Dec 2015
    Posts
    94
    Thanks given
    12
    Thanks received
    2
    Rep Power
    13
    Quote Originally Posted by Kiissmyswagb View Post
    Well you proved you have no java knowledge. So I'm just going to cheap hax it fixed for you.

    Replace getClipping with this:

    Code:
    public static int getClipping(int x, int y, int height) {
    		if (height > 3)
    			height = 0;
    		int regionX = x >> 3;
    		int regionY = y >> 3;
    		int regionId = ((regionX / 8) << 8) + (regionY / 8);
                    if (regions != null) {
    		for (Region r : regions) { //* This was highlighted.
    			if (r != null) {
    				if (r.id() == regionId) {
    					return r.getClip(x, y, height);
    				}
    			}
    		}
                    }
    		return 0;
    	}
    Thanks alot i read some more about arrays after my stupid array post it WORKED! Appreciate @
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Replies: 50
    Last Post: 09-06-2010, 06:55 PM
  2. Replies: 21
    Last Post: 05-20-2010, 05:33 AM
  3. Replies: 20
    Last Post: 07-05-2009, 11:45 PM
  4. Replies: 16
    Last Post: 05-07-2009, 09:12 AM
  5. Replies: 13
    Last Post: 11-06-2008, 01:36 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
  •