Thread: Get object at location gives object with a null name

Results 1 to 5 of 5
  1. #1 Get object at location gives object with a null name 
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    In the exotic server I am using this method
    Code:
    public WorldObject getObjectAtLocation(Location3D location) {
    		Region region = getRegion(location.getX(), location.getY());
    		if (region == null) {
    			return null;
    		}
    		for (WorldObject worldObject : worldObjects.get(region.id)) {
    			if (worldObject.x == location.getX() && worldObject.y == location.getY() && worldObject.height == location.getZ()) {
    				return worldObject;
    			}
    		}
    		return null;
    	}
    To get a WorldObject at the location.
    I try to get the object at location (3244, 3216) which is the right church door of the church in lumbridge.
    I get an object, but when I get the object name it says that it's null, while it definitely isn't.
    I'm trying to make double doors working and when I use this method in vencillio base, then the name isn't null, so there is something that fucks it up.
    Attached image
    Reply With Quote  
     

  2. #2  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    1. You're not checking for height.
    2. You're not checking for object type.
    3. It's possible you're one coordinate off from the true location as doors are "odd" objects and appear "between" tiles.
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Kris View Post
    1. You're not checking for height.
    2. You're not checking for object type.
    3. It's possible you're one coordinate off from the true location as doors are "odd" objects and appear "between" tiles.
    1. You're not checking for height.
      This is height, right?
      && worldObject.height == location.getZ()
    2. You're not checking for object type.
      Did this plus checking for faces. WORKS!
    3. It's possible you're one coordinate off from the true location as doors are "odd" objects and appear "between" tiles.
      No problem with this

    Thank you for the help!
    Attached image
    Reply With Quote  
     

  5. #4  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by RememberM3 View Post
    1. You're not checking for height.
      This is height, right?
      && worldObject.height == location.getZ()
    2. You're not checking for object type.
      Did this plus checking for faces. WORKS!
    3. It's possible you're one coordinate off from the true location as doors are "odd" objects and appear "between" tiles.
      No problem with this

    Thank you for the help!
    Oh I'm blind as shit, sorry didn't see the first one o.O
    Attached image
    Reply With Quote  
     

  6. #5  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Kris View Post
    Oh I'm blind as shit, sorry didn't see the first one o.O
    hahaha, You still helped me, so no worries.
    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. Replies: 13
    Last Post: 08-29-2009, 07:11 AM
  2. Replies: 1
    Last Post: 08-16-2009, 06:55 PM
  3. Get Experience when click on Object
    By rb0opkz in forum Requests
    Replies: 5
    Last Post: 08-16-2009, 03:46 PM
  4. Spawning objects at absolute X and Y
    By Spooky in forum Help
    Replies: 1
    Last Post: 08-03-2009, 12:30 PM
  5. how to give objects effect (delta)
    By Zamrok in forum Help
    Replies: 0
    Last Post: 04-09-2009, 09:21 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
  •