dmmslaver Posted December 6, 2016 Share Posted December 6, 2016 (edited) 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 December 6, 2016 by dmmslaver Quote Link to comment Share on other sites More sharing options...
tampera666 Posted December 6, 2016 Share Posted December 6, 2016 good question Quote Link to comment Share on other sites More sharing options...
swiffyp Posted December 6, 2016 Share Posted December 6, 2016 (edited) nevermind, misunderstood the question Edited December 6, 2016 by swiffyp Quote Link to comment Share on other sites More sharing options...
House Posted December 6, 2016 Share Posted December 6, 2016 (edited) 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 Edited December 6, 2016 by House Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 6, 2016 Share Posted December 6, 2016 (edited) isVisible() boolean isVisible() Checks if an entity is visible on the main game screen. Edited December 6, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted December 7, 2016 Author Share Posted December 7, 2016 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 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 Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 7, 2016 Share Posted December 7, 2016 (edited) 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 December 7, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted December 7, 2016 Author Share Posted December 7, 2016 (edited) try isOnScreen() or just looking through the API you might find something http://osbot.org/api/org/osbot/rs07/api/model/Entity NPC isVisible and isOnScreen. Red is bounding box. Blue is mouse pos. Edited December 7, 2016 by dmmslaver Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 7, 2016 Share Posted December 7, 2016 NPC isVisible and isOnScreen. Red is bounding box. Blue is mouse pos. then you need to write your own method. Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted December 7, 2016 Author Share Posted December 7, 2016 then you need to write your own method. No kidding mate thats why im here XD to see if the api allows checking to see which bounding box is on top! Quote Link to comment Share on other sites More sharing options...