Jump to content

How to detect if another object is on top of an npc


dmmslaver
 Share

Recommended Posts

How can I tell if an object such as a wall is on top of an NPC? This would be used for when an NPC you want to thieve is totally hidden behind a wall. Yes, you can still thieve the NPC through the wall by simply clicking the wall where the NPC is behind it however seems extremely botlike as a player would rotate the camera to actually see the NPC. I tried to fix this by looping every object and checking if any of them contain the current mouse click x, y of the NPC. However, this also triggers if there is an object such as a wall behind the NPC, as well as when it's in front (which is desired behavior).
Is there some way to check if one object drawn on top of another? Or a better way to do this? Thanks!

Edited by dmmslaver
Link to comment
Share on other sites

 

isVisible()

 

boolean isVisible()
Checks if an entity is visible on the main game screen.

 

 

 

nvm i thought the point was to click the npc even through a wall (eg ardy knights)

 

like teamcape said isVisible() tells you if it is covered or not smile.png

Seems that isVisible always returns true if the object is clickable. The idea would be to move the camera around so that the player could actually see the npc and it not be totally obscured by a wall, no? It only returns false when the npc is out of camera view range/direction entirely, regardless of if it's obscured behind and object

Link to comment
Share on other sites

Seems that isVisible always returns true if the object is clickable. The idea would be to move the camera around so that the player could actually see the npc and it not be totally obscured by a wall, no? It only returns false when the npc is out of camera view range/direction entirely, regardless of if it's obscured behind and object

 

try isOnScreen() or just looking through the API you might find something

 

http://osbot.org/api/org/osbot/rs07/api/model/Entity

Edited by Imateamcape
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...