Jump to content

How do I create PolygonArea?

Recommended Posts

public PolygonArea test = new PolygonArea();

this is as far as i got. would be really cool to use some polygons instead of the boring old area boxes i'm using right now. also if anyone knows how to detect when the player is stunned (for thieving release) and how to tell which gyr falcon is mine (detecting the yellow arrow above it, for a hunter release)


edit: just incase it's unclear i want to add points to make a polygon not just declare it like i've already done.

Edited by shiny greninja
Link to comment
Share on other sites

use any of the following parameters:






PolygonArea poly = new PolygonArea(new Position[] {new Position(1,1,0), new Position(1,1,0), new Position(1,1,0)});



change the positions and add more etc tongue.png

thanks this is exactly what i was looking for :D i'm still new to osbot's api. it's almost identical to others but some things are done slightly differently. this was one of them. thanks again!


just do

Area area = new Area(new Position[] {add your positions here});

or you can make the position array a variable and do it that way

thanks for the fast reply! 2 different reputable responses, now i can't decide which one to use. i could use both since there's 2 different polygons in the location i'm finishing (for dat rooftop script haha)

Link to comment
Share on other sites

For stun detection there is probably a config variable. But if you don't want to go into that, you can simply check the height of your players model (the stun particles become part of the player model, I assume).

Something like myPlayer().getModelHeight() > defaultHeight.


You'll have to check what the default model height is for your player while it's not stunned. This may differ depending on hair/helm, though.

Alternatively, check the verticecount on the model.

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.

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.

  • Recently Browsing   0 members

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