dmmslaver Posted December 6, 2016 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
swiffyp Posted December 6, 2016 Posted December 6, 2016 (edited) nevermind, misunderstood the question Edited December 6, 2016 by swiffyp
House Posted December 6, 2016 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
Team Cape Posted December 6, 2016 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
dmmslaver Posted December 7, 2016 Author 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
Team Cape Posted December 7, 2016 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
dmmslaver Posted December 7, 2016 Author 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
Team Cape Posted December 7, 2016 Posted December 7, 2016 NPC isVisible and isOnScreen. Red is bounding box. Blue is mouse pos. then you need to write your own method.
dmmslaver Posted December 7, 2016 Author 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!