December 6, 20169 yr 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, 20169 yr by dmmslaver
December 6, 20169 yr 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, 20169 yr by House
December 6, 20169 yr isVisible() boolean isVisible() Checks if an entity is visible on the main game screen. Edited December 6, 20169 yr by Imateamcape
December 7, 20169 yr Author 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
December 7, 20169 yr 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, 20169 yr by Imateamcape
December 7, 20169 yr Author 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, 20169 yr by dmmslaver
December 7, 20169 yr NPC isVisible and isOnScreen. Red is bounding box. Blue is mouse pos. then you need to write your own method.
December 7, 20169 yr Author 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!
Create an account or sign in to comment